nm

11788 Reputation

20 Badges

13 years, 164 days

MaplePrimes Activity


These are questions asked by nm

I do not remember now if this came up before or not. But this has been a problem in Maple for years.

when doing infolevel[dsolve]:=5 and call dsolve(), some of the display on the screen is missing commas and multiplication sign and who know what else. Since it is all replace by space.

This happens only to part of the display. Here is an example (must use restart each time to see the full display)

restart;
ode:=diff(y(x),x) = (-y(x)^2+4*a*x)^2/y(x); 
infolevel[dsolve]:=5;
dsolve(ode);

Here is the output. Using worksheet, V 2025.2 on windows 10 (I am only showing part of the output which has the problem)

Looking at the line where is says "-> Calling odsolve ". Notice the rest. diff(diff(y(x) x) x)  should be diff(diff(y(x),x),x)  and the end of the line has diff(y(x) x)) y(x)  . So one can guess this should be  diff(y(x),x))*y(x) or it could be diff(y(x),x))/y(x) or may be something else.

THis cause a problem when trying to copy it and use it to try it.

Is there something one can do  in settings to fix this part of the display? so nothing is replace by space?

Maple 2025.2 on windows 10

I also tried this in document mode instead of worksheet. Same result. 

Update

Found where this comes from. From `odsolve/2` proc, line 21.

THis is how to see it.

restart;

infolevel[dsolve]:=5;
ode:=diff(y(x),x)=x*y(x)+1/y(x)+y(x)^3;
stopat(`odsolve/2`);
dsolve(ode)

 

Now the debugger will come up. Then do in the debugger:

stopat 21

Click continue, you will now stop at this line

In the worksheet it now shows as

So something in 

 `ODEtools/userinfo`(2,dsolve,`-> Calling odsolve with the ODE`,A);

Is not right. Also the last y(x) was meant to be second item in A which is expression sequence. But in worksheet it all display on one line with no commas between.,

So better formating in ODEtools/useinfo is needed here. For some reason, commas are all replaced by spaces.

 

 

Is it possible to obtain integral of sqrt(1+sin(x)^2) in Maple as known result of elliptic integral of the second kind  E(x,-1) ?

Maple 2025 gives

integrand:=sqrt(1+sin(x)^2);
anti:=int(integrand,x);
anti:=simplify(anti);

Not able to differentiate back:

diff(anti,x);
simplify(%)

Google says:

And the above is also what Mathematica gives

Is it possible to obtain E(x,-1) also in Maple for this integral?

Maple 2025.2

Not able to make an example, since it depends of code flow and not able to reproduce it in small code. I spend hrs trying to make one. It depends on how memory is arranged and this problem shows only when running my large program.

But I can show screen shots from a debugging session showing clearly the problem, and the solution I found.

Maple was giving this result, when calling simplify to simplify a matrix:

Notice what happend. There was a matrix [3/2,-1,-3/2,0],[0,0,0,0],[-2,2,2,0]] before that was simplfied.

Next iteration called simplify on modified version of the matrix, which is  [3/2,-1,-3/2,0],[0,0,0,0],[0,2/3,0,0]].  (called e in the above).

But simplify returned as result the old copy. Which is completely wrong.

It simplified  [3/2,-1,-3/2,0],[0,0,0,0],[0,2/3,0,0]]  to  [3/2,-1,-3/2,0],[0,0,0,0],[-2,2,2,0]]  !

Now see what happes when calling forget(simplify)

You see, now it simplfies it correctly. (there is actually nothing to simplify, so it returned back same matrix as expected, and no copy it had in memory).

So now I went over all my code, and everywhere it calls simplify, added 

     forget(simplify)

right after each call.

Problem fixed.

May be someone can shed a light on why this happens. Any information needed will try to provide. I can reproduce this each time but using the debugger.

restart;

ode:=diff(y(x),x) = 3*(y(x)*x)^(1/2); 
IC:=y(0)=2;
sol:=dsolve([ode,IC])

This is a good example of how Maple result looks different depending on what calls to Maple were made before.

I can't upload worksheet so have to show code and screen shot. Compare the screen shot below. Maple 2025.2. Same exact input., In first example the polynomial terms display in different order compared to the second example, even though the same exact input is used.

Clearly the first example is because Maple remembered this polynomial in its remember table somewhere before due to earlier call, and did not want to make new copy since it is same polynomial?

But I do want to make new polynomial. The old copy/order this polynomial in Maple internal tables is getting in the way.

But do not know how to tell Maple to clear its cache so I get same display as in the second example. I know both answers is the same. But the issue is why it displays different.

How could I get same output from first example as in the second one? What do I need to clear? I tried forget(Student:-Precalculus:-CompleteSquare) but this had no effect. ALso tried forget(all); also forget(all,forgetpermanent = true,reinitialize=true); also forget(Student:-Precalculus:-CompleteSquare,subfunctions=true);

code

restart;

eq := x^2 + y^2 + z^2 - 2*x + 8*y - 6*z - 30 = 0:
eq:=Student:-Precalculus:-CompleteSquare(eq):
e1:=convert(indets(%,`^`),list):
e2:=zip((a,b)->a=b,e1,[X,Y,Z]):
e3:=sort(eval(eq,e2));
e4:=map(X->rhs(X)=lhs(X),e2);
eval(e3,e4);

restart;

e3 := X + Y + Z - 56 = 0;
e4 := [X = (x - 1)^2, Y = (y + 4)^2, Z = (z - 3)^2];
eval(e3,e4);

[moderator: duplicate of this earlier question]

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