Maple 2020 Questions and Posts

These are Posts and Questions associated with the product, Maple 2020

Vector calculus is very nicely handled in Maple's Physics package:

with(Physics[Vectors]):

The gradient of a scalar field in Cartesian coordinates

Gradient(f(x,y,z));

(diff(f(x, y, z), x))*_i+(diff(f(x, y, z), y))*_j+(diff(f(x, y, z), z))*_k

The gradient of a scalar field in cylindrical coordinates

Gradient(f(rho,phi,z));

(diff(f(rho, phi, z), rho))*_rho+(diff(f(rho, phi, z), phi))*_phi/rho+(diff(f(rho, phi, z), z))*_k

But the gradient of a vector field is not available:

Gradient(_rho*f(rho,phi,z) + _phi*g(rho,phi,z) + _k*h(rho,phi,z));

Error, (in Physics:-Vectors:-Nabla) Physics:-Vectors:-Gradient expected a scalar function, but received the vector function: _rho*f(rho, phi, z)+_phi*g(rho, phi, z)+_k*h(rho, phi, z)

I suppose this is because the gradient of a vector field needs to be
expressed in terms a basis consisting of the dyadic products  of the basis vectors

as in _i  _j, _rho_phi, etc., which does not seem to be implemented.

 

That said, it is quite possible that this is already done and I have missed it in
the documentation since the Physics package is so huge.  But if it's truly not there,
it would be a very useful feature to add.  Calculating gradients of vector fields

is central to continuum mechanics (including elasticity and fluid mechanics).

They are easy to represent in Cartesian coordinates but their calculation in the

frequently needed cylindrical and spherical coordinates are nontrivial and can use

Maple's help.

 

The changecoords command in the procedure below executes the plots:-changecoords command despite the preceding unwith(plots) command.

How can I execute the non-plot version of the changecoords command in the procedure. It would be very inconvenient of all the various commented plot commands had to be preceded by plots:-

restart; with(plots):   # first command in the worksheet


  # many statements executing various plot commands

 
P := proc()

unwith(plots):

changecoords([x, y, z], [x, y, z], spherical):

with(plots):

end proc:


P();
Error, (in plots/changecoords) changecoords does not accept plot options or other additional arguments
 

  # many more statements executing various plot commands

 

 # last command in the worksheet

Dear Maple community,

I was wondering whether you could help me with the following problem: Consider the non-linear system of 4 equations in 4 unknowns: {y[2,1], y[2,2], y[4,1], y[4,2]}, see MapleQ.mw. Please also note that equations y[2,1] and y[2,2] in sys2 are homogenous of degree 1 (i.e., defined only up to scale). In principle, it should be possible to choose either y[2,1] or y[2,2] as a free and unconstrained variable (a scaling factor) and express all other unknowns in terms of it. Unfortunately, I couldn't yet implement it in the current setting and was wondering whether you give me a hand. Thank you very much in advance!

``

sys1 := {y[4, 1] = 33^(2/3)*50^(1/3)/(33*(1/(y[2, 1]^(3/2)*y[4, 1]^(3/2)))^(1/3))+2^(2/3)*5^(1/3)/(2*(1/(y[2, 2]^(3/2)*y[4, 2]^(3/2)))^(1/3)), y[4, 2] = 11^(2/3)*50^(1/3)/(11*(1/(y[2, 1]^(3/2)*y[4, 1]^(3/2)))^(1/3))+4^(2/3)*5^(1/3)/(4*(1/(y[2, 2]^(3/2)*y[4, 2]^(3/2)))^(1/3))}

