dharr

Dr. David Harrington

9037 Reputation

22 Badges

21 years, 197 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@salim-barzani Most equations look correct but odetest fails - maybe check some assumptions or try some numerical checks, or maybe the theory doesn't work.

restart

with(PDEtools)

undeclare(prime, quiet)

declare(u(x, t), quiet); declare(U(xi), quiet); declare(V(xi), quiet); declare(Omega(x, y, t), quiet); declare(Q(x, t), quiet); declare(R(x, t), quiet); declare(CHI(x, t), quiet); declare(Z(x, t), quiet)

pde1 := I*(diff(Omega(x, y, t), t))-I*(diff(Omega(x, y, t), x))+alpha[1]*(diff(Omega(x, y, t), `$`(x, 2)))+alpha[2]*(diff(Omega(x, y, t), `$`(y, 2)))+alpha[3]*(diff(Omega(x, y, t), x, y))-alpha[4]*Omega(x, y, t)*U(p*x+q*y-t*v)^2

I*(diff(Omega(x, y, t), t))-I*(diff(Omega(x, y, t), x))+alpha[1]*(diff(diff(Omega(x, y, t), x), x))+alpha[2]*(diff(diff(Omega(x, y, t), y), y))+alpha[3]*(diff(diff(Omega(x, y, t), x), y))-alpha[4]*Omega(x, y, t)*U(p*x+q*y-t*v)^2

G1 := U(p*x+q*y-t*v) = U(xi); G2 := (D(U))(p*x+q*y-t*v) = diff(U(xi), xi); G3 := ((D@@2)(U))(p*x+q*y-t*v) = diff(U(xi), `$`(xi, 2)); G4 := ((D@@3)(U))(p*x+q*y-t*v) = diff(U(xi), `$`(xi, 3)); G5 := ((D@@4)(U))(p*x+q*y-t*v) = diff(U(xi), `$`(xi, 4)); G6 := ((D@@5)(U))(p*x+q*y-t*v) = diff(U(xi), `$`(xi, 5))

T := xi = p*x+q*y-t*v; T1 := Omega(x, y, t) = U(p*x+q*y-t*v)*exp(I*(-r*t+theta*y+w*x+phi))

P1 := I*(diff(Omega(x, y, t), t))-I*(diff(Omega(x, y, t), x))+alpha[1]*(diff(Omega(x, y, t), `$`(x, 2)))+alpha[2]*(diff(Omega(x, y, t), `$`(y, 2)))+alpha[3]*(diff(Omega(x, y, t), x, y))-alpha[4]*Omega(x, y, t)*U(p*x+q*y-t*v)^2

P11 := eval(P1, {T, T1})

P111 := subs({G1, G2, G3, G4, G5, G6}, P11)

pde1 := P111 = 0

D1 := numer(lhs(pde1))*denom(rhs(pde1)) = numer(rhs(pde1))*denom(lhs(pde1)); simplify(%, 'symbolic'); ode := collect(%, {U(xi), diff(diff(U(xi), xi), xi)})

-alpha[4]*U(xi)^3*exp(I*(-r*t+theta*y+w*x+phi))+exp(I*(-r*t+theta*y+w*x+phi))*(-alpha[1]*w^2-(theta*alpha[3]-1)*w-theta^2*alpha[2]+r)*U(xi)+exp(I*(-r*t+theta*y+w*x+phi))*(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])*(diff(diff(U(xi), xi), xi))+I*exp(I*(-r*t+theta*y+w*x+phi))*((theta*alpha[3]+2*w*alpha[1]-1)*p+2*q*theta*alpha[2]+q*w*alpha[3]-v)*(diff(U(xi), xi)) = 0

Eq. 37

ode1 := expand(lhs(ode)/exp(I*(-r*t+theta*y+w*x+phi)))

