Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I want to display in 3d the following objects

  • Animated plottools objects (e.g. a spinning cube)
  • Static plot objects (e.g. surface plot)/li>
  • Time dependent spacecurves (to trace the path of objects)

Technically I could

  • create a sequence of time stamps
  • generate for each time stamp a plot structure using plots:-display for all the above objects
  • display the sequence of plot structures with plots:-display with the option insequence.

or

  • create separate plots with plots:-animate for each time dependent object
  • plot with plot3d all static objects
  • display all plots with plots:-display

or

  • defining a procedure containing all plotting commands as a function of time
  • create a background plot of all static objects using plots:-display
  • animate the procedure with a plots:-animate call with the background option

Without having any experience, my perference would be the last way. However I intend to generate some plot coordinates with dsolve,numeric. This would mean that at each point in time to be plotted, dsolve starts integration from the inital conditions (which I have not planned to update animation frame by animation frame)

Any recommensations or thoughts on this?

In the publication
https://www.scirp.org/pdf/apm_2021062513594181.pdf
I read that Maple18 contains the "Adomian Decomposition". In "Help" of "Maple2024" I found no direct reference to this method. I would like to ask you to provide references in the help text to this method for solving differential equations.

The other night, first time using Maple in more than 20 years, I asked for the solution to this, looking for u1 in terms of u2:

equ := u2 - u1/(-u1^2 + 1)

solve(equ, [u1])

==> u1 = (-1 + sqrt(4*u2^2 + 1))/(2*u2)

But this is sheer nonsense. The correct solution should be:

u1 = (-1 + sqrt(u2^2 + 1))/u2   ;; note the lack of 4x scaling inside the Sqrt, nor the 2x in the denominator.

What the heck??

there is four formula for calculate them which i know them by name of author the first one is adomian second one is (BiazarShafiofAdomian) which one member of mableprimes write code for me,but i don't know how use for all kind function maybe in future i upload this program for fix this issue, the third one is by zhao which is i think i easy for calculate just  i need someone one to wite the program and do some test for some example i  upload some picture in case for getting algorithm to writting and have some example for testing  so  lets see who can do this algorithm is very usfule when we solve ODE or PDE by LDM, also last method is by taking integral have a good method, in this question this algorithm is zhao which is usfull one

Hi,
I have an equation and I want to solve it parametrically to find x , but I couldn't do that with "solve" command. (I know x should be  real and positive). What should I do?
Root_of.mw

[moderator: The Physics update Library fixes this bug with the same error generated and reported by the same Mapleprimes member on another ODESteps example.]

I have removed Physics update from libname path. 

Now I find I get error calling latex command. When Physics update is on libname, no error.

The error is 

         Error, (in Typesetting:-Parse) too many levels of recursion

I am using worksheet with typesetting extended. But also when I change it to typesetting standard, same error. 

Does this mean one must keep Physics update on libname path for Maple to work OK?

Is this error expected if Physics update is not on libname?

Worksheet below that shows this problem

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

CASE 1. With Physics update in libname path, no error

 

restart;

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

ode:=[diff(x__1(t),t)=2*x__1(t)+x__2(t),diff(x__2(t),t)=2*x__1(t)+3*x__2(t)];

[diff(x__1(t), t) = 2*x__1(t)+x__2(t), diff(x__2(t), t) = 2*x__1(t)+3*x__2(t)]

the_output:=Student:-ODEs:-ODESteps(ode,output=typeset):

latex(the_output,'output'=string):

 

CASE 2.  Removing Physics from libname path, gives internal error

 

restart;

libname:=libname[2];

"C:\Program Files\Maple 2024\lib"

ode:=[diff(x__1(t),t)=2*x__1(t)+x__2(t),diff(x__2(t),t)=2*x__1(t)+3*x__2(t)];

[diff(x__1(t), t) = 2*x__1(t)+x__2(t), diff(x__2(t), t) = 2*x__1(t)+3*x__2(t)]

the_output:=Student:-ODEs:-ODESteps(ode,output=typeset):

latex(the_output,'output'=string):

Error, (in Typesetting:-Parse) too many levels of recursion

 

 

 

Download internal_error_from_latex_when_libname_changed_nov_2_2024.mw

I find an error when calculating ExponentialFit(X, Y, x, summarize = embed) function. It's have an error in R-squared and Adjusted R-squared.

I’m working on deriving the equation of motion (16) from equation (9) (see attached image), but I’ve encountered a couple of issues in Maple. i) The variational derivative of Lagrangian, and ii) the commutator is zero, which isn’t expected.

How do we fix these issues? Are there any specific packages regarding the construction of Lagrangian?

VariationDerivative.mw

I think I just found one of the most serious problems in Maple I've seen (other than timelimit hanging).

This is using Maple 2024.2 on windows 10.

