nm

10239 Reputation

19 Badges

12 years, 152 days

MaplePrimes Activity


These are questions asked by nm

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

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.

I never used Maple's StringTools:-RegSubs before.

I have a Latex string generated by Maple that has this form

"......    \\textrm{ ......   }  .... "

Where the dots mean anything, including space characters.  I need to change the part of the string  "\\textrm{ ...... }" to this

"......  \\begin{minipage}{\\linewidth}\\textrm{  ......   }\\end{minipage}  .... "

It is easy to change the opening part. Here is an example

s:="A& B& \\textrm{The fundamental matrix has } &C ";
s:=StringTools:-SubstituteAll(s,"\\textrm{","\\begin{minipage}{\\linewidth}\\textrm{");

Gives

The problem is how to replace the closing "}"  with "}\\end{minipage}".   I can't just replace "}" with "}\\end{minipage}" using SubstituteAll because I need to only change the "}" that closes the corresponding "\\textrm{" and not any other "}" that could be in the string.

So I need to use pattern matching or regular expression substitutions. The examples in help are not easy to understand.

 

Basically I need regular expression that matches 

                        "\\textrm{ WILDCARD * }" 

and change it to 

                        "\\begin{minipage}{\\linewidth}\\textrm{ WILDCARD * }\\end{minipage}" 

Any one know how to use Maple's egular expression to do this substitution using the above example?

Maple 2024 on windows 10.

Update

Thanks for the replies. I ended up writing small function that simply scan the string and do the replacement. 

I was attempting to remove part of string using StringTools:-Remove()

But it causes server.exe crash each time.

Any idea why this happens?

Worksheet below

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

restart;

3048

ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1):
ode:=diff(y(x), x$2) = (y(x) + 1):
the_output:=Student:-ODEs:-ODESteps(ode,y(x)):
 

s:=latex(the_output,'output'=string):

StringTools:-Remove(s,"\\begin{array}{ccc}");


Download crash_during_string_tools_remove_maple_2024.mw

ps. reported to Maplesoft also.

First 18 19 20 21 22 23 24 Last Page 20 of 186