dharr

Dr. David Harrington

8200 Reputation

22 Badges

20 years, 335 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 answers submitted by dharr

map[3](op@FileTools:-ListDirectory,currentdir(),'all','select'=~["*.mw","*.eps"]);

You odes and initial conditions need to be together in a set (or list). You also have three functions A(t), Ab(t), R(t) and only two odes; I'm assuming Ab(t) was meant to be A(t). Then it works. (I made c3 smaller to see something on the plot.)

dsolve_problem.mw

Your error disappears if you run the worksheet after a restart. Your graphs are all the same because although you change S[t] when you define your substitutions p1, p2 etc., there is no S[t] in the expression you are substituting into (which I've renamed ff since you are using f(x) for other purposes in your worksheet). You should be careful about using both S[t] and S as variables; if you set a value for S then S[t] will not be defined -- to solve this use S__t instead of S[t]; they look almost the same on output (the first has the t in italics).

To change the view for the plot, use view=[0..1,0..1].

sstf.mw

After transforming to xi, evalc(Re()) and evalc(Im()) work as you would expect, and you get Eq. (1.5). (I find the pdes easier to manipulate if you leave off the =0, which is usually assumed anyway for many Maple commands, such as pdsolve.)

restart

with(PDEtools)

interface(showassumed = 0)

NULL

declare(q(x, t), qr(x, t)); declare(phi(xi))

q(x, t)*`will now be displayed as`*q

qr(x, t)*`will now be displayed as`*qr

phi(xi)*`will now be displayed as`*phi

pde := diff(diff(q(x, t), t), x)+q(x, t)-(2*I)*q(x, t)*qr(x, t)*(diff(q(x, t), x))

diff(diff(q(x, t), t), x)+q(x, t)-(2*I)*q(x, t)*qr(x, t)*(diff(q(x, t), x))

Q := phi(-c*t+x)*exp(I*(k*x-Omega*t+theta(-c*t+x))); rel := {q(x, t) = Q, qr(x, t) = subs({t = -t, x = -x}, Q)}; pde1 := simplify(eval(pde, rel))

phi(-c*t+x)*exp(I*(k*x-Omega*t+theta(-c*t+x)))

{q(x, t) = phi(-c*t+x)*exp(I*(k*x-Omega*t+theta(-c*t+x))), qr(x, t) = phi(c*t-x)*exp(I*(-k*x+Omega*t+theta(c*t-x)))}

pde2 := simplify(subs({phi(c*t-x) = phi(c*t-x), theta(c*t-x) = -theta(-c*t+x)}, pde1))

pde3 := simplify(exp(-I*(k*x-Omega*t+theta(-c*t+x)))*pde2)

itr := xi = -c*t+x; tr := isolate(itr, x); pde4 := dchange(tr, pde3, [xi], params = {Omega, c, k})

xi = -c*t+x

x = c*t+xi

-2*phi(xi)^2*((-(diff(theta(xi), xi))-k)*phi(xi)+I*(diff(phi(xi), xi)))+((diff(theta(xi), xi))^2*c+(c*k+Omega)*(diff(theta(xi), xi))-I*c*(diff(diff(theta(xi), xi), xi))+Omega*k+1)*phi(xi)-(2*I)*(diff(theta(xi), xi))*c*(diff(phi(xi), xi))+I*(-c*k-Omega)*(diff(phi(xi), xi))-(diff(diff(phi(xi), xi), xi))*c

Eq 1.5

collect(evalc(Re(pde4)), phi(xi)); collect(evalc(Im(-pde4)), phi(xi))

(2*(diff(theta(xi), xi))+2*k)*phi(xi)^3+((diff(theta(xi), xi))^2*c+(c*k+Omega)*(diff(theta(xi), xi))+1+Omega*k)*phi(xi)-(diff(diff(phi(xi), xi), xi))*c

2*phi(xi)^2*(diff(phi(xi), xi))+c*(diff(diff(theta(xi), xi), xi))*phi(xi)+2*(diff(theta(xi), xi))*c*(diff(phi(xi), xi))+(c*k+Omega)*(diff(phi(xi), xi))

NULL

Download PD_OD2.mw

You can subtract a common term from each side of an equation or inequality using elementwise subtraction, assuming you know what term you want to subtract. If you don't, it is simpler to subtract it all, which is essentially @nm's answer. (I would typically set up an equation or inequality in the ineq3 form originally, then you do not have this issue.) Here it turns out the simplification makes the inequality harder to solve. 

For the assumptions you gave in the worksheet, solve gives two cases.

restart

ineq := -d*(Am-s1)/(2*Clm)-d*(Am*R0er*d^2-R0er*d^2*s1+Aer*Clm-Ce*Clm+Clm*Rer-Clm*l)/(2*Clm*(-R0er*d^2+Clr)) <= -d*(Am-Cv+Rm-s1-s2)/(-2*R0m*d^2+2*d^2*g1+2*Clm)-d*(Rer-Ce-l+Aer)/(-2*R0er*d^2+2*Clr)

Subtract the right-hand side from each side

ineq2 := `~`[`-`](ineq, rhs(ineq))

-(1/2)*d*(Am-s1)/Clm-(1/2)*d*(Am*R0er*d^2-R0er*d^2*s1+Aer*Clm-Ce*Clm+Clm*Rer-Clm*l)/(Clm*(-R0er*d^2+Clr))+d*(Am-Cv+Rm-s1-s2)/(-2*R0m*d^2+2*d^2*g1+2*Clm)+d*(Rer-Ce-l+Aer)/(-2*R0er*d^2+2*Clr) <= 0

ineq3 := simplify(ineq2)

-(1/2)*d*((R0er*(Am-Cv+Rm-s1-s2)*Clm-Clr*(Am-s1)*(R0m-g1))*d^2+Clm*Clr*(Cv-Rm+s2))/((R0er*d^2-Clr)*((R0m-g1)*d^2-Clm)*Clm) <= 0

Simpler, faster solution with ineq2 than ineq3

`assuming`([solve(ineq2, Cv, useassumptions)], [d > 0, Am > 0, R0er > 0, Clm > 0, s1 > 0, Ce > 0, s2 > 0, Clr > 0, l > 0, g1 > 0, g2 > 0, Aer > 0, Rer > 0])

piecewise(0 < d/(-2*R0m*d^2+2*d^2*g1+2*Clm), [{-(Am*Clm*R0er*d^2-Am*Clr*R0m*d^2+Am*Clr*d^2*g1+Clm*R0er*Rm*d^2-Clm*R0er*d^2*s1-Clm*R0er*d^2*s2+Clr*R0m*d^2*s1-Clr*d^2*g1*s1-Clm*Clr*Rm+Clm*Clr*s2)/(Clm*(-R0er*d^2+Clr)) <= Cv}], d/(-2*R0m*d^2+2*d^2*g1+2*Clm) < 0, [{Cv <= -(Am*Clm*R0er*d^2-Am*Clr*R0m*d^2+Am*Clr*d^2*g1+Clm*R0er*Rm*d^2-Clm*R0er*d^2*s1-Clm*R0er*d^2*s2+Clr*R0m*d^2*s1-Clr*d^2*g1*s1-Clm*Clr*Rm+Clm*Clr*s2)/(Clm*(-R0er*d^2+Clr))}], [])

 

NULL

Download Q_12.mw

The other question about phase shifts has now been deleted. .pdf of it is here: phase_shift.pdf

restart

with(PDEtools)

undeclare(prime); declare(u(x, t)); declare(v(x, t)); declare(f(x, t))

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

u(x, t)*`will now be displayed as`*u

v(x, t)*`will now be displayed as`*v

f(x, t)*`will now be displayed as`*f

PDE to solve, Eq 11

pde := diff(u(x, t), t)+diff(u(x, t), x)-(diff(u(x, t), `$`(x, 2), t))-4*u(x, t)*(diff(u(x, t), t))-2*(diff(u(x, t), x))*(int(diff(u(x, t), t), x))

diff(u(x, t), t)+diff(u(x, t), x)-(diff(diff(diff(u(x, t), t), x), x))-4*u(x, t)*(diff(u(x, t), t))-2*(diff(u(x, t), x))*(int(diff(u(x, t), t), x))

Use potential transformation Eq 12 to give Eq 13

ptrans := u(x, t) = diff(v(x, t), x); pdev := dsubs(ptrans, pde)

u(x, t) = diff(v(x, t), x)

diff(diff(v(x, t), t), x)+diff(diff(v(x, t), x), x)-(diff(diff(diff(diff(v(x, t), t), x), x), x))-4*(diff(v(x, t), x))*(diff(diff(v(x, t), t), x))-2*(diff(diff(v(x, t), x), x))*(diff(v(x, t), t))

Split pdev into linear and non-linear parts

pdev_nonlinear, pdev_linear := selectremove(proc (term) options operator, arrow; has((eval(term, v(x, t) = a*v(x, t)))/a, a) end proc, pdev)

-4*(diff(v(x, t), x))*(diff(diff(v(x, t), t), x))-2*(diff(diff(v(x, t), x), x))*(diff(v(x, t), t)), diff(diff(v(x, t), t), x)+diff(diff(v(x, t), x), x)-(diff(diff(diff(diff(v(x, t), t), x), x), x))

Use Eq 14 to find Eq 15

thetai := -t*c[i]+x*k[i]; eval(pdev_linear, v(x, t) = exp(thetai)); eq15 := isolate(%, c[i])

-t*c[i]+x*k[i]

-c[i]*k[i]*exp(-t*c[i]+x*k[i])+k[i]^2*exp(-t*c[i]+x*k[i])+c[i]*k[i]^3*exp(-t*c[i]+x*k[i])

c[i] = -k[i]/(k[i]^2-1)

Use expthetai to define the auxiliary function in Eq 18

eqf := f(x, t) = 1+eval(exp(thetai), eq15)

f(x, t) = 1+exp(k[i]*t/(k[i]^2-1)+k[i]*x)

Now we use this in Eq 17, and substitute into pdev to find that R=2

eq17 := v(x, t) = R*(diff(ln(f(x, t)), x)); eval(eq17, eqf); simplify(eval(pdev, %)); sort([solve(%, R)]); eq17withR := eval(eq17, R = %[2])

v(x, t) = R*(diff(f(x, t), x))/f(x, t)

v(x, t) = R*k[i]*exp(k[i]*t/(k[i]^2-1)+k[i]*x)/(1+exp(k[i]*t/(k[i]^2-1)+k[i]*x))

6*k[i]^5*R*exp(2*k[i]*(x*k[i]^2+t-x)/((k[i]-1)*(k[i]+1)))*(exp(k[i]*(x*k[i]^2+t-x)/((k[i]-1)*(k[i]+1)))-1)*(R-2)/((1+exp(k[i]*(x*k[i]^2+t-x)/((k[i]-1)*(k[i]+1))))^5*(k[i]^2-1))

[0, 2]

v(x, t) = 2*(diff(f(x, t), x))/f(x, t)

So we can now find v as Eq 19.

eq19 := eval(eq17withR, eqf)

v(x, t) = 2*k[i]*exp(k[i]*t/(k[i]^2-1)+k[i]*x)/(1+exp(k[i]*t/(k[i]^2-1)+k[i]*x))

Check it solves pdev

pdetest(eq19, pdev)

0

And then we can find the u (Eq 20) that solves the original pde.

eq20 := simplify(eval(ptrans, eq19))

u(x, t) = 2*k[i]^2*exp(k[i]*(x*k[i]^2+t-x)/((k[i]-1)*(k[i]+1)))/(1+exp(k[i]*(x*k[i]^2+t-x)/((k[i]-1)*(k[i]+1))))^2

pdetest(eq20, pde)

0

Now for the 2-soliton case. This time the auxiliary function f is as below.
Note that we use a product of exps so that we can more easily do later substitutions.

theta1 := normal(eval(eval(thetai, eq15), i = 1)); theta2 := normal(eval(eval(thetai, eq15), i = 2)); eqf2 := f(x, t) = 1+exp(theta1)+exp(theta2)+a__12*exp(theta1)*exp(theta2)

k[1]*(x*k[1]^2+t-x)/(k[1]^2-1)

k[2]*(x*k[2]^2+t-x)/(k[2]^2-1)

f(x, t) = 1+exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))+exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))+a__12*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))