I'll explain in words the problem, then give worksheet below to reproduce this. I can reproduce this all the time.

I have implicit solution in y(x) to an ode.

If I first solve for y(x) from the solution, so solution is now explicit, then call odetest to check if this explicit solution is correct, and if I use assumptions on the odetest call, and then after that call odetest on the original implicit solution, then odetest fails to verify the implicit solution.

But, if I change the order, and first call odetest to verify the implicit solution first, it verifies it OK !  

So the problem ONLY happens if I change the order of calling odetest and if I use assumptions on the odetest call that was used before on the explicit solution.

This tells me that Maple remembers something from earlier call. Does it remember the assumptions used? If so, this is very risky. As some part of program might call odetest with some assumptions, and another part of the program can use no assumptions.  I thought assuming is only applied to the call it is used at only and will not affect future calls.

Is there a way then to clear all assumptions used on earlier call to Maple command before using the command again? Or to tell Maple not to remember assumptions used on a call?

This is a big problem. It took me 14 hrs of debuging to find it. Order of calls to odetest should not make it behave different.

I hope someone could find solution to this, since now I have no idea what to do as I need to use odetest on explicit and implicit solutions and I do not want the order of calling Maple command to make difference in results.

This worksheet shows the problem. 3 cases are given. Notice that when using assumptions on earlier call to odetest, how it fails to verify the implicit solution in later call.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1824 and is the same as the version installed in this computer, created 2024, October 31, 14:22 hours Pacific Time.`

kernelopts('assertlevel'=2):

CASE 1. Calling odetest on explicit first with assumptions, make odetest hang when calling on implicit after

 

restart;

IMPLICIT_SOL:=ln(10*x^2 + (10*y(x) + 12)*x + 5*y(x)^2 + 8*y(x) + 4)/5 - (4*arctan((5*y(x) + 5*x + 4)/(5*x + 2)))/5 = (3*ln(2))/5 + (4*arctan(3))/5;
ode:=2*x+3*y(x)+2+(y(x)-x)*diff(y(x),x) = 0;
IC:=y(0) = -2;

(1/5)*ln(10*x^2+(10*y(x)+12)*x+5*y(x)^2+8*y(x)+4)-(4/5)*arctan((5*y(x)+5*x+4)/(5*x+2)) = (3/5)*ln(2)+(4/5)*arctan(3)

2*x+3*y(x)+2+(y(x)-x)*(diff(y(x), x)) = 0

y(0) = -2

#find explicit solution first
EXPLICIT_SOL:=solve(IMPLICIT_SOL,y(x)):

#NOw check the explicit solution. Using assumptions to see the problem
timelimit(30,  ( odetest(y(x)=EXPLICIT_SOL,[ode,IC]) assuming positive, y(x)::positive) );

Error, (in evalr) time expired

#Now odetest hangs on the implicit solution

timelimit(30,  odetest(IMPLICIT_SOL,[ode,IC]) );

Error, (in is/internal/rename) time expired

 

 

(1/5)*ln(10*x^2+(10*y(x)+12)*x+5*y(x)^2+8*y(x)+4)-(4/5)*arctan((5*y(x)+5*x+4)/(5*x+2)) = (3/5)*ln(2)+(4/5)*arctan(3)

y(x)

2*x+3*y(x)+2+(y(x)-x)*(diff(y(x), x)) = 0

y(0) = -2

CASE 2. Calling odetest on implicit solution first, then it DOES NOT hang !!

 

restart;

IMPLICIT_SOL:=ln(10*x^2 + (10*y(x) + 12)*x + 5*y(x)^2 + 8*y(x) + 4)/5 - (4*arctan((5*y(x) + 5*x + 4)/(5*x + 2)))/5 = (3*ln(2))/5 + (4*arctan(3))/5;
ode:=2*x+3*y(x)+2+(y(x)-x)*diff(y(x),x) = 0;
IC:=y(0) = -2;

(1/5)*ln(10*x^2+(10*y(x)+12)*x+5*y(x)^2+8*y(x)+4)-(4/5)*arctan((5*y(x)+5*x+4)/(5*x+2)) = (3/5)*ln(2)+(4/5)*arctan(3)

2*x+3*y(x)+2+(y(x)-x)*(diff(y(x), x)) = 0

y(0) = -2

#notice, no hang now, since called before
timelimit(30,  odetest(IMPLICIT_SOL,[ode,IC]) );

[0, 0]

#NOw check the explicit solution. This will timeout which is OK
EXPLICIT_SOL:=solve(IMPLICIT_SOL,y(x)):
timelimit(30,  ( odetest(y(x)=EXPLICIT_SOL,[ode,IC]) assuming positive, y(x)::positive) );

Error, (in type/complex) time expired

#check again that odetest still verifies the implicit solution OK

timelimit(30,  odetest(IMPLICIT_SOL,[ode,IC]) );

[0, 0]

 

CASE 3. Calling odetest with no assumptions on explicit solution, then it also does not hang

 

restart;

IMPLICIT_SOL:=ln(10*x^2 + (10*y(x) + 12)*x + 5*y(x)^2 + 8*y(x) + 4)/5 - (4*arctan((5*y(x) + 5*x + 4)/(5*x + 2)))/5 = (3*ln(2))/5 + (4*arctan(3))/5;
ode:=2*x+3*y(x)+2+(y(x)-x)*diff(y(x),x) = 0;
IC:=y(0) = -2;

(1/5)*ln(10*x^2+(10*y(x)+12)*x+5*y(x)^2+8*y(x)+4)-(4/5)*arctan((5*y(x)+5*x+4)/(5*x+2)) = (3/5)*ln(2)+(4/5)*arctan(3)

2*x+3*y(x)+2+(y(x)-x)*(diff(y(x), x)) = 0

y(0) = -2

#Now check the explicit solution. but DO NOT use assumptions
EXPLICIT_SOL:=solve(IMPLICIT_SOL,y(x)):
timelimit(30, odetest(y(x)=EXPLICIT_SOL,[ode,IC]));

Error, (in factor/remember) time expired

#check again that odetest still verifies the implicit solution OK

timelimit(30,  odetest(IMPLICIT_SOL,[ode,IC]) );

[0, 0]

 


 

Download order_of_ode_test_makes_difference_oct_31_2024.mw

 

update NOV 2, 2024 6 AM

I found the cause.

Removing PHYSICS from libname, then the problem goes away !

So this is caused by PHYSICS package. For some reason, having Physics package in the libname causes odetest to hang/fail compared to when the physics package is not in the libname path. Worksheet below.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1824 and is the same as the version installed in this computer, created 2024, October 31, 14:22 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

CASE 1. without PHYSICS on libname, it works !!

 

restart;

kernelopts('assertlevel'=2):

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

libname:=libname[2]; #remove PHYSICS

"C:\Program Files\Maple 2024\lib"

libname;

"C:\Program Files\Maple 2024\lib"

IMPLICIT_SOL:=ln(10*x^2 + (10*y(x) + 12)*x + 5*y(x)^2 + 8*y(x) + 4)/5 - (4*arctan((5*y(x) + 5*x + 4)/(5*x + 2)))/5 = (3*ln(2))/5 + (4*arctan(3))/5;
ode:=2*x+3*y(x)+2+(y(x)-x)*diff(y(x),x) = 0;
IC:=y(0) = -2;

(1/5)*ln(10*x^2+(10*y(x)+12)*x+5*y(x)^2+8*y(x)+4)-(4/5)*arctan((5*y(x)+5*x+4)/(5*x+2)) = (3/5)*ln(2)+(4/5)*arctan(3)

2*x+3*y(x)+2+(y(x)-x)*(diff(y(x), x)) = 0

y(0) = -2

#find explicit solution first
EXPLICIT_SOL:=solve(IMPLICIT_SOL,y(x)):

#NOw check the explicit solution. Using assumptions to see the problem
timelimit(30,  ( odetest(y(x)=EXPLICIT_SOL,[ode,IC]) assuming positive, y(x)::positive) );

Error, (in evalr/ln) time expired

#Now try odetest  on the implicit solution

infolevel[odetest]:=5;

5

timelimit(30,  odetest(IMPLICIT_SOL,[ode,IC]) );

odetest: Performing an implicit solution test

odetest: Performing an explicit (try soft) solution test

odetest: Performing an implicit solution (II) test

[0, 0]

 

 

CASE 2. With Physics on libname, it fails !

 

restart;

kernelopts('assertlevel'=2):

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

IMPLICIT_SOL:=ln(10*x^2 + (10*y(x) + 12)*x + 5*y(x)^2 + 8*y(x) + 4)/5 - (4*arctan((5*y(x) + 5*x + 4)/(5*x + 2)))/5 = (3*ln(2))/5 + (4*arctan(3))/5;
ode:=2*x+3*y(x)+2+(y(x)-x)*diff(y(x),x) = 0;
IC:=y(0) = -2;

(1/5)*ln(10*x^2+(10*y(x)+12)*x+5*y(x)^2+8*y(x)+4)-(4/5)*arctan((5*y(x)+5*x+4)/(5*x+2)) = (3/5)*ln(2)+(4/5)*arctan(3)

2*x+3*y(x)+2+(y(x)-x)*(diff(y(x), x)) = 0

y(0) = -2

#find explicit solution first
EXPLICIT_SOL:=solve(IMPLICIT_SOL,y(x)):

timelimit(30,  ( odetest(y(x)=EXPLICIT_SOL,[ode,IC]) assuming positive, y(x)::positive) );

Error, (in evalr/shake) time expired

#Now try odetest  on the implicit solution

infolevel[odetest]:=5;

5

timelimit(30,  odetest(IMPLICIT_SOL,[ode,IC]) );

odetest: Performing an implicit solution test

odetest: Performing an explicit (try soft) solution test

odetest: Performing an implicit solution (II) test

Error, (in is/internal/rename) time expired

 

 

Download order_of_ode_test_makes_difference_NOV_2_2024.mw

my question is: Is it safe to permanently remove Physics package from libname? Why is having physics package in libname (which is by default) causes this problem?

I do not use Physics package explicitly in my code. i.e. I do not do Physics:- calls. 

Any one knows what effect not having Physics on libname cause? Will Maple still work OK for everything if one is not calling Physics package explicitly?

When I export images as SVG the resulting file always has the image much larger than the viewbox resulting in only part of it showing. My normal workflow is to then load in Inkscape and correct the error, however, I would love to not have an extra step. Is there any other fix for this?

How can I use Maple to solve a system of nonlinear equations symbolically and display the steps in the solution?

Here are two systems over the reals:

sys__1:=And(r*(387*r+52)+2<r*(226*q+121*s)+9*q*(q*(2*q-5)-3*s+2)+6*s,4*q^3+r*(27*r+4)+s^2=q*(q+18*r),q>=0,r>=0):
sys__2:=And((392-1739*q)*r+4*(2-9*q)**2+2151*r**2<75*r*s,4*q**3+r*(27*r+4)+s**2=q*(q+18*r),q>=0,r>=0):

The following results indicate that both and are satisfiable 

QuantifierElimination:-QuantifierEliminate(exists([s,q,r],sys__1));
                              true
QuantifierElimination:-QuantifierEliminate(exists([s,q,r],sys__1));
                              true

but RealDomain:-solve simply returns an empty list (that is, no solution exists) in both cases

RealDomain:-solve(sys__1,[q,s,r]); # ⟹ sys1 cannot be satisfied
                               []
RealDomain:-solve(sys__2,[q,s,r]); # ⟹ sys2 cannot be satisfied
                               []

As discussed in the previous problem, in contrast to using QuantifierElimination:-QuantifierEliminate, the use of RealDomain:-solve is unsafe. Nevertheless, the above output suggests that even the much-more-sophisticated QuantifierElimination:-QuantifierEliminate is still not always reliable (since the correct returnedvalue appears to be in lieu of ). So, what is the right command to handle polynomial systems over real domains in Maple? 

I have learned that the SPECTRA.mla library can solve SDP problems. I have tried to download and use it, but I am still missing the FGb module

> with(SPECTRA);
> M := Matrix(6, 6, [[10, 1, 0, m[1], -m[3], m[2]], [1, -2*m[1]+27, m[3], -27/2, -m[4], -m[5]], [0, m[3], -2*m[2], m[4], m[5], 0], [m[1], -27/2, m[4], 10, 0, m[6]], [-m[3], -m[4], m[5], 0, -2*m[6], 0], [m[2], -m[5], 0, m[6], 0, 1]]);
> SolveLMI(M);
=> Error, (in SPECTRA:-SolveLMI) `FGb` does not evaluate to a module

 

How can I resolve this issue on a Windows environment, beause I don't see install file for Windows, only MacOS and Linux:

I have this problem:

(x'+x''+epsilon/x)(x'-(x')^3/3!)(x''-(x'')^3/3!)(epsilon/x -(epsilon/x)^3/3!)=1

x(0)=epsilon , x'(epsilon)=epsilon+epsilon^{-1}

0<epsilon<<1

Now I want to try the ansatz: x(epsilon,t)=x_{-1}(t)/epsilon+x_0(t)+x_1(t)epsilon.

Can you suggest me a way to implement this ansatz (i.e finding x_{-1}(t),x_0(t),x_1(t)).

Appreciate your time!

Hi Dear,

I hope everyone is fine here. In the attached file, I have generated a square matrix "Q" using two-dimensional polynomials. The dimension of the square matrix "Q" depends on M1 and M2 parameters. In my simulation, sometimes I need this matrix of 1000 by 1000 dimensions. Using the attached method, it took a lot of time to compute two-dimensional polynomials and then to compute the general square matrix "Q." I wanted to write this matrix using proc (procedures). Maybe by using this way, I don't need to compute the polynomials, and it took less time to compute the square matrix "Q." I know how to generate a matrix using proc when its dimension depends on one parameter. However, here, the dimension of matrix "Q" depends on two parameters, M1 and M2. So, I am a little bit confused about how to adjust them in proc. Please see the attached file and share your useful ideas. 

help.mw

Thanks in advance

First 10 11 12 13 14 15 16 Last Page 12 of 2215