nm

11393 Reputation

20 Badges

13 years, 55 days

MaplePrimes Activity


These are replies submitted by nm

in maple 2025, do FILE->OPTIONS and click on the interface tab and select "open worksheet in NEW TAB"

@Rouben Rostamian  

fyi, I think the assumption should be assuming x >= 0 etc.. and not assuming x > 0 etc.. because the IC is at 0 so domain should include zero.

Same answer will result.

Another observation: This is not easy to do. How is Maple dsolve (or any other program) supposed to know to use assuming x >= 0, x <= 2*Pi to simplify the solution? (or any other range).

Without using this assumption, it does not work (i.e. hard to resolve C1).

So may be this is why dsolve left the constant there. Even though I still think the final solution should not have constant of integration in it. 

@Carl Love 

It is not Riccati.  Riccati has this short form  y'=q(x)+y^2, where q here must be function of x and not just a constant or parameter.

Wikipedia writes q0(x)  to indicate this but may be it should also made it clear that q0 must depend on x.  Not all the q's have to be function of x, but at least one of them must.

The ode  y'=3+y^2 is quadrature (because it solved by just integration), but y'=x+y^2 is riccati.

Another example

And another

your ode is not Riccati. This is basic quadrature.

restart;

gamma0 := -a^2;
de := diff(chi(x), x) = chi(x)^2 + gamma0;
DEtools:-odeadvisor(de);

-a^2

diff(chi(x), x) = chi(x)^2-a^2

[_quadrature]

sol := dsolve(de, chi(x));

chi(x) = -a*(1+exp(2*c__1*a+2*x*a))/(exp(2*c__1*a+2*x*a)-1)

 

 

Download dsolve_may_19_2025.mw

@delvin 

I want to define the expression diff(H(xi), xi, xi)/H(xi)^2 as a new variable

Then why you said in your question you wanted the coefficient of the above to be zero?

Ok,, try this. if you want to eliminate H(xi), then try solving the ode  H'/H^2=Z for H and then use dchange to chnage the dependent variable H to Z.

The new ode will be in term of Z(xi) only and no H(xi) in it. 

Again, do not know if this is what you meant. If not, then may be someone else can better guess than I am able to.

restart;

df := diff(H(xi), xi, xi)= 2*diff(H(xi), xi)^2/H(xi) + A *H(xi)^2 + B*(diff(H(xi), xi)/H(xi))^2 + C*diff(H(xi), xi):
eq1:= -216*a1*(2*diff(H(xi), xi)^2/H(xi))+2*a3*(2*diff(H(xi), xi)^2/H(xi) + A + B*diff(H(xi), xi)^2/H(xi)^2 + C*diff(H(xi), xi))*c^2/H(xi)^2+4*diff(H(xi), xi)^3/H(xi)^2+5*diff(H(xi), xi)^2/H(xi)^3+7*diff(H(xi), xi)^3/H(xi)^5:         
eq2 := expand(subs(df, eq1));
 

-432*a1*(diff(H(xi), xi))^2/H(xi)+4*a3*c^2*(diff(H(xi), xi))^2/H(xi)^3+2*a3*c^2*A/H(xi)^2+2*a3*c^2*B*(diff(H(xi), xi))^2/H(xi)^4+2*a3*c^2*C*(diff(H(xi), xi))/H(xi)^2+4*(diff(H(xi), xi))^3/H(xi)^2+5*(diff(H(xi), xi))^2/H(xi)^3+7*(diff(H(xi), xi))^3/H(xi)^5

ode:=diff(H(xi), xi)/H(xi)^2=Z(xi);

(diff(H(xi), xi))/H(xi)^2 = Z(xi)

sol:=dsolve(ode);

H(xi) = 1/(Int(-Z(xi), xi)+c__1)

PDEtools:-dchange({sol},eq2,[Z(xi)])

-432*a1*Z(xi)^2/(Int(-Z(xi), xi)+c__1)^3+4*a3*c^2*Z(xi)^2/(Int(-Z(xi), xi)+c__1)+2*a3*c^2*(Int(-Z(xi), xi)+c__1)^2*A+2*a3*c^2*B*Z(xi)^2+2*a3*c^2*C*Z(xi)+4*Z(xi)^3/(Int(-Z(xi), xi)+c__1)^4+5*Z(xi)^2/(Int(-Z(xi), xi)+c__1)+7*Z(xi)^3/(Int(-Z(xi), xi)+c__1)

 

 

Download repl_may_19_2025_V2.mw

@delvin 

 I want to remove the derivatives in eq 2 and the new function will not have any derivative terms at all.