Find v

eqv2 := eval(eq17withR, eqf2)

v(x, t) = 2*(k[1]*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))+k[2]*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))+a__12*k[1]*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))+a__12*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))*k[2]*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1)))/(1+exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))+exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))+a__12*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1)))

Substitute into pdev. Don't simplify.  Then we want it to hold for arbitrary theta1 and theta2.
The straightforward way it to algsubs these to X and Y, but the pattern is too complex

p2a := eval(pdev, eqv2); algsubs(theta1 = X, p2a); algsubs(theta1 = Y, %)

Error, (in algsubs) cannot compute degree of pattern in k[1]

Error, (in algsubs) cannot compute degree of pattern in k[1]

The two exps have been retained intact, so a simple subs might work

indets(p2a)

{a__12, t, x, k[1], k[2], exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1)), exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))}

p2b := subs(exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1)) = eX, exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1)) = eY, p2a); indets(%)

{a__12, eX, eY, k[1], k[2]}

It worked, so proceed to find the coeffs and solve.

p2c := numer(normal(p2b))

eqns := {coeffs(collect(p2c, {eX, eY}, distributed), {eX, eY})}; nops(%)

{2*(-a__12*k[1]^5+a__12*k[1]^3*k[2]^2-a__12*k[1]^2*k[2]^3+a__12*k[2]^5+k[1]^5-4*k[1]^4*k[2]+7*k[1]^3*k[2]^2-7*k[1]^2*k[2]^3+4*k[1]*k[2]^4-k[2]^5+3*a__12*k[1]^3+3*a__12*k[1]^2*k[2]-3*a__12*k[1]*k[2]^2-3*a__12*k[2]^3-3*k[1]^3+9*k[1]^2*k[2]-9*k[1]*k[2]^2+3*k[2]^3)*k[1]*k[2], 2*(a__12*k[1]^5-a__12*k[1]^3*k[2]^2+a__12*k[1]^2*k[2]^3-a__12*k[2]^5-k[1]^5+4*k[1]^4*k[2]-7*k[1]^3*k[2]^2+7*k[1]^2*k[2]^3-4*k[1]*k[2]^4+k[2]^5-3*a__12*k[1]^3-3*a__12*k[1]^2*k[2]+3*a__12*k[1]*k[2]^2+3*a__12*k[2]^3+3*k[1]^3-9*k[1]^2*k[2]+9*k[1]*k[2]^2-3*k[2]^3)*k[1]*k[2], 2*(-a__12*k[1]^5-4*a__12*k[1]^4*k[2]-7*a__12*k[1]^3*k[2]^2-7*a__12*k[1]^2*k[2]^3-4*a__12*k[1]*k[2]^4-a__12*k[2]^5+k[1]^5-k[1]^3*k[2]^2-k[1]^2*k[2]^3+k[2]^5+3*a__12*k[1]^3+9*a__12*k[1]^2*k[2]+9*a__12*k[1]*k[2]^2+3*a__12*k[2]^3-3*k[1]^3+3*k[1]^2*k[2]+3*k[1]*k[2]^2-3*k[2]^3)*k[1]*k[2], 2*(a__12^2*k[1]^5+4*a__12^2*k[1]^4*k[2]+7*a__12^2*k[1]^3*k[2]^2+7*a__12^2*k[1]^2*k[2]^3+4*a__12^2*k[1]*k[2]^4+a__12^2*k[2]^5-a__12*k[1]^5+a__12*k[1]^3*k[2]^2+a__12*k[1]^2*k[2]^3-a__12*k[2]^5-3*a__12^2*k[1]^3-9*a__12^2*k[1]^2*k[2]-9*a__12^2*k[1]*k[2]^2-3*a__12^2*k[2]^3+3*a__12*k[1]^3-3*a__12*k[1]^2*k[2]-3*a__12*k[1]*k[2]^2+3*a__12*k[2]^3)*k[1]*k[2]}

