dharr

Dr. David Harrington

8195 Reputation

22 Badges

20 years, 334 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

Get rid of =0.

 F-P-O-W.mw

Both methods work if you remove the "=0" on the pde. I always recommend this, for reasons I've given before.

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

_local(gamma)

NULL

declare(u(x, y, z, w, t))

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

declare(f(x, y, z, w, t))

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

pde := 4*(diff(u(x, y, z, w, t), x, t))-(diff(u(x, y, z, w, t), `$`(x, 3), y))+diff(u(x, y, z, w, t), x, `$`(y, 3))+12*(diff(u(x, y, z, w, t), x))*(diff(u(x, y, z, w, t), y))+12*u(x, y, z, w, t)*(diff(u(x, y, z, w, t), x, y))-6*(diff(u(x, y, z, w, t), z, w))

4*(diff(diff(u(x, y, z, w, t), t), x))-(diff(diff(diff(diff(u(x, y, z, w, t), x), x), x), y))+diff(diff(diff(diff(u(x, y, z, w, t), x), y), y), y)+12*(diff(u(x, y, z, w, t), x))*(diff(u(x, y, z, w, t), y))+12*u(x, y, z, w, t)*(diff(diff(u(x, y, z, w, t), x), y))-6*(diff(diff(u(x, y, z, w, t), w), z))

oppde := [op(expand(pde))]; u_occurrences := map(proc (i) options operator, arrow; numelems(select(has, [op([op(i)])], u)) end proc, oppde); linear_op_indices := ListTools:-SearchAll(1, u_occurrences); pde_linear := add(oppde[[linear_op_indices]]); pde_nonlinear := expand(simplify(expand(pde)-pde_linear))

4*(diff(diff(u(x, y, z, w, t), t), x))-(diff(diff(diff(diff(u(x, y, z, w, t), x), x), x), y))+diff(diff(diff(diff(u(x, y, z, w, t), x), y), y), y)-6*(diff(diff(u(x, y, z, w, t), w), z))

12*(diff(u(x, y, z, w, t), x))*(diff(u(x, y, z, w, t), y))+12*u(x, y, z, w, t)*(diff(diff(u(x, y, z, w, t), x), y))

pde_linear, pde_nonlinear := selectremove(proc (term) options operator, arrow; not has((eval(term, u(x, y, z, w, t) = a*u(x, y, z, w, t)))/a, a) end proc, expand(pde))

4*(diff(diff(u(x, y, z, w, t), t), x))-(diff(diff(diff(diff(u(x, y, z, w, t), x), x), x), y))+diff(diff(diff(diff(u(x, y, z, w, t), x), y), y), y)-6*(diff(diff(u(x, y, z, w, t), w), z)), 12*(diff(u(x, y, z, w, t), x))*(diff(u(x, y, z, w, t), y))+12*u(x, y, z, w, t)*(diff(diff(u(x, y, z, w, t), x), y))

NULL

Download seperate_L-NL.mw

Well a lot depends on your objective, but here are some comments. 

(i) If the argument of RootOf is not a polynomial in _Z, then Maple has given up, and although you might be able to do some things with it, such as differentiate wrt a parameter, allvalues and convert radical won't do anything with it. I'm assuming remove_RootOf will put it back into unsolved form.

(ii) remove_RootOf just generates an implicit equation for which solve would give the RootOf solution; in some sense that is going backwards, but if you don't like RootOfs then it may be for you. On the other hand it is implicit, which you may not like.

(iii) If the argument of RootOf is a polynomial in _Z of degree n and it can be converted to radical form, then allvalues gives the n solutions in radical form. convert(..,radical) gives only the first of these; it is equivalent to convert(RootOf(..., index=1), radical).

(iv)  If the argument of RootOf is a polynomial in _Z of degree n and it can't be converted to radical form, which is the case for most high-degree polynomials, then convert(..,radical) won't do anything. allvalues will just return the n values still with RootOfs:

RootOf(..., index=1), RootOf(..., index=2), ... RootOf(..., index=n).

Here some code which should apply to any parametric curve. I tried to do it analytically, which works for the ellipse example, but in the general case will depend on the capabilities of solve.

restart