If this is what you want, then why not just set diff(H(xi), xi) to zero in each term that has it? Looking at your eq2, this will leave only 2*a3*c^2*A/H(xi)^2 term.

@vv 

Closed all of Maple, open Maple, open worksheet. No interface call,  nothing, just the timelimit call, this is the result 

try
   timelimit(30,simplify(tan(Pi/5) + sin(Pi/15) - sqrt(15)));
catch:
   print(lastexception);
end try;

`[Length of output exceeds limit of 50000]`

 

 

Download simplify_may_17_2025_v2.mw

Do not know why now it gives such large output. Strange. But no crash.

And then closed Maple, started again, and now just called simplify with no timelimit. Waited 2 mins, then stopped kernel using the button on lower left corner. it worked. computation stopped.

No problem for me on Linux, Maple 2025 with ST 17.

I also was able to stop the kernel by clicking on lower left red botton. Timelimit also works on this.

worksheet below

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 17 and is the same as the version installed in this computer, created May 5, 2025, 12:37 hours Eastern Time.`

restart;

try
   timelimit(30,simplify(tan(Pi/5) + sin(Pi/15) - sqrt(15)));
catch:
   print(lastexception);
end try;

proc (x) local x1; option `Copyright (c) 1999 Waterloo Maple Inc. All rights reserved.`; `...` end proc, "time expired"

Download simplify_may_17_2025.mw

@acer 

I myself only export to pdf or if not possible to .ps (this is from any application, not just Maple) and then for HTML use, convert the PDF to svg using the Linux builtin command pdf2svg which comes with any Linux distro or can be easily installed on Linux if it is not already there.

pdf2svg  is  a tiny command-line utility using Cairo and Poppler 
to convert PDF documents into SVG files."

Always export to vector based format and not raster based format. So try to export to postscript or pdf and not to png or jpeg. 

@dharr 

Thanks. This is all done in code, and code does not know that there is LambertW function in solution.

Code tries positive and negative assumptions among other things, but not x>1 or x<1

I'll add code to check if solution or residue has LambertW and in this case add assumptions x>1 and x<1 (but also code does not know what the argument to LambertW in the solution, so it will need to do more than this, i.w. the function can be W(-exp(-2*x)) instead of W(-exp(-x)) as in this case, and also there can be more than one LambertW in the solution with different arguments, so finding the correct domain can quickly become complicated). Again, all of this is done in code. Can't look at screen and decide what to do.

It will be nice if odetest itself can do all of this work and give result with conditions to the user. i.e. an answer with piecewise with 0 where it is valid solution and not zero when it is not. 

Many times I find that solving an ode is simpler than verifying the solution is correct!

this looks like a bug as help clearly says

"The convert(A, Vector) function converts the parameter A into a Vector.
"The orientation of the result can be specified via the parameter o. The default orientation is column."

Also below it says

"If A is a 1-dimensional array or Array, a list, a vector or a Vector, it is simply passed directly to the Vector constructor"

but Vector([1, 2, 3]) gives column vector.

@C_R 

I see. But if the reason it timedout for you when you run in B.M. (battery mode) is because Maple was slower and the 30 seconds was reached before entering the DLL, then this will not help me. It is then just by chance. It is like me setting timelimit of 2 seconds instead of 30 second. If you change your timelimit from 30 seconds to say 2 minutes, does it still not hang for you in B.M. mode?

What I do not understand is why timelimit does not work when code is inside DLL. Assuming for now that the hang happens inside this GMP DLL. does timelimit have no effect in this case because the code is inside dynamic linked library?

I can'f find definite answer or information on this now using google.

But there has to be a way to terminate a call, even if it is inside DLL which is faulty and hangs.

I am sure someone inside Maplesoft knows the answer for this and could comment and explain what is going on?

Also, I still go not understand why GMP was even used here for this simplify call, since everything is exact and symbolic.

@C_R 

         This time the system ran in optimized battery mode

Could you give instructions how to make Maple run in this mode? Never heard of this and googling does not show how to do it. Is this some option somewhere? I'd like to try it.

I run Maple now 2025 inside Linux which is installed inside virtual box.  

Or is this setting something done in the PC itself and not in Maple?  

I still do not understand what is going on. Why would running in "optimized battery" mode not make Maple hang on this call. Why would this make any difference in how Maple itself work?

@C_R 

great detective work. I assume this GMP is same as this https://gmplib.org/  The GNU
Multiple Precision Arithmetic Library

But why would simplify and Maple be using GMP here, since everything is symbolic and exact? 

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