4

Eq 24.

solve(eqns, a__12); eq24 := factor(%)

{a__12 = (k[1]^2-2*k[1]*k[2]+k[2]^2)/(k[1]^2+2*k[1]*k[2]+k[2]^2)}

{a__12 = (k[1]-k[2])^2/(k[1]+k[2])^2}

eq25 := eval(eqf2, eq24)

f(x, t) = 1+exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))+exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))+(k[1]-k[2])^2*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))/(k[1]+k[2])^2

So solution to pdev is

eqv2 := eval(eq17withR, eq25)

v(x, t) = 2*(k[1]*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))+k[2]*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))+(k[1]-k[2])^2*k[1]*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))/(k[1]+k[2])^2+(k[1]-k[2])^2*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))*k[2]*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))/(k[1]+k[2])^2)/(1+exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))+exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))+(k[1]-k[2])^2*exp(k[1]*(x*k[1]^2+t-x)/(k[1]^2-1))*exp(k[2]*(x*k[2]^2+t-x)/(k[2]^2-1))/(k[1]+k[2])^2)

pdetest(eqv2, pdev)

0

And of the original

equ2 := eval(ptrans, eqv2)

Following doesn't complete. Perhaps the integration is too difficult?

pdetest(equ2, pde)

NULL