Curve in a parametric form (here an ellipse)

curve := proc (t) options operator, arrow; [2*sin(t), cos(t)] end proc

proc (t) options operator, arrow; [2*sin(t), cos(t)] end proc

pcurve := plot([curve(t)[], t = 0 .. 2*Pi], scaling = constrained, color = red)

procedure to plot tangent line at parameter value t.  y=y0 + m*(x-x0), [x0,y0] on curve

pT:=proc(t) local x0,y0,Dc,m,x;
x0,y0:=curve(t)[];
Dc:=D(curve)(t);
m:=Dc[2]/Dc[1];
plot(m*x+y0-m*x0,x,color=blue);
end proc:

Procedure to calculate curvature

C:=proc(t) local dx,dy,d2x,d2y;
dx,dy:=D(curve)(t)[];
d2x,d2y:=(D@@2)(curve)(t)[];
abs(dx*d2y-dy*d2x)/(dx^2+dy^2)^(3/2)
end proc:

Slope of tangent``(non-normalized tangent vector)

Dcurve := D(curve)

proc (z) options operator, arrow; [2*cos(z), -sin(z)] end proc

Find two points on curve with the same tangent slope and curvature

T1 := (D(curve))(t__1); T2 := (D(curve))(t__2); equalslopes := T1[1]*T2[2] = T1[2]*T2[1]

[2*cos(t__1), -sin(t__1)]

[2*cos(t__2), -sin(t__2)]

-2*cos(t__1)*sin(t__2) = -2*sin(t__1)*cos(t__2)

For t spaced multiples of Pi apart the slopes are the same

t2 := solve(equalslopes, t__2, allsolutions)

arctan(sin(t__1)/cos(t__1))+Pi*_Z1

simplify(t2); simplify(t2, symbolic)

arctan(tan(t__1))+Pi*_Z1

Pi*_Z1+t__1

And the curvatures are the same under this condition

C(.2); C(.2+Pi)``

.2615262308

.2615262308

And for the general case.

simplify(C(t)-C(t+Pi))

0

plots:-display(pcurve, pT(.2), pT(.2+Pi), view = [-2 .. 2, -2 .. 2])

NULL

Download Blaschke.mw

Generally, Maple works identically across platforms. The help page ?platform lists platform-specific issues, but only Mac OS has small differences from the other versions. I'm assuming by features you mean the capabilities of Maple itself. (For the GUI, the Java interface is also intended to be platform independent.) 

I would have said that s is already in factored form. Simplify is the correct way here, I think, though the answer appears to be 2^m not 2^(m+1). Maple's commands for working with polynomials and rational functions such as factor don't work for generic/unspecified exponents/degrees. Even if given a specific m, the default field for the coefficients is the rationals, so you will have to work more specifically on them to determine their factors, as I did here.

restart

Factored form

s := (1+sqrt(3))^(2*m+1)

(1+3^(1/2))^(2*m+1)

Example for m=6

s6 := eval(s, m = 6)

(1+3^(1/2))^13

Expanded form

e6 := expand(s6)

236224+136384*3^(1/2)

Extracting parts is ugly; then find gcd

op(1, e6), op([2, 1], e6); igcd(%); 2^6

236224, 136384

64

64

simplify(s/2^m)

(1+3^(1/2))*(2+3^(1/2))^m

NULL

Download test2.mw

 

Click on the green up-arrow in the Mapleprimes editor, click on choose file and browse to the file on your computer you want to upload and select it. Then click upload, and then click one of "insert link" or "insert contents" buttons. This definitely works for worksheet (*.mw) files. It doesn't work directly for *.mpl files, but if it contains only text then just rename it to *.txt and upload that. It works for some other types of files, but if it doesn't work then you can convert it to a .zip file and upload that.

Inserting contents of a worksheet sometimes fails to display the contents, but gives a link that works anyway.

Full evaluation is occuring in the first case, but not the second. If you change the second to eval(cat(x_,i-1));  it becomes the same as the first.

So in the first case, for i = 2, x_2 := x_1, but x_1 is already x_0, so you get x_2 := x_0.

I don't have Maple 2023, but for 2025 you need assumptions to get a result. I assumed everything positive, but you may have more specific requirements. For future reference. please upload a worksheet so we don't have to type in from the image.

