nm

8799 Reputation

19 Badges

11 years, 318 days

MaplePrimes Activity


These are questions asked by nm

Given the ode   y''(x)*y'(x)=0, clearly it has solutions for y''=0 and y'=0.

These are y=c1+x*c2 and y=c1. But Maple gives 3 solutions

12592

interface(version);

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

ode:=diff(y(x),x$2)*diff(y(x),x)=0;

(diff(diff(y(x), x), x))*(diff(y(x), x)) = 0

dsolve(ode)

y(x) = c__1, y(x) = -c__1*x+c__2, y(x) = c__1*x+c__2

dsolve(diff(y(x),x$2)=0)

y(x) = c__1*x+c__2

dsolve(diff(y(x),x)=0)

y(x) = c__1

 

 

Download why_3_solutions_may_24_2024.mw

Where did the third solution come from? The 3 solutions are correct ofcourse, but why 3? There should only be two. 

FYI, I am using 

Physics:-Version()

The "Physics Updates" version in the MapleCloud is 1746. The 

   version installed in this computer is 1745 created 2024, May 

I have to check earlier Maple versions to see if same thing happens there.

This ode can be solved by just looking at it

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

We see the solution is y=-x and y=c__1 because either (x+y)=0 or y'=0

But for some reason ODESteps(ode) says it cannot compute integral.

Any idea why?


 

26348

interface(version);

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

ode:=(x+y(x))*diff(y(x),x)=0;
Student:-ODEs:-ODESteps(ode);

ode := (x+y(x))*(diff(y(x), x)) = 0

"[[,,"Let's solve"],[,,(x+y(x)) ((ⅆ)/(ⅆx) y(x))=0],["•",,"Highest derivative means the order of the ODE is" 1],[,,(ⅆ)/(ⅆx) y(x)],["•",,"Integrate both sides with respect to" x],[,,∫(x+y(x)) ((ⅆ)/(ⅆx) y(x)) ⅆx=∫0 ⅆx+`c__1`],["•",,"Cannot compute integral"],[,,∫(x+y(x)) ((ⅆ)/(ⅆx) y(x)) ⅆx=`c__1`]]"

 


 

Download odestep_quadrature_unable_to_solve_maple_2024.mw

update:

Here is another simpler example that also confused it
 

26348

interface(version);

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

ode:=x*diff(y(x),x)=0;
Student:-ODEs:-ODESteps(ode);

ode := x*(diff(y(x), x)) = 0

"[[,,"Let's solve"],[,,x ((ⅆ)/(ⅆx) y(x))=0],["•",,"Highest derivative means the order of the ODE is" 1],[,,(ⅆ)/(ⅆx) y(x)],["•",,"Integrate both sides with respect to" x],[,,∫x ((ⅆ)/(ⅆx) y(x)) ⅆx=∫0 ⅆx+`c__1`],["•",,"Cannot compute integral"],[,,∫x ((ⅆ)/(ⅆx) y(x)) ⅆx=`c__1`]]"

 

 


 

Download odestep_quadrature_unable_to_solve_v2_maple_2024.mw

update

Here is another one which it gets wrong. 
 

26348

interface(version);

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

ode:=y(x)*diff(y(x),x)=0;
Student:-ODEs:-ODESteps(ode);

ode := y(x)*(diff(y(x), x)) = 0

"[[,,"Let's solve"],[,,y(x) ((ⅆ)/(ⅆx) y(x))=0],["•",,"Highest derivative means the order of the ODE is" 1],[,,(ⅆ)/(ⅆx) y(x)],["•",,"Integrate both sides with respect to" x],[,,∫y(x) ((ⅆ)/(ⅆx) y(x)) ⅆx=∫0 ⅆx+`c__1`],["•",,"Evaluate integral"],[,,((y(x))^2)/2=`c__1`],["•",,"Solve for" y(x)],[,,{y(x)=sqrt(2) sqrt(`c__1`),y(x)=-sqrt(2) sqrt(`c__1`)}]]"

dsolve(ode);

y(x) = 0, y(x) = -c__1

 


The correct solution is given by dsolve, which is y=0 and y=constant (I do not know why dsolve put minus sign in front of the constant, but it is still correct).

Download odestep_quadrature_unable_to_solve_v3_maple_2024.mw

 

 

I can't understand this behavior. Any idea why it happens?

Solve is able to solve equation   f(y)=x+A for y, but can't solve   f(y)=x for y.