Download phase_shift.mw

 

To get Maple to work this out, turns out to be surprisingly difficult, if you want to avoid inputting things like the cosine rule that you expect Maple to know. Here's a solution. Really, it should be easier.

restart

with(geometry)

assume(n > 2, 2*r > 0)

Define a regular polygon, with size determined by the radius of the circumscribed circle, r.

Turns out it doesn't accept a symbolic n.

RegularPolygon(P, n, point(o, 0, 0), r)

Error, invalid input: geometry:-RegularPolygon expects its 2nd argument, n, to be of type posint, but received n

Oh, well, I guess we have to make it from triangles. Let's define a triangle by side-angle-side, with the angle at the cenre of the polygon.

triangle(T, [r, angle = 2*Pi/n, r])

T

So now we want to find which r value makes the other side = 1.

sides(T); r := solve(%[3] = 1, r, useassumptions)

[r, r, (2*r^2-2*r^2*cos(2*Pi/n))^(1/2)]

1/(2-2*cos(2*Pi/n))^(1/2)

To make any progress we have to define triangles with 3 points.
So make two triangles with a common side of length r, with that side lying along the x-axis, between the origin at the centre of the polygon and point X.
(Actually, we dont need to generate the triagles, just their vertices.)

point(X, [r, 0]); rotation(A, X, 2*Pi/n, clockwise, o); rotation(B, X, 2*Pi/n, counterclockwise, o)
NULL