I*(diff(U(xi), xi))*p*theta*alpha[3]+(2*I)*(diff(U(xi), xi))*p*w*alpha[1]+(2*I)*(diff(U(xi), xi))*q*theta*alpha[2]+I*(diff(U(xi), xi))*q*w*alpha[3]-U(xi)^3*alpha[4]-U(xi)*theta^2*alpha[2]-U(xi)*theta*w*alpha[3]-U(xi)*w^2*alpha[1]+(diff(diff(U(xi), xi), xi))*p^2*alpha[1]+(diff(diff(U(xi), xi), xi))*p*q*alpha[3]+(diff(diff(U(xi), xi), xi))*q^2*alpha[2]-I*(diff(U(xi), xi))*p-I*(diff(U(xi), xi))*v+U(xi)*r+U(xi)*w

ode11 := evalc(Re(ode1))*o

-U(xi)^3*alpha[4]-U(xi)*theta^2*alpha[2]-U(xi)*theta*w*alpha[3]-U(xi)*w^2*alpha[1]+(diff(diff(U(xi), xi), xi))*p^2*alpha[1]+(diff(diff(U(xi), xi), xi))*p*q*alpha[3]+(diff(diff(U(xi), xi), xi))*q^2*alpha[2]+U(xi)*r+U(xi)*w

ode111 := collect(ode11, {U(xi), diff(diff(U(xi), xi), xi)})

-U(xi)^3*alpha[4]+(-theta^2*alpha[2]-theta*w*alpha[3]-w^2*alpha[1]+r+w)*U(xi)+(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])*(diff(diff(U(xi), xi), xi))

Eq, 5.1

ode1111 := collect(ode111/DEtools:-dcoeffs(ode111, U(xi))[1], U(xi))

-U(xi)^3*alpha[4]/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])+(-theta^2*alpha[2]-theta*w*alpha[3]-w^2*alpha[1]+r+w)*U(xi)/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])+diff(diff(U(xi), xi), xi)

Note that each term in the Hamiltonian integrand when differentiated wrt U(xi) gives a term in ode. (I have no idea why we do this.) So differentiating wrt xi would give a term in the ode multiplied by diff(U(xi),xi) (using the chain rule). So we can set up a differential equation for the integrand f(xi)

def := diff(f(xi), xi) = ode1111*(diff(U(xi), xi))

diff(f(xi), xi) = (-U(xi)^3*alpha[4]/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])+(-theta^2*alpha[2]-theta*w*alpha[3]-w^2*alpha[1]+r+w)*U(xi)/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])+diff(diff(U(xi), xi), xi))*(diff(U(xi), xi))

We want the first integral of this

DEtools:-firint(def, f(xi)); integrand := collect(solve(eval(%, {_C1 = 0, c__1 = 0}), f(xi)), diff, simplify)

f(xi)+((1/4)*alpha[4]*U(xi)^4+(1/2)*(-p^2*alpha[1]-p*q*alpha[3]-q^2*alpha[2])*(diff(U(xi), xi))^2+(1/2)*(theta^2*alpha[2]+theta*w*alpha[3]+w^2*alpha[1]-r-w)*U(xi)^2)/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])+_C1 = 0

(1/2)*(diff(U(xi), xi))^2-U(xi)^2*(alpha[4]*U(xi)^2+2*theta^2*alpha[2]+2*theta*w*alpha[3]+2*alpha[1]*w^2-2*r-2*w)/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])

From which we can extract chi and delta, Eq 41.

K := op(1, integrand); P := collect(-op(2, integrand), U(xi))

(1/2)*(diff(U(xi), xi))^2

U(xi)^4*alpha[4]/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])+(2*theta^2*alpha[2]+2*theta*w*alpha[3]+2*w^2*alpha[1]-2*r-2*w)*U(xi)^2/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])

Eq. 5.6

H := K+P

(1/2)*(diff(U(xi), xi))^2+U(xi)^4*alpha[4]/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])+(2*theta^2*alpha[2]+2*theta*w*alpha[3]+2*w^2*alpha[1]-2*r-2*w)*U(xi)^2/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])

Eq. 5.7

sol1 := U(xi) = m*cos(delta*xi)

U(xi) = m*cos(delta*xi)

Eq. 5.10

eval(convert(H, D), xi = 0); H0 := collect(eval(%, {U(0) = m, (D(U))(0) = 0}), m)

(1/2)*(D(U))(0)^2+U(0)^4*alpha[4]/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])+(2*theta^2*alpha[2]+2*theta*w*alpha[3]+2*w^2*alpha[1]-2*r-2*w)*U(0)^2/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])