This is unexpected for me. I do not see why it can solve it when RHS is x+A but not when RHS is just x.


 

21040

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 1745. The version installed in this computer is 1744 created 2024, April 17, 19:33 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib\`

restart;

21040

sol:=int(1/sqrt(sin(y)),y);
solve(sol=x,y)

(sin(y)+1)^(1/2)*(-2*sin(y)+2)^(1/2)*(-sin(y))^(1/2)*EllipticF((sin(y)+1)^(1/2), (1/2)*2^(1/2))/(cos(y)*sin(y)^(1/2))

Warning, solutions may have been lost

sol:=int(1/sqrt(sin(y)),y);
solve(sol=x+b,y):
{%}; #to eliminate duplicates

(sin(y)+1)^(1/2)*(-2*sin(y)+2)^(1/2)*(-sin(y))^(1/2)*EllipticF((sin(y)+1)^(1/2), (1/2)*2^(1/2))/(cos(y)*sin(y)^(1/2))

{arctan(JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2-1, -(1/2)*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))*(4-2*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2)^(1/2)*2^(1/2)), arctan(JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2-1, (1/2)*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))*(4-2*JacobiSN(((1/2)*I)*2^(1/2)*(x+b), (1/2)*2^(1/2))^2)^(1/2)*2^(1/2))}

 


I can trick it to solve  f(y)=x for y  by asking it to solve f(y)=x+A for y and then set A=0 in the solution. But one should not have to do this. Is this a bug or Am I missing something?

Download why_solve_when_adding_term_only_may_22_2024.mw

Could someone help me understand why Maple hangs solving these two equations when the names of unknowns is c__1,c__2   or the old _C1, _C2?

This worksheets shows this. I had to put timelimit of 90 seconds, else it hangs may be forever.    

This example came from looking at why Maple seems to hang randomly when I run the same problem. I still do not know why, but is seems to have something to do with the use of  lower case c__1 or _C1. 

16020

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 1744 and is the same as the version installed in this computer, created 2024, April 17, 19:33 hours Pacific Time.`

restart;

dsolve(diff(y(x),x$9)=1,arbitraryconstants=subscripted);

y(x) = (1/362880)*x^9+(1/40320)*c__1*x^8+(1/5040)*c__2*x^7+(1/720)*c__3*x^6+(1/120)*c__4*x^5+(1/24)*c__5*x^4+(1/6)*c__6*x^3+(1/2)*c__7*x^2+c__8*x+c__9

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*c__1)*sqrt(2)/sqrt(c__1))*sqrt(2)/sqrt(c__1) = c__2, 1 = (-exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)*sqrt(c__1)*sqrt(2)/(exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)];
unknowns:=[c__1,c__2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*c__1)^(1/2)*2^(1/2)/c__1^(1/2))*2^(1/2)/c__1^(1/2) = c__2, 1 = (-exp(2*c__2*c__1^(1/2)*2^(1/2))+1)*c__1^(1/2)*2^(1/2)/(exp(2*c__2*c__1^(1/2)*2^(1/2))+1)]

[c__1, c__2]

.609

Error, (in evalf/hypergeom) time expired

106.125

restart; #try again but do not do the arbitraryconstants=subscripted now.

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*c__1)*sqrt(2)/sqrt(c__1))*sqrt(2)/sqrt(c__1) = c__2, 1 = (-exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)*sqrt(c__1)*sqrt(2)/(exp(2*c__2*sqrt(c__1)*sqrt(2)) + 1)];
unknowns:=[c__1,c__2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*c__1)^(1/2)*2^(1/2)/c__1^(1/2))*2^(1/2)/c__1^(1/2) = c__2, 1 = (-exp(2*c__2*c__1^(1/2)*2^(1/2))+1)*c__1^(1/2)*2^(1/2)/(exp(2*c__2*c__1^(1/2)*2^(1/2))+1)]

[c__1, c__2]

106.234

[[]]

106.390

#see? it finisghed instantly now.


Download why_solve_hangs_with_subscripted_may_15_2024.mw

The same thing happens If I use the old _C1 and _C2 instead of c__1 and c__2. It also hangs. 

The following worksheet shows this.  If I change _C1 and _C2 to other symbols, say C1 and C2, then it does not hang. 

Why the names of the unknowns makes difference to solve?
 

18792

restart;