X

A

B

Find the midpoints, and the distance between them

midpoint(mOA, o, A); midpoint(mOB, o, B); d := simplify(distance(mOA, mOB))

mOA

mOB

cos(Pi/n)

Find the limit

limit(d, n = infinity)

1

NULL

Download polygon.mw

If I trust isolve (?), then there is only one solution, with the tangents 1, 2 and 3. In the figure below tan(A) = 3, tan(B) = 2, tan(C) = 1.

Download tangents.mw

The exponentials are gone in eq22, so it has worked. I assume that after the substitution, the expression with V simplifies so that there is no longer a V.

If fact you can verify this by doing simplify on eq2.

p.s. use indets(eq22,name) to only see the variable names and not more complicated expressions.

@salim-barzani This iterates over all possibilities of mu[1]=0,1;mu[2]=0,1; etc, and is the only way I can make sense of it.

restart

N := 3

3

f0 := exp(add(mu[i]*eta[i], i = 1 .. N)+add(add(mu[i]*mu[j]*B[i, j], i = 1 .. j-1), j = 1 .. N))

exp(B[1, 2]*mu[1]*mu[2]+B[1, 3]*mu[1]*mu[3]+B[2, 3]*mu[2]*mu[3]+eta[1]*mu[1]+eta[2]*mu[2]+eta[3]*mu[3])

