nm

7210 Reputation

19 Badges

10 years, 200 days

MaplePrimes Activity


These are questions asked by nm

Encountered new exception using odetest which can't be cought. Is this new one? I do not have earlier version of Maple than 2022.2 to check. On windows 10.

btw, I could not update to latest Physics now, may be server problem.  Attached worksheet

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

Physics:-Version(latest)

Error, (in Physics:-Version) unable to determine the Physics Updates version, could you please report the problem to support@maplesoft.com

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1351. The version installed in this computer is 1348 created 2022, November 14, 15:59 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2022\Physics Updates\lib\`

restart;

 

sol:=y(x) = -LambertW(x/sin(x)*exp(c[1]/sin(x)))+c[1]/sin(x);
ode:=exp(y(x))+cos(x)*y(x)+(exp(y(x))*x+sin(x))*diff(y(x),x) = 0;
odetest(sol,ode)

y(x) = -LambertW(x*exp(c[1]/sin(x))/sin(x))+c[1]/sin(x)

exp(y(x))+cos(x)*y(x)+(exp(y(x))*x+sin(x))*(diff(y(x), x)) = 0

Error, (in tools/map) too many levels of recursion

try
sol:=y(x) = -LambertW(x/sin(x)*exp(c[1]/sin(x)))+c[1]/sin(x);
ode:=exp(y(x))+cos(x)*y(x)+(exp(y(x))*x+sin(x))*diff(y(x),x) = 0;
odetest(sol,ode);
catch:
   print("error in odetest");
end try;

y(x) = -LambertW(x*exp(c[1]/sin(x))/sin(x))+c[1]/sin(x)

exp(y(x))+cos(x)*y(x)+(exp(y(x))*x+sin(x))*(diff(y(x), x)) = 0

Error, (in tools/map) too many levels of recursion

 

Download problem_odetest_nov_20_2022.mw

I do not know what to do now, since if I can't catch the exception, the program can't run anymore and just stops.

I think I mentioned this before long time ago and never got any satisfactory answer. So I thought I will try again.

I never been able to figure why/how dsolve decides when to integrate the intermediate result vs. keeping the integral inert, even though it can integrate it.

It must use some rule internal to decide this, and this is what I am trying to find out.

Here is a very simple separable ode. So this is just really an integration problem.

restart;
ode:=diff(y(x),x)=(b*y(x)+sqrt(y(x)^2+b^2-1) )/(b^2-1);
dsolve(ode)

The first thing that comes to mind, is that Maple could not integrate it, that is why it gave inert integral. but it can integrate it but the result is a little long

int((b^2 - 1)/(b*y + sqrt(y^2 + b^2 - 1)),y)

So it could have generated the above implicit solution instead. Now notice what happens when I make very small change the ode.

restart;
ode:=diff(y(x),x)=(y(x)+sqrt(y(x)^2+b^2-1) )/(b^2-1);
dsolve(ode)

In the above I changed b*y to just y and guess what, now maple will integrate it and give an implicit solution instead of an inert integral

In both cases, Maple is able to do the integration. But in first case, it returned an inert integral and in the second it did not.

my question is why?  Does it have a rule where if the size of the integral is larger than some limit, it does not solve it? Did it say,

     "I think this result is too complicated to the user, so I will keep the integral inert instead"

If so, what are the rules it uses to decide when to do the integration and when to keep it inert? Is it based on leafcount? number of terms? something else?

infolevel does not give a hint on this, as all what it says is that it is separable.

Any one has an ideas on this?

This ode from textbook, and the solution is given in back of book and I verified it is correct.

odetest gives zero also when asked to verify the solution.

but when asked to verify both the solution and the initial conditions, instead of returning [0,0] as expected, it returns [the_ode,0]

Here is an example
 

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

restart

ode:=diff(y(x), x) = 2*(2*y(x) - x)/(x + y(x));
ic:=y(0) = 2;
booksol:=(x-y(x))^2/( y(x)-2*x)^3 = 1/2;

diff(y(x), x) = 2*(2*y(x)-x)/(x+y(x))

y(0) = 2

(x-y(x))^2/(y(x)-2*x)^3 = 1/2

#this returns zero, so maple agree the book solution is correct
odetest(booksol,ode)

0

#when adding ic, when does it not give [0,0] ?
odetest(booksol,[ode,ic])

[diff(y(x), x)-2*(2*y(x)-x)/(x+y(x)), 0]

 


How shoulld one interpret the above answer?

Download question_on_odetest_nov_14_2022.mw

The following example shows clearly that timelimit is still broken in Maple.

I tried this 10 times, and it hangs each time. I could wait 30 minutes and it still hangs. timelimit simply does not work. I set timelimit to 20 or 30 seconds.  This really makes developing software in Maple very difficult when timelimit itself hangs as it means the whole program comes to halt and becomes frozen and I see no workaround this problem.

 

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

restart;

ode:=1/2*sqrt((diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)^2 + 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + b^2/a^2)/a - 1/2*b^2*ln((2*b^2/a^2 + 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + 2*sqrt(b^2/a^2)*sqrt((diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)^2 + 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + b^2/a^2))/(diff(y(x), x) - sqrt(-a^2*(a - b)*(a + b))/a^2))/(a^3*sqrt(b^2/a^2)) + 1/2*sqrt((diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)^2 - 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + b^2/a^2)/a - 1/2*b^2*ln((2*b^2/a^2 - 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + 2*sqrt(b^2/a^2)*sqrt((diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)^2 - 2*sqrt(-a^2*(a - b)*(a + b))*(diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2)/a^2 + b^2/a^2))/(diff(y(x), x) + sqrt(-a^2*(a - b)*(a + b))/a^2))/(a^3*sqrt(b^2/a^2)) - 1/2*b*ln(a^2*diff(y(x), x)^2 + a^2 - b^2)/a^2 - y(x) - _C1 = 0:

try
  print("Before calling timelimt on odeadvisor");
  timelimit(20,DEtools:-odeadvisor(ode,y(x)));
  print("Did not time out");
catch:
  print("TIMED OUT");
end try;

"Before calling timelimt on odeadvisor"

 


 

Does this hang on your version of Maple? I am using 2022.2 on windows 10.

I was hoping this problem with timelimit has finally been fixed in Maple 2022.2. From this post almost 2 years ago!  it says

"You will also be pleased to know that Maple 2021 addresses the timelimit() issue that you mentioned."

But it is clearly not yet fixed.

 

Some important observations

1) sometimes I noticed if timelimit is small (say 5 or 10), it does not hang. So it the above does timeout for you, please try with larger time out, say 40 or 60 seconds. Since it depens on how fast the PC is.

2)sometimes I  noticed if I close Maple and start new sesstion, the very first time it could timeout OK, but the second time it is called, it hangs. May be because the server caches something to cause this.

All this means, it is completely not predictable what wil happen when starting the maple run. I have no idea how long it will take from one time to another, or even if it will hang or not. For all the years I used Maple, I never had one single time where one run completed without having to restart it at least 2 or 3 times in order to reach the finish line.  This is in addition to all those server.exe crashing on its own many times in between. I noticed more and more of these in Maple 2022.2.  But that is for another topic.

The following screen shot showing one instance when I run the above timelimit (been wainting now for 15 minutes, using timeout of 30 second)., It shows Maple server taking 81% of the CPU

 

And the following is screen shot of the worksheet itself when I took the above screen shot

 

Download timelimit_hangs_on_odeadvisor.mw

 

 

I was trying New-Display-Of-Arbitrary-Constants-And-Functions- but found a small problem.

in my code I build the constants of integrations using parse("_C"||N); where N is an integer that can go up to as many constants of integration are needed. For example, for 4th order ode, there will be 4 of them.

I noticed only the first 2 come out using the nice c__1,c__2 notation, but anything after 2 ,they come out using old notation _C3, _C4.

Here is a MWE

restart;

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1346 and is the same as the version installed in this computer, created 2022, October 7, 13:4 hours Pacific Time.`

restart;

dsolve(diff(y(x),x)=1,arbitraryconstants=subscripted);
pdsolve(diff(psi(x,t),x$2)=0,arbitraryfunctions=subscripted);

y(x) = x+c__1

psi(x, t) = f__1(t)*x+f__2(t)

_C1

c__1

for N from 1 to 4 do
    parse("_C"||N);
od;

c__1

c__2

_C3

_C4

 


So now my solution comes out with mixed looking constants. Why does this happen for N>2?

Download problem_with_C.mw

So for now, I went back to using the old method of using alias as follows

restart;

alias(seq(c[k] = _C||k, k = 0..10)):

_C1

c[1]

for N from 1 to 4 do
    parse("_C"||N);
od;

c[1]

c[2]

c[3]

c[4]

 

Download problem_with_C_alias.mw

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