18792

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*_C1)*sqrt(2)/sqrt(_C1))*sqrt(2)/sqrt(_C1) = _C2, 1 = (-exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)*sqrt(_C1)*sqrt(2)/(exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)];
unknowns:=[_C1,_C2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*_C1)^(1/2)*2^(1/2)/_C1^(1/2))*2^(1/2)/_C1^(1/2) = _C2, 1 = (-exp(2*_C2*_C1^(1/2)*2^(1/2))+1)*_C1^(1/2)*2^(1/2)/(exp(2*_C2*_C1^(1/2)*2^(1/2))+1)]

[_C1, _C2]

.125

Error, (in evalf/cos) time expired

105.218

restart;

18792

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*C1)*sqrt(2)/sqrt(C1))*sqrt(2)/sqrt(C1) = C2, 1 = (-exp(2*C2*sqrt(C1)*sqrt(2)) + 1)*sqrt(C1)*sqrt(2)/(exp(2*C2*sqrt(C1)*sqrt(2)) + 1)];
unknowns:=[C1,C2];
time();
C_sol:=[timelimit(90,solve(eqs,unknowns))];
time()

[-(1/2)*arctanh((1/2)*(1+2*C1)^(1/2)*2^(1/2)/C1^(1/2))*2^(1/2)/C1^(1/2) = C2, 1 = (-exp(2*C2*C1^(1/2)*2^(1/2))+1)*C1^(1/2)*2^(1/2)/(exp(2*C2*C1^(1/2)*2^(1/2))+1)]

[C1, C2]

105.312

[[]]

105.468

 

 

Download why_solve_hangs_with_OLD_C_also_may_15_2024.mw

Only thing I see in help related to name of symbols to solve for is this:

The solve command solves one or more equations or inequalities for the specified unknowns. The unknowns may be names, including indexed names (though for efficiency reasons, indexed names should be avoided when possible), 

ps. This looks like a bug to me. So I send bug report to Maplesoft support also.

 

pps. I tried this in Maple 2023 and Maple 2022 and same behavior. Could someone with earlier version of Maple try to see if this behavior was there also?   It can possibly be correct that the choice of letter used makes difference for solving equations. I have to use c__1 and c__2 etc.. since these equations come from differential equations and this is what I use for constants of integrations., Otherwise I have to make lots of changes now to use different letters.

Update

did trace on solve using _C1 and _C2 and then using A,B for variables to solve for. Code flow is different. This expalins why it hangs. The flow starts the same until it gets to 

TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order

Then when using _C1 and _C2 the code goes into different path than when using A,B. 

Here is flow when using _C1,_C2.

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*_C1)*sqrt(2)/sqrt(_C1))*sqrt(2)/sqrt(_C1) = _C2, 1 = (-exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)*sqrt(_C1)*sqrt(2)/(exp(2*_C2*sqrt(_C1)*sqrt(2)) + 1)];
unknowns:={_C1,_C2};
time();
infolevel[solve]:=5;
C_sol:=[timelimit(60,solve(eqs,unknowns))]; 
time()


Main: Entering solver with 2 equations in 2 variables
Main: attempting to solve as a linear system
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Transformer:   solving for linear equation in _X000001
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 3 equations and 2 inequations in 3 variables
Dispatch: dispatching to Exponentials handler
Transformer:   solving for linear equation in _S000004
Recurse: recursively solving 3 equations and 3 inequations in 4 variables
Dispatch: dispatching to Rename handler
Dispatch: renaming _S000005 = arctanh(1/2*_S000002*RootOf(_Z^2-2,index = 1)/_S000001)
Recurse: recursively solving 3 equations and 3 inequations in 5 variables
Dispatch: handling polynomials of the form a*x^n-b
Dispatch: dispatching to PolynomialSystem handler
Main: polynomial system split into 1 parts under preprocessing
Main: using RegularChains based methods
SolverVariableOrder: using the variable order  _S000003 > _X000002 > _S000005 > _S000002 > _S000001
TriangularDecomposition: using deterministic algorithm for decomposition
TriangularDecomposition: decomposition successfully found 1 components
TriangularDecomposition: backsubstituting to form solutions
TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order
Transformer:   solving the uncoupled linear subsystem in {_S000003, _X000002}
Linear: solving 2 linear equations
Polynomial: # of equations is: 2
Polynomial: best equation / unknown _S000005*_z1 _X000002 2*_S000001
Polynomial: # of equations is: 1
Polynomial: best equation / unknown -_z1*_S000001+1 _S000003 _z1*_S000001+1
Polynomial: backsubstitution at: 2
Polynomial: backsubstitution at: 1
Main: polynomial system split into 1 parts under preprocessing
Main: subsystem is essentially univariate
UnivariateHandler: subsystem has only one equation
UnivariateHandler: solving as if univariate in _S000002
Recurse: recursively solving 1 equations and 0 inequations in 1 variables
Dispatch: dispatching to OnlyIn handler
Transformer:   solving for linear equation in _S000006
Recurse: recursively solving 1 equations and 0 inequations in 1 variables
Transformer:   solving the uncoupled linear subsystem in _S000006
Recurse: recursively solving 1 equations and 1 inequations in 1 variables
Transformer:   solving the uncoupled linear subsystem in t
Error, (in evalf/hypergeom) time expired

 