mus := Iterator:-BinaryGrayCode(N); muvals := seq({`~`[`=`](seq(mu[i], i = 1 .. N), seq(mui))}, `in`(mui, mus))

_m2021747042624

{mu[1] = 0, mu[2] = 0, mu[3] = 0}, {mu[1] = 1, mu[2] = 0, mu[3] = 0}, {mu[1] = 1, mu[2] = 1, mu[3] = 0}, {mu[1] = 0, mu[2] = 1, mu[3] = 0}, {mu[1] = 0, mu[2] = 1, mu[3] = 1}, {mu[1] = 1, mu[2] = 1, mu[3] = 1}, {mu[1] = 1, mu[2] = 0, mu[3] = 1}, {mu[1] = 0, mu[2] = 0, mu[3] = 1}

add(eval(f0, muval), `in`(muval, muvals))

1+exp(eta[1])+exp(B[1, 2]+eta[1]+eta[2])+exp(eta[2])+exp(B[2, 3]+eta[2]+eta[3])+exp(B[1, 2]+B[1, 3]+B[2, 3]+eta[1]+eta[2]+eta[3])+exp(B[1, 3]+eta[1]+eta[3])+exp(eta[3])

f1 := exp(add(mu[i]*eta[i], i = 1 .. N)+add(add(mu[i]*mu[j]*ln(b[i, j]), i = 1 .. j-1), j = 1 .. N))

exp(mu[1]*eta[1]+mu[2]*eta[2]+mu[3]*eta[3]+mu[1]*mu[2]*ln(b[1, 2])+mu[1]*mu[3]*ln(b[1, 3])+mu[2]*mu[3]*ln(b[2, 3]))

f := simplify(add(eval(f1, muval), `in`(muval, muvals)))

1+exp(eta[1])+b[1, 2]*exp(eta[1]+eta[2])+exp(eta[2])+b[2, 3]*exp(eta[2]+eta[3])+b[1, 2]*b[1, 3]*b[2, 3]*exp(eta[1]+eta[2]+eta[3])+b[1, 3]*exp(eta[1]+eta[3])+exp(eta[3])

Change b[1,2]*b[2,3]*b[1,3] to b[1,2,3], etc.

evalindets(f,`*`,
  proc(term)
    local inds:=indets(term,specindex(b));
    b[op(op~(inds))]*eval(term,inds=~1);
  end proc);

1+exp(eta[1])+b[1, 2]*exp(eta[1]+eta[2])+exp(eta[2])+b[2, 3]*exp(eta[2]+eta[3])+b[1, 2, 3]*exp(eta[1]+eta[2]+eta[3])+b[1, 3]*exp(eta[1]+eta[3])+exp(eta[3])

``

Download formula.mw

In Maple, u[1/2](t) and u[0.5](t) are not the same so you cannot mix them. I changed all the 0.5's to 1/2 and it seems to work now.