m^4*alpha[4]/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])+(2*theta^2*alpha[2]+2*theta*w*alpha[3]+2*w^2*alpha[1]-2*r-2*w)*m^2/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])

Eq. 5.11 - looks correct

H1 := eval(H, sol1)-H0

(1/2)*m^2*delta^2*sin(delta*xi)^2+m^4*cos(delta*xi)^4*alpha[4]/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])+(2*theta^2*alpha[2]+2*theta*w*alpha[3]+2*w^2*alpha[1]-2*r-2*w)*m^2*cos(delta*xi)^2/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])-m^4*alpha[4]/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])-(2*theta^2*alpha[2]+2*theta*w*alpha[3]+2*w^2*alpha[1]-2*r-2*w)*m^2/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])

Eq. 5.12 - looks correct

H2 := collect(algsubs(delta*xi = (1/4)*Pi, H1), delta, proc (x) options operator, arrow; collect(x, m) end proc)

(1/4)*m^2*delta^2-(3/16)*m^4*alpha[4]/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])-(1/16)*(4*theta^2*alpha[2]+4*theta*w*alpha[3]+4*w^2*alpha[1]-4*r-4*w)*m^2/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])

Eq. 5.13

delta = sort([solve(H2, delta)])[2]; eqphi := `assuming`([simplify(%)], [p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2] > 0])

delta = (1/2)*((p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])*(3*m^2*alpha[4]+4*theta^2*alpha[2]+4*theta*w*alpha[3]+4*w^2*alpha[1]-4*r-4*w))^(1/2)/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])

delta = (1/2)*(4*alpha[1]*w^2+(4*theta*alpha[3]-4)*w+3*m^2*alpha[4]+4*theta^2*alpha[2]-4*r)^(1/2)/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])^(1/2)

sol2 := simplify(eval(sol1, eqphi))

U(xi) = m*cos((1/2)*(4*alpha[1]*w^2+(4*theta*alpha[3]-4)*w+3*m^2*alpha[4]+4*theta^2*alpha[2]-4*r)^(1/2)*xi/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])^(1/2))

simplify(odetest(sol2, ode1111), symbolic)

-4*m*cos((1/2)*(4*alpha[1]*w^2+(4*theta*alpha[3]-4)*w+3*m^2*alpha[4]+4*theta^2*alpha[2]-4*r)^(1/2)*xi/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])^(1/2))*(cos((1/2)*(4*alpha[1]*w^2+(4*theta*alpha[3]-4)*w+3*m^2*alpha[4]+4*theta^2*alpha[2]-4*r)^(1/2)*xi/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])^(1/2))^2*m^2*alpha[4]+(3/4)*m^2*alpha[4]+2*alpha[1]*w^2+(2*theta*alpha[3]-2)*w+2*theta^2*alpha[2]-2*r)/(4*p^2*alpha[1]+4*p*q*alpha[3]+4*q^2*alpha[2])

simplify(odetest(sol2, ode111), symbolic)

-(cos((1/2)*(4*alpha[1]*w^2+(4*theta*alpha[3]-4)*w+3*m^2*alpha[4]+4*theta^2*alpha[2]-4*r)^(1/2)*xi/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])^(1/2))^2*m^2*alpha[4]+(3/4)*m^2*alpha[4]+2*alpha[1]*w^2+(2*theta*alpha[3]-2)*w+2*theta^2*alpha[2]-2*r)*m*cos((1/2)*(4*alpha[1]*w^2+(4*theta*alpha[3]-4)*w+3*m^2*alpha[4]+4*theta^2*alpha[2]-4*r)^(1/2)*xi/(p^2*alpha[1]+p*q*alpha[3]+q^2*alpha[2])^(1/2))

 

 

NULL

Download u-1.mw

If I enter www.mapletransaction.org, it loads the page https://mapletransactions.org/index.php/maple and I see the journal home page. This is from an ip address in Canada, but not a university one.

The "about" page says it is a "diamond open access journal" so I don't see why there would be any geo restrictions.

@wingho In your listprocedure method, you don't need the psol(0.0001, 0.1); step.

