nm

11353 Reputation

20 Badges

13 years, 12 days

MaplePrimes Activity


These are questions asked by nm

Maple dsolve fails to find many singular solutions using the option 'singsol'=all.

Any idea why that is? Here is one example

ode:=diff(y(x),x)=(y(x)-3)^2;
dsolve(ode,y(x),'singsol'=all)

It returns 

But we see that y=3 is singular solution which can't be obtained from the above solution for any value of c1

Mathematica finds this singular solution

ode=y'[x]==(y[x]-3)^2
DSolve[ode,y[x],x,IncludeSingularSolutions->True]

Here is second example.

restart;
ode:=diff(y(x),x)=2*x*sqrt(1-y(x)^2);
dsolve(ode,y(x),'singsol'=all)

Gives

But it misses the y=1,y=-1 singular solutions. 

Is there something I am doing wrong? Why does Maple sometimes fail to find singular solutions?

ps. reported to Mapesoft also.

Update

I remembered now a case similar to this. one has to use `Lie` solver and now Maple gives the singular solution

ode:=diff(y(x),x)=(y(x)-3)^2;
dsolve(ode,Lie,'singsol'=all)

There is no mention of this in help and it is still not clear to me if one has to always use Lie solver to obtain singsol or if this is just a coincidence for this one case.  

Same for the other case:

restart;
ode:=diff(y(x),x)=2*x*sqrt(1-y(x)^2);
dsolve(ode,'Lie','singsol'=all)

gives

I think singsol should work all the time and not only when using specific solver. If Lie solver is needed for singsol to work, then help should be clear and say this.

Could someone be able to spot why I get different solution when solving for the constant of integration from this Maple dsolve solution manually than when asking Maple to do it directly?

This is the ode 

ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1);
ic:=y(1) = 1;

If I ask Maple to solve it with the IC all at once, it gives solution which odetest verifies OK.

If I ask Maple to solve it with no IC, then solve the constant myself and plug the constant back into the solution I get solution which does not verify any more.

I am not able to find why. Could someone spot the error in this? Please see worksheet below. I suspect the problem is when plugging back the constant of integration into the general solution, but have no idea now what it is. Clearly Maple did something much smarter than what I did by just plugging the constant back into the solution. May be need to specify what branch to use when plugging the constant back? but how do I know which one?
 

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1730 and is the same as the version installed in this computer, created 2024, April 17, 19:33 hours Pacific Time.`

ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1);
ic:=y(1) = 1;
sol_no_IC:=dsolve(ode);
 

x*y(x)*(diff(y(x), x)) = (x+1)*(y(x)+1)

y(1) = 1

y(x) = -LambertW(-exp(-x-1)/(x*c__1))-1

sol_with_IC_direct:=dsolve([ode,ic]);
odetest(sol_with_IC_direct,[ode,ic]);

y(x) = -LambertW(-1, -2*exp(-x-1)/x)-1

[0, 0]

#this verifies Maple found correct constant also:

solve(rhs(sol_with_IC_direct)=rhs(sol_no_IC),c__1)

1/2

#now solve for constant of integration manually. This gives invalid solution. Why?

eq:= 1=limit(rhs(sol_no_IC),x=1);

1 = -LambertW(-exp(-2)/c__1)-1

PDEtools:-Solve(eq,c__1);

c__1 = 1/2

sol_with_ic:=eval(sol_no_IC,%)

y(x) = -LambertW(-2*exp(-x-1)/x)-1

odetest(sol_with_ic,[ode,ic]);

[0, 2+LambertW(-2*exp(-2))]

 

 

Download why_wrong_solution.mw

Is it wrong to call limit like this

limit(expr,[y = y0,x=x0]);

vs

limit(expr,y = y0);
limit(%,x=x0);

The first one gives internal Maple error.  Worksheet attached. I would have expected both to work the same.

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1727 and is the same as the version installed in this computer, created 2024, April 17, 19:33 hours Pacific Time.`

kernelopts('assertlevel'=2):

expr:=3/2*(y-1)^(2/3)-3/2*x^2-c__1 = 0;
y0:=-7;
x0:=3;
limit(expr,[y = y0,x=x0]);
 

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

-7

3

Error, (in limit/multi/ldegree1) assertion failed

expr:=3/2*(y-1)^(2/3)-3/2*x^2-c__1 = 0;
y0:=-7;
x0:=3;
limit(expr,y = y0);
limit(%,x=x0);

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

-7

3

-3+(3*I)*3^(1/2)-(3/2)*x^2-c__1 = 0

-33/2+(3*I)*3^(1/2)-c__1 = 0

 

 

Download limit_internal_error_maple_2024.mw

I still see these Maple internal errors in Maple 2024.

Now calling odetest.

The problem is that it is not possible to catch them.

Any suggestion what to do and what causes it?

11196

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1727 and is the same as the version installed in this computer, created 2024, April 17, 19:33 hours Pacific Time.`

sol:=y(x) = (exp(RootOf(-sin(x)*tanh(1/2*_Z+1/2*c__1)^2+sin(x)+exp(_Z)))+sin(x))/sin(x);
ode:=diff(y(x),x)-cot(x)*(y(x)^(1/2)-y(x)) = 0;

y(x) = (exp(RootOf(-sin(x)*tanh((1/2)*_Z+(1/2)*c__1)^2+sin(x)+exp(_Z)))+sin(x))/sin(x)

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

try
   odetest(sol,ode,y(x));
catch:
   print("cought error ");
end try;

Error, (in anonymous procedure called from depends) too many levels of recursion

 

 

Download too_many_levels_of_recursion_calling_odetest_maple_2024.mw

I think I found another clitch in odetest.

dsolve gives correct solution to this first order ode with IC. But odetest does not verify that the solution is satisfied for the IC part, but only for the ode itself. 

Below worksheet confirms the solution is also valid for the IC.   So why odetest does not give 0 for the IC part?

``

restart;

19644

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1727. The version installed in this computer is 1725 created 2024, April 15, 17:29 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

libname;

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

ode:=x^2*diff(y(x),x)*cos(y(x))+1=0;
ic:=y(infinity)=Pi/3; #16/3*Pi;
sol:=dsolve([ode,ic]);
odetest(sol,[ode,ic])

x^2*(diff(y(x), x))*cos(y(x))+1 = 0

y(infinity) = (1/3)*Pi

y(x) = arcsin((1/2)*(3^(1/2)*x+2)/x)

[0, (1/3)*Pi]

#we see that odetest think the solution does not verify the IC. But it does

IC_eq:=Pi/3=limit(rhs(sol),x=infinity)

(1/3)*Pi = (1/3)*Pi

Download odetest_does_not_verfiy_correct_solution_maple_2024_april_18_2024.mw

I think what odetest did is not use limit when plugging in the values. That is why.

If we do not use limit, this is what happens:

IC_eq:=Pi/3=eval(rhs(sol),x=infinity)

And this explains the odetest output. It should have used limit.

ps. just in case also reported to Maplesoft support.

First 32 33 34 35 36 37 38 Last Page 34 of 199