This is trace when using A,B

 

eqs:=[-1/2*arctanh(1/2*sqrt(1 + 2*A)*sqrt(2)/sqrt(A))*sqrt(2)/sqrt(A) =B, 1 = (-exp(2*B*sqrt(A)*sqrt(2)) + 1)*sqrt(A)*sqrt(2)/(exp(2*B*sqrt(A)*sqrt(2)) + 1)];
unknowns:={A,B};
time();
infolevel[solve]:=5;
C_sol:=[timelimit(90,solve(eqs,unknowns))]; 
time()


Main: Entering solver with 2 equations in 2 variables
Main: attempting to solve as a linear system
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Transformer:   solving for linear equation in A
Recurse: recursively solving 2 equations and 2 inequations in 2 variables
Dispatch: dispatching to Radicals handler
Recurse: recursively solving 3 equations and 2 inequations in 3 variables
Dispatch: dispatching to Exponentials handler
Transformer:   solving for linear equation in _S000004
Recurse: recursively solving 3 equations and 3 inequations in 4 variables
Dispatch: dispatching to Rename handler
Dispatch: renaming _S000005 = arctanh(1/2*_S000002*RootOf(_Z^2-2,index = 1)/_S000001)
Recurse: recursively solving 3 equations and 3 inequations in 5 variables
Dispatch: handling polynomials of the form a*x^n-b
Dispatch: dispatching to PolynomialSystem handler
Main: polynomial system split into 1 parts under preprocessing
Main: using RegularChains based methods
SolverVariableOrder: using the variable order  _S000003 > B > _S000005 > _S000002 > _S000001
TriangularDecomposition: using deterministic algorithm for decomposition
TriangularDecomposition: decomposition successfully found 1 components
TriangularDecomposition: backsubstituting to form solutions
TriangularDecomposition: something went wrong during backsubstitution - trying a different variable order
Main: polynomial system split into 1 parts under preprocessing
Main: applying the solver for domain=absolute, engine=traditional
PseudoResultant: 225530 [1 200002087 _S000001] 3 3 151 2 45 0
PseudoResultant: 120059 [2 200004772 _S000003] 2 2 131 0 3 0
PseudoResultant: 134507 [1 700002396 _S000002] 1 1 53 0 3 0
PseudoResultant: -10 [] 0 0 3 0 3 0
PseudoResultant: 1 solutions found, now doing backsubstitution
PseudoResultant: backsubstitution of _S000002
PseudoResultant: backsubstitution of _S000003
PseudoResultant: backsubstitution of _S000001
SolutionsLost: setting solutions lost flag
Main: solving successful - now forming solutions
Main: Exiting solver returning 0 solutions

solve: Warning: no solutions found

 

Why Maple gives this error on solving first order linear ode using ODESteps? 

26004

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 1744 and is the same as the version installed in this computer, created 2024, April 17, 19:33 hours Pacific Time.`

ode:=diff(y(x),x)+x*y(x)=1;
ic:=y(0)=0;
dsolve([ode,ic]);

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

y(0) = 0

y(x) = -((1/2)*I)*exp(-(1/2)*x^2)*Pi^(1/2)*2^(1/2)*erf(((1/2)*I)*2^(1/2)*x)

Student:-ODEs:-ODESteps([ode,ic])

Error, (in Student:-ODEs:-OdeSolveOrder1) invalid input: too many and/or wrong type of arguments passed to solve; first unused argument is _C1

 

 

Download odesteps_fail_may_10_2024.mw

ps. also reported to Maplesoft customer support.

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