sys2 := {y[2, 1] = 33/(100*sqrt(y[2, 1])*y[4, 1]^(3/2)*(33/(50*y[2, 1]^(3/2)*y[4, 1]^(3/2))+2/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+11/(40*sqrt(y[2, 1])*y[4, 1]^(3/2)*(11/(20*y[2, 1]^(3/2)*y[4, 1]^(3/2))+1/(2*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+3*y[2, 2]/(20*y[2, 1]^(3/2)*y[4, 1]^(3/2)*(11/(50*y[2, 1]^(3/2)*y[4, 1]^(3/2))+4/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+3*y[2, 2]/(10*y[2, 1]^(3/2)*y[4, 1]^(3/2)*(11/(25*y[2, 1]^(3/2)*y[4, 1]^(3/2))+3/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2)))), y[2, 2] = 11*y[2, 1]/(75*y[2, 2]^(3/2)*y[4, 2]^(3/2)*(33/(50*y[2, 1]^(3/2)*y[4, 1]^(3/2))+2/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+11*y[2, 1]/(60*y[2, 2]^(3/2)*y[4, 2]^(3/2)*(11/(20*y[2, 1]^(3/2)*y[4, 1]^(3/2))+1/(2*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+2/(5*sqrt(y[2, 2])*y[4, 2]^(3/2)*(11/(50*y[2, 1]^(3/2)*y[4, 1]^(3/2))+4/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))+3/(10*sqrt(y[2, 2])*y[4, 2]^(3/2)*(11/(25*y[2, 1]^(3/2)*y[4, 1]^(3/2))+3/(5*y[2, 2]^(3/2)*y[4, 2]^(3/2))))}

 

Download MapleQ.mw

Fortran 2000 introduced a simple system for interoperability with C. That was expanded in 2020 to provide C macros to support Fortran concepts that do not exist in C, such as optional arguments and assumed-shape arrays. This is all described in Chapter 18 of the Fortran 2020 standard at http://j3-fortran.org/doc/year/21/21-007.pdf.

 

I want to call Maple from Fortran. The StartMaple function has a result of type MKernelVector. I can't find any description of it in the Advanced Maple Programming Guide other than that it's a handle. In order to create a Fortran variable to hold the result of StartMaple, to pass to the other functions, I need to know more. Is it an int or a long or a longlong or a pointer, or what?

 

I guessed longlong would work, but it apparently doesn't. The result value of StartMaple is nonzero and apparently at least 64 bits. Invoking EvalMapleStatement using that result value causes a segmentationf fault (I'm running Debian Buster 10 Linux).

 

That's as far as I've gotten.

 

Any ideas how to proceed?

 

How Would I fix that?

How we can see steps of Laplace transform calculation?

In a thesis by Md. Mohsin Ali at the University of Ontario, he says that ifactor uses multiple threads and presents a graph of measured results.

I ran ifactor with a 100 digit input and do not see mserver using multiple cores in top.  I do see mserver using 100% of a single core.

Am I missing something?

It would be nice to save various animated Maple images from into GIF images, but without the coordinates and the axes. THe same question in anoehr way: Can we plot the original function without any axes or coordinates?

Thank you!

mapleatha

ifactor(1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350692006139);

kilobytes used=921, alloc=1200, time=0.09
kilobytes used=1325, alloc=5296, time=0.13

...

kilobytes used=107733, alloc=9228, time=6.64

Process Maple segmentation fault (core dumped)


No matter what I do from the keyboard, a core dump is not a reasonable response.

 

This worksheet animates stereographic projection of a grid on a sphere onto the plane the sphere sits on.

Is there a way to display matching colors in corresponding cells in the two grids?

Stereographic_projection.mw

 

 

Hi,

I need to find out how to print the number of row or the numbers on right based only on the combination of the two numbers in first two columns. The external file looks like this:

I have prepared possible combinations of numbers and I need to read the numbers on the right which belongs to this combination. There is no such thing as the sum of two numbers = number of row, so it can't be done this easy.

Can somebody help please? Thanks a lot

These two animations do not work under Maple 2020. How do I make them work? What am I doing wrong?

plots[animate]( plot3d, [sin(A)*(x^2+y^2), x=-2..2, y=-2..2], A=0..2*Pi );

plots[animate]( plot, [A*sin(x), x=0..10], A=0..2 );

Thank you!

mapleatha

 

 

 

 

hi, I wonder why this output is empty because I tried to get solution below partial equation:

restart;
with(PDEtools);
pe := diff(u(t, x, y), t) = u(t, x, y) - diff(u(t, x, y), x $ 2) - diff(u(t, x, y), y $ 2) + (1 + u(t, x, y)*I)*abs(u(t, x, y))*u(t,x,y)^2;                                  
inc := u(0, x, y) = cos(Pi*x/50) - cos(Pi*x/150)*I;
sys := [pe, inc];
   

pdsolve(sys);
 

end after this pdsolve(sys); Maple doesn't show anything

thanks in advance

I am a student who is learning to use Maple to perform numerical analysis of phase field. There has been no solution to the problem of high anisotropy. The reference code is as follows

W :=piecewise(beta>=Pi/2+thetaM and beta<=Pi-thetaM, 1+eps*cos(4*beta), 
       beta>=Pi/2-thetaM and beta<=Pi/2+thetaM, (1+esp*cos(4*thetaM))/cos(thetaM)*cos(4*beta));

 

However, there is no problem at all when simply performing the following settings.

W := 1+ eps*cos(4*beta);

Please tell me how to write such a conditional maple statement. I have referenced many examples on the official website, but none of them succeeded. This includes writing the code in the following form.

W :=betta->piecewise(beta>=Pi/2+thetaM and beta<=Pi-thetaM, 1+eps*cos(4*beta), 
       beta>=Pi/2-thetaM and beta<=Pi/2+thetaM, (1+esp*cos(4*thetaM))/cos(thetaM)*cos(4*beta));

Remarks, beta is an angle, set as follows.

subs(beta=t_atan2(diff(pho(x,y),y), diff(pho(x,y),x))

 


 

Maple has issues integrating products of Bessel functions over an infinite range, and in fact, this extends to trig functions. The integrals in the attached should return as delta functions but don't. 

Spherical_Bessel_identity.mw

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