Download Fourier.mw

plots:-complexplot([allvalues(RootOf(x^6 - 1))], style = point,
     symbol = solidcircle, color = red, symbolsize = 15, scaling = constrained);

The same result can be obtained with fsolve

plots:-complexplot([fsolve(x^6 - 1, complex)], style = point,
     symbol = solidcircle, color = red, symbolsize = 15, scaling = constrained);

allvalues(RootOf(x^6 - 1)) gives the symbolic solutions and  fsolve(x^6 - 1, complex) gives the numeric solutions.

Here's an example.

restart

with(plots); with(plottools)

display(polygon([[0, 0], [3, 4], [3, 1]], color = "Plasma 212"), polygon([[-1, 1], [-2, 4], [-5, 1]], color = red))

NULL

Download polygons.mw

In general wuth solve, specify the variables you want to solve for, and then these will be given in terms of the others. The set of variables you were solving for included alpha[9,1,1] and alpha[9,1,2], which won't give a solution with alpha[9,1,1] or alpha[9,1,2] on the right-hand side, which was the case for the solution you wanted.

(I'm assuming you are OK with using the left-hand side variables of the known solution, rather that needing to find all solutions without any prior knowledge of those solutions.)
p.s. the new Maple 2025 ExpressionTools:-Compare doesn't display correctly here on Mapleprimes.

restart;

Equations

eqjerkAB:=[-alpha[9, 1, 1] - alpha[9, 2, 2] - alpha[9, 3, 3] = -alpha[14, 1, 1] - alpha[14, 2, 2] - alpha[14, 3, 3], alpha[9, 1, 1] + alpha[9, 2, 2] = alpha[14, 1, 1] + alpha[14, 2, 2], -alpha[9, 2, 6]*alpha[9, 3, 5] = -alpha[14, 2, 6]*alpha[14, 3, 5], alpha[9, 1, 1]*alpha[9, 3, 3] + alpha[9, 2, 2]*alpha[9, 3, 3] = alpha[14, 1, 1]*alpha[14, 3, 3] + alpha[14, 2, 2]*alpha[14, 3, 3], alpha[9, 1, 1]*alpha[9, 2, 6]*alpha[9, 3, 5] - alpha[9, 1, 2]*alpha[9, 2, 6]*alpha[9, 3, 4] = alpha[14, 1, 1]*alpha[14, 2, 6]*alpha[14, 3, 5], -alpha[9, 1, 1]*alpha[9, 2, 2]*alpha[9, 3, 3] - alpha[9, 1, 2]*alpha[9, 2, 6]*alpha[9, 3, 0] = -alpha[14, 1, 1]*alpha[14, 2, 2]*alpha[14, 3, 3] + alpha[14, 1, 2]*alpha[14, 2, 1]*alpha[14, 3, 3]]:
nops(%);

6

We want to find this solution

solother:={alpha[9,2,2]=-alpha[9,1,1] + alpha[14,1,1] + alpha[14,2,2],
alpha[9,3,0] = (((alpha[9,1,1] - alpha[14,1,1])*(alpha[9,1,1] - alpha[14,2,2]) - alpha[14,1,2]*alpha[14,2,1])*alpha[14,3,3])/(alpha[9,1,2]*alpha[9,2,6]),
alpha[9,3,3] = alpha[14,3,3],
alpha[9,3,4] = (alpha[9,1,1] - alpha[14,1,1])*alpha[14,2,6]*alpha[14,3,5]/(alpha[9,1,2]*alpha[9,2,6]),
alpha[9,3,5] = alpha[14,2,6]*alpha[14,3,5]/alpha[9,2,6]};

{alpha[9, 2, 2] = -alpha[9, 1, 1]+alpha[14, 1, 1]+alpha[14, 2, 2], alpha[9, 3, 0] = ((alpha[9, 1, 1]-alpha[14, 1, 1])*(alpha[9, 1, 1]-alpha[14, 2, 2])-alpha[14, 1, 2]*alpha[14, 2, 1])*alpha[14, 3, 3]/(alpha[9, 1, 2]*alpha[9, 2, 6]), alpha[9, 3, 3] = alpha[14, 3, 3], alpha[9, 3, 4] = (alpha[9, 1, 1]-alpha[14, 1, 1])*alpha[14, 2, 6]*alpha[14, 3, 5]/(alpha[9, 1, 2]*alpha[9, 2, 6]), alpha[9, 3, 5] = alpha[14, 2, 6]*alpha[14, 3, 5]/alpha[9, 2, 6]}

simplify(eval((rhs-lhs)~(eqjerkAB),solother));

[0, 0, 0, 0, 0, 0]

lhsvars:=indets(lhs~(solother));

{alpha[9, 2, 2], alpha[9, 3, 0], alpha[9, 3, 3], alpha[9, 3, 4], alpha[9, 3, 5]}

sol2:=simplify(solve(eqjerkAB,lhsvars));

{alpha[9, 2, 2] = -alpha[9, 1, 1]+alpha[14, 1, 1]+alpha[14, 2, 2], alpha[9, 3, 0] = alpha[14, 3, 3]*(alpha[9, 1, 1]^2+(-alpha[14, 1, 1]-alpha[14, 2, 2])*alpha[9, 1, 1]+alpha[14, 1, 1]*alpha[14, 2, 2]-alpha[14, 1, 2]*alpha[14, 2, 1])/(alpha[9, 1, 2]*alpha[9, 2, 6]), alpha[9, 3, 3] = alpha[14, 3, 3], alpha[9, 3, 4] = (alpha[9, 1, 1]-alpha[14, 1, 1])*alpha[14, 2, 6]*alpha[14, 3, 5]/(alpha[9, 1, 2]*alpha[9, 2, 6]), alpha[9, 3, 5] = alpha[14, 2, 6]*alpha[14, 3, 5]/alpha[9, 2, 6]}

They look the same except alpha[9,3,0]

ExpressionTools:-Compare(sol2,solother);

"{alpha[9,2,2]=-alpha[9,1,1]+alpha[14,1,1]+alpha[14,2,2],alpha[9,3,0]=(alpha[14,3,3] ((alpha[9,1,1]^2)+((-1) alpha[([[14],[9]]),1,1]-alpha[14,2,2]) (alpha[9,1,1]+(-alpha[14,1,1]))+(alpha[14,1,1] alpha[14,2,2])-alpha[14,1,2] alpha[14,2,1]))/(alpha[9,1,2] alpha[9,2,6]),alpha[9,3,3]=alpha[14,3,3],alpha[9,3,4]=((alpha[9,1,1]-alpha[14,1,1]) alpha[14,2,6] alpha[14,3,5])/(alpha[9,1,2] alpha[9,2,6]),alpha[9,3,5]=(alpha[14,2,6] alpha[14,3,5])/(alpha[9,2,6])}"

Check the alpha[9,3,0] expressions are actually the same.

simplify(eval(alpha[9,3,0],sol2)-eval(alpha[9,3,0],solother));

0

NULL

Download eqns.mw

I mostly use laplace transforms, but the same applies here. The inverse transforms often seem to need additional assumptions to work. Here adding "assuming positive" will work. I use this for invlaplace even though s is not positive, i.e., it works even though the assumptions might not be correct.

Holding the windows key down with downarrow should minimize. On Maple (Java interface?) it seems instead to iconify, but that may be enough for you.

You can convert the plot to an image, and then strip off the pixels around the border when you write the image to a file

p := plot(x^2, x = 0 .. 3, background = "Blue", axes = none);
p2 := convert(p, Image):
ImageTools:-Write("test2.png", p2[9 .. -9, 10 .. -9, 1 .. 3]);

The file goes into the location specified by currentdir(); you may add the path information to the filename for other locations.

This is for the default size plot. For others the border might be a different size, and you might have to look at the Array to see where the border of 1s ends (that's just a guess; I didn't try it).

kill_border.mw

Another solution, which I prefer, is to export the original plot to *.eps, which is a vector graphics format. Import into your favourite editing program (I use CorelDraw), delete the rectangle object that is the border, and then export to *.png (or other format). This way you're not messing around with individual pixels.

3 4 5 6 7 8 9 Last Page 5 of 81