The method I used is the default procedurelist method. The attached does both of them, through to extracting the u(x,t) values. They are both documented on the help page ?pdsolve,numeric

value.mw

@nm So a workaround for your version would be to use coulditbe

restart;
assume(_Z1,integer);
coulditbe(-Pi*_Z1+Pi=0);

gives true

@Alfred_F As I said, I don't have any problem with your solution, but the question is about what odetest does with the ic. You didn't do odetest(sol, [ode, ic], y(x)) - what does that give in Maple 2024?

@nm So that is different from 2025.2, see worksheet above.

@Alfred_F Yes, but the question is about why the OP got  [0, -Pi*_Z6 + Pi] and not [0,0]. My point is that the OP presumably got that from odetest, though they do not explicitly say that, and I can't replicate what they did.

For your solution, odetest(sol, [ode, ic], y(x)) also gives [0,undefined]. 

My Maple 2025.2 gives [0,undefined]. Still doesn't help you...

odetest.mw

@salim-barzani Here's how to get Paper 2; the same method doesn't seem to work for Paper 3 even though the transformation is the same. I don't understand the prolongation because the notation is significantly different from Maple's; in any case you don't need it because Maple does all the hard work.

Download Lie.mw

@janhardo I like the adjacency matrix approaches for their elegance, but in general other methods such as those based on depth-first search are more efficient. I'm guessing I developed this for this answer but eventually abandoned it in favour of DFS. 

@janhardo Yes, my procedure is definitely overkill for this, but I already had the code around.

As you already see in your 37 vertices case, the lines are too dense to see anything; for 50 it is mostly black. But even for smaller numbers of vertices what do you mean by animation? Just drawing frames of complete graphs with different numbers of vertices would mean the vertices jump around for every frame, which would not make a smooth animation. But perhaps you mean something else? 

@tedh I read the Python help page at some point and tried out the EvalString etc commands and decided that was awkward. I think I much later found how the code edit regions worked by randomly pasting some python code in, thinking "it's got to be easier than that". So I think Maplesoft has done a poor job of advertising how easy this is. Bottom line, the answer to your question is that I don't think there is much more to tell you other than what I already told you. Just paste Python code into a code edit region and it works.

There was a talk on using Jupyter notebooks with Maple at a Maple conference (2024?), which will be on YouTube somewhere.

@salim-barzani 

restart

For Eq 12 in new paper, taking - in "+/- ". The missing multiplication was interpreted as function calls.

u := (sqrt(-s/(2*(p^2-q^2)))*(a*x^alpha/alpha-b*t^beta/beta+nu))^(-1)

1/((-s/(2*p^2-2*q^2))^(1/2)*(a*x^alpha/alpha-b*t^beta/beta+nu))

U := (1/2)*(Int(u^2, x = -infinity .. infinity)); value(%)

(1/2)*(Int(-(2*p^2-2*q^2)/(s*(a*x^alpha/alpha-b*t^beta/beta+nu)^2), x = -infinity .. infinity))

(1/2)*(int(-(2*p^2-2*q^2)/(s*(a*x^alpha/alpha-b*t^beta/beta+nu)^2), x = -infinity .. infinity))

params := {a = 1, alpha = 1/2, beta = 1/2, nu = 1, p = 2, q = 1, s = 1, t = 1}

{a = 1, alpha = 1/2, beta = 1/2, nu = 1, p = 2, q = 1, s = 1, t = 1}

Derivative wrt b.
As before, the denominator goes to zero in the integration range (at x=1/4 for these parameter values). And the integrand is complex for negative x, so this set of parameters appears to be poorly chosen.

dU := simplify(diff(U, b)); eval(dU, `union`(params, {b = 1})); value(%)

2*(Int((p^2-q^2)*alpha^3*beta^2*t^beta/(s*(b*t^beta*alpha-a*x^alpha*beta-nu*alpha*beta)^3), x = -infinity .. infinity))

2*(Int((3/32)/(1/4-(1/2)*x^(1/2))^3, x = -infinity .. infinity))

undefined

``

Download T2.mw

@Roy Hughes This works in the latest version of Maple. If this is not working for you, please upload your worksheet.

Download laplace.mw

1 2 3 4 5 6 7 Last Page 1 of 97