nm

11353 Reputation

20 Badges

13 years, 12 days

MaplePrimes Activity


These are questions asked by nm

Does this also hang in earlier versions of Maple?

In Maple 2024.1, when adding general   IC such as  y(x0)=y0, then dsolve hangs. 

This is first order ode of type exact. Maple sees that, enters exact solver and never comes back.

Removing the IC, it works and gives correct solution. Also changing the IC to specific one, such as y(0)=1 it works. Only when making the IC general, it hangs.

Any idea why it hangs when adding IC and where it hangs? I waited for 10-15 minutes and tried few times. Server.exe is running at full CPU all the time. looks like it went into an infinite loop. 
 

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1789 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

libname;

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

restart;

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

diff(y(x), x) = ((x^2-1)*(y(x)^2-1))^(1/2)/(x^2-1)

IC:=y(x0)=y0;

y(x0) = y0

infolevel[dsolve]:=5;

5

dsolve(ode,[exact])

Classification methods on request

Methods to be used are: [exact]

----------------------------

* Tackling ODE using method: exact

--- Trying classification methods ---

trying exact

<- exact successful

((y(x)-1)*(y(x)+1))^(1/2)*ln(y(x)+(y(x)^2-1)^(1/2))/((y(x)-1)^(1/2)*(y(x)+1)^(1/2))+Intat(-((_a^2-1)*(y(x)^2-1))^(1/2)/((_a^2-1)*(y(x)-1)^(1/2)*(y(x)+1)^(1/2)), _a = x)+c__1 = 0

dsolve([ode,IC],[exact]); #this hangs

Classification methods on request

Methods to be used are: [exact]

----------------------------

* Tackling ODE using method: exact

--- Trying classification methods ---

trying exact

<- exact successful

dsolve([ode,IC]); #this hangs

 -> Computing symmetries using: way = 3

Methods for first order ODEs:

--- Trying classification methods ---

trying homogeneous types:

differential order: 1; looking for linear symmetries

trying exact

<- exact successful

 


 

Download maple_hangs_on_first_order_ode.mw

Update

If we solve the ODE first with no IC, and then manually solve for C and plug this back into the Maple solution then it works and Maple odetest verifies the solution. So no need for assuming x0>1 ?

restart;

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

diff(y(x), x) = ((x^2-1)*(y(x)^2-1))^(1/2)/(x^2-1)

IC:=y(x__0)=y__0;

y(x__0) = y__0

#solve for C directly

maple_sol_no_IC:=dsolve(ode,[exact]);
eq:=eval(maple_sol_no_IC,[y(x)=y__0,x=x__0]);
sol_C:=solve(eq,_C1);

((y(x)-1)*(y(x)+1))^(1/2)*ln(y(x)+(y(x)^2-1)^(1/2))/((y(x)-1)^(1/2)*(y(x)+1)^(1/2))+Intat(-((_a^2-1)*(y(x)^2-1))^(1/2)/((_a^2-1)*(y(x)-1)^(1/2)*(y(x)+1)^(1/2)), _a = x)+c__1 = 0

((y__0-1)*(y__0+1))^(1/2)*ln(y__0+(y__0^2-1)^(1/2))/((y__0-1)^(1/2)*(y__0+1)^(1/2))+Intat(-((_a^2-1)*(y__0^2-1))^(1/2)/((_a^2-1)*(y__0-1)^(1/2)*(y__0+1)^(1/2)), _a = x__0)+c__1 = 0

-(Intat(-((_a^2-1)*(y__0^2-1))^(1/2)/((_a^2-1)*(y__0-1)^(1/2)*(y__0+1)^(1/2)), _a = x__0)*(y__0-1)^(1/2)*(y__0+1)^(1/2)+((y__0-1)*(y__0+1))^(1/2)*ln(y__0+(y__0^2-1)^(1/2)))/((y__0-1)^(1/2)*(y__0+1)^(1/2))

new_sol:=simplify(eval(maple_sol_no_IC,_C1=sol_C));

(y(x)^2-1)^(1/2)*ln(y(x)+(y(x)^2-1)^(1/2))/((y(x)-1)^(1/2)*(y(x)+1)^(1/2))-Intat(((_a^2-1)*(y(x)^2-1))^(1/2)/(_a^2-1), _a = x)/((y(x)-1)^(1/2)*(y(x)+1)^(1/2))+(-(y__0^2-1)^(1/2)*ln(y__0+(y__0^2-1)^(1/2))+Intat(((_a^2-1)*(y__0^2-1))^(1/2)/(_a^2-1), _a = x__0))/((y__0-1)^(1/2)*(y__0+1)^(1/2)) = 0

odetest(new_sol,[ode,IC])

[0, 0]

 


 

Download maple_hangs_on_first_order_ode_V2.mw

I found a case where PDEtools:-Solve fail and solve works. I do not understand why. 

Is this a bug or what is going on? I thought they should give same result.


 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1787 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

libname;

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

restart;

eqs:=[-2*arctanh((_C1-1)^(1/2)/_C1^(1/2)) = _C2, 0 = _C1^(3/2)*tanh(1/2*_C2)*sech(1/2*_C2)^2];
unknowns:={_C1,_C2};