error.mw

It's a bug. A workaround is to use

ans := SolveTools:-PolynomialSystem(eqs,
  {p, q, a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], k[1], k[2], k[3], m[1], m[2], m[3]}, explicit)

If I understand correctly, you want to solve the partial differential equation diff(u(x,y,t),t)-diff(u(x,y,t),x)=z. The answer depends on an arbitrary function f__1 at the end. So if you have some boundary or initial conditions you can refine the solution.

restart;

with(PDEtools):

z := 32*delta2^3*(exp((2*a*y*delta2^3 + 2*(x + y + t)^3*(B1 + 2*B2)*delta2^2 + (2*a*delta1^2*y + t)*delta2 + 2*delta1^2*(x + y + t)^3*(B1 + 2*B2))/(delta1^2 + delta2^2)) - exp((-2*a*y*delta2^3 + 4*(B1 + B2/2)*(x + y + t)^3*delta2^2 + (-2*a*delta1^2*y - t)*delta2 + 4*delta1^2*(B1 + B2/2)*(x + y + t)^3)/(delta1^2 + delta2^2)))*a/((delta1^2 + delta2^2)^2*(exp((2*(delta1^2 + delta2^2)*(x + y + t)^3*B2 + 2*delta2*(a*(delta1^2 + delta2^2)*y + t/2))/(delta1^2 + delta2^2)) + exp((2*(delta1^2 + delta2^2)*(x + y + t)^3*B1 - 2*delta2*(a*(delta1^2 + delta2^2)*y + t/2))/(delta1^2 + delta2^2)))^3):

pde:=diff(u(x,y,t),t)-diff(u(x,y,t),x)=z;

diff(u(x, y, t), t)-(diff(u(x, y, t), x)) = 32*delta2^3*(exp((2*a*y*delta2^3+2*(x+y+t)^3*(B1+2*B2)*delta2^2+(2*a*delta1^2*y+t)*delta2+2*delta1^2*(x+y+t)^3*(B1+2*B2))/(delta1^2+delta2^2))-exp((-2*a*y*delta2^3+4*(B1+(1/2)*B2)*(x+y+t)^3*delta2^2+(-2*a*delta1^2*y-t)*delta2+4*delta1^2*(B1+(1/2)*B2)*(x+y+t)^3)/(delta1^2+delta2^2)))*a/((delta1^2+delta2^2)^2*(exp((2*(delta1^2+delta2^2)*(x+y+t)^3*B2+2*delta2*(a*(delta1^2+delta2^2)*y+(1/2)*t))/(delta1^2+delta2^2))+exp((2*(delta1^2+delta2^2)*(x+y+t)^3*B1-2*delta2*(a*(delta1^2+delta2^2)*y+(1/2)*t))/(delta1^2+delta2^2)))^3)

pdsolve(pde,u(x,y,t));