[-2*arctanh((_C1-1)^(1/2)/_C1^(1/2)) = _C2, 0 = _C1^(3/2)*tanh((1/2)*_C2)*sech((1/2)*_C2)^2]

{_C1, _C2}

sol1:=solve(eqs,unknowns);

{_C1 = 1, _C2 = 0}

sol2:=PDEtools:-Solve(eqs,unknowns);

 


 

Download why_PDEtools_Solve_fail_august_14_2024.mw

 

I am very confused about this result. 

I call the result of odetest the residual. Which should be zero or simplifies to zero if dsolve solution is correct.

Now, if I do     odetest(solution,ode), I get residual which simplifies to zero. OK. But doing odetest(solution,[ode,IC]) now gives output for the ode residual (first entry) completely different than the first case and which can't be simplified to zero any more. 

odetest also says the solution satisfies the IC, since the second entry of the residual is zero.     

So we have case where the solution satisfies the ODE itself and also satisfies the IC. But when calling odetest with both the ode and the IC, now it says the solution does not satisfiy the ode.

How could this be? What Am I overlooking here? Should not the ode residual remain the same in both calls?

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1787 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

restart;

ode:=diff(y(x), x, x) = sqrt(1 + diff(y(x), x)^2);

diff(diff(y(x), x), x) = (1+(diff(y(x), x))^2)^(1/2)

IC:=y(0)=1;

y(0) = 1

sol:=[dsolve([ode,IC])][-1]; #just interested in last solution now

 

y(x) = cosh(x+c__1)+1-cosh(c__1)

residual:=odetest(sol,ode)

cosh(x+c__1)-(1/2+(1/2)*cosh(2*x+2*c__1))^(1/2)

simplify(residual) assuming positive;

0

#Why now the residual changes on the ode??
residual:=odetest(sol,[ode,IC])

[cosh(c__1)*cosh(x)+sinh(c__1)*sinh(x)-(1+sinh(x)^2*cosh(c__1)^2+2*sinh(x)*cosh(c__1)*cosh(x)*sinh(c__1)+cosh(x)^2*sinh(c__1)^2)^(1/2), 0]

#no longer simplifes to zero.
map(X->(simplify(X) assuming positive),residual)

[cosh(c__1)*cosh(x)+sinh(c__1)*sinh(x)-(1+sinh(x)^2*cosh(c__1)^2+2*sinh(x)*cosh(c__1)*cosh(x)*sinh(c__1)+cosh(x)^2*sinh(c__1)^2)^(1/2), 0]

 

 

Download odetest_problem_august_14_2024.mw

I noticed sometimes Maple dsolve solves an ode using a method different than what odeadvisor says it is.

In this example ode, advisor said it is separable. But when solving it, dsolve actually solved it as dAlembert.

Why is that? Should not these be the same?

I also noticed Maple does not verify the solution of the ode when asked to solve it as separable, which is what the advisor says. But it does verify the solution using dAlembert.

So in this example, should not advisor have said this ode is dAlembert and not separable then?

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1786 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

ode:=y(x) = x + 3*ln(diff(y(x), x));
DEtools:-odeadvisor(ode);

y(x) = x+3*ln(diff(y(x), x))

[_separable]

infolevel[dsolve]:=5:
sol_1:=dsolve(ode);

Methods for first order ODEs:

-> Solving 1st order ODE of high degree, 1st attempt

trying 1st order WeierstrassP solution for high degree ODE

trying 1st order WeierstrassPPrime solution for high degree ODE

trying 1st order JacobiSN solution for high degree ODE

trying 1st order ODE linearizable_by_differentiation

trying differential order: 1; missing variables

trying d'Alembert

<- d'Alembert successful

y(x) = x, y(x) = x+3*ln(exp(-(1/3)*x)*c__1/(-1+exp(-(1/3)*x)*c__1))

map(X->odetest(X,ode),[sol_1]);

[0, 0]

sol_2:=dsolve(ode,[separable]);

Classification methods on request

Methods to be used are: [separable]

----------------------------

* Tackling ODE using method: separable

--- Trying classification methods ---

trying separable

<- separable successful

y(x) = -3*ln(exp(-(1/3)*x)-(1/3)*c__1)

#notice, solution does not verify.
odetest(sol_2,ode);

-3*ln(3*exp(-(1/3)*x)-c__1)-x-3*ln(exp(-(1/3)*x)/(3*exp(-(1/3)*x)-c__1))

 

 

Download why_different_method_used_august_13_2024.mw

How to get Li(x) to display as result of int(1/ln(x),x) in Maple instead of -Ei(1,-ln(x))

I'd like to match result of Maple with another software I use and it is also simpler to look at

int(1/ln(x),x)

Now gives

             -Ei(1,-ln(x))

How to make it show  Li(x) instead?

The Maple help page for Li is this

And the other software Li help page is this

I tried simplify in Maple but it does not do anything. How to get Li(x) in Maple for int(1/ln(x),x);  instead of -Ei(1, -ln(y)) ?

Note that 

diff(Li(x),x)

Gives 1/ln(x) so Li(x) is the correct antiderivative.

Here is also the wiki page

I know that Maple's result is correct, I am just asking about the form it is shown. Since Maple has Li(x) function, why not use it for this result?

 

Maple 2024.1

First 20 21 22 23 24 25 26 Last Page 22 of 199