u(x, y, t) = -32*a*((1/2)*exp(2*(y^3+3*(x+t)*y^2+3*(x+t)^2*y+(x+t)^3)*B1-4*(x+y+t)^3*B1)/(exp(2*(x+y+t)^3*B1+2*delta2*x/(delta1^2+delta2^2))+exp(2*(B2*y^3*delta1^2+B2*y^3*delta2^2+3*B2*y^2*delta1^2*(x+t)+3*B2*y^2*delta2^2*(x+t)+3*B2*y*(x+t)^2*delta1^2+3*B2*y*(x+t)^2*delta2^2+B2*(x+t)^3*delta1^2+B2*(x+t)^3*delta2^2+2*y*a*delta1^2*delta2+2*a*y*delta2^3+delta2*(x+t))/(delta1^2+delta2^2)))-(1/4)*(exp(2*(y^3+3*(x+t)*y^2+3*(x+t)^2*y+(x+t)^3)*B1)+exp(2*(x+y+t)^3*B1))*exp(2*(B2*y^3*delta1^2+B2*y^3*delta2^2+3*B2*y^2*delta1^2*(x+t)+3*B2*y^2*delta2^2*(x+t)+3*B2*y*(x+t)^2*delta1^2+3*B2*y*(x+t)^2*delta2^2+B2*(x+t)^3*delta1^2+B2*(x+t)^3*delta2^2+2*y*a*delta1^2*delta2+2*a*y*delta2^3+delta2*(x+t))/(delta1^2+delta2^2)-4*(x+y+t)^3*B1)/(exp(2*(x+y+t)^3*B1+2*delta2*x/(delta1^2+delta2^2))+exp(2*(B2*y^3*delta1^2+B2*y^3*delta2^2+3*B2*y^2*delta1^2*(x+t)+3*B2*y^2*delta2^2*(x+t)+3*B2*y*(x+t)^2*delta1^2+3*B2*y*(x+t)^2*delta2^2+B2*(x+t)^3*delta1^2+B2*(x+t)^3*delta2^2+2*y*a*delta1^2*delta2+2*a*y*delta2^3+delta2*(x+t))/(delta1^2+delta2^2)))^2)*delta2^2*exp(2*delta2*(x+t)/(delta1^2+delta2^2)+4*a*y*delta2^3/(delta1^2+delta2^2)+4*y*a*delta1^2*delta2/(delta1^2+delta2^2)+2*B1*y^3*delta1^2/(delta1^2+delta2^2)+2*B1*y^3*delta2^2/(delta1^2+delta2^2)+6*B1*y^2*delta1^2*(x+t)/(delta1^2+delta2^2)+6*B1*y^2*delta2^2*(x+t)/(delta1^2+delta2^2)+6*B1*y*(x+t)^2*delta1^2/(delta1^2+delta2^2)+6*B1*y*(x+t)^2*delta2^2/(delta1^2+delta2^2)+2*B1*(x+t)^3*delta1^2/(delta1^2+delta2^2)+2*B1*(x+t)^3*delta2^2/(delta1^2+delta2^2)+2*B2*y^3*delta1^2/(delta1^2+delta2^2)+2*B2*y^3*delta2^2/(delta1^2+delta2^2)+6*B2*y^2*delta1^2*(x+t)/(delta1^2+delta2^2)+6*B2*y^2*delta2^2*(x+t)/(delta1^2+delta2^2)+6*B2*y*(x+t)^2*delta1^2/(delta1^2+delta2^2)+6*B2*y*(x+t)^2*delta2^2/(delta1^2+delta2^2)+2*B2*(x+t)^3*delta1^2/(delta1^2+delta2^2)+2*B2*(x+t)^3*delta2^2/(delta1^2+delta2^2))/(delta1^2+delta2^2)+f__1(y, x+t)

``

NULL

Download pdsolve.mw

Here is one way. pointplot has options to control the shape and size of the point. display is used for combining two or more plots. Notice the with(plots) at the beginning. I'm not sure what you mean by "plotting the distance".

 

with(Student:-Precalculus); with(plots)

with(Plot)

a := [1, 3]

b := [5, 6]

Distance(a, b)

5

mp := Midpoint(a, b)

[3, 9/2]

Line(a, b)

y = (3/4)*x+9/4, 3/4, 9/4, -3

Lplot := Line(a, b, output = plot); display(Lplot, pointplot(mp, symbolsize = 12, symbol = solidcircle, color = blue))

 

 

Download How-to-plot-distance-midpoint.mw

For numerical use (not necessarily for plotting), plottools:-rotate rotates an nx3 Array (datatype=float[8]) of points if you enclose it in a CURVES or POLYGONS call. I'm assuming the alpha, beta, gamma are the Euler angles, or closely related. (I've only actually used the other form of plottools:-rotate where you specify 2 points on the rotation axis and one angle.)

Download Euler.mw

First 6 7 8 9 10 11 12 Last Page 8 of 81