nm

8135 Reputation

19 Badges

11 years, 136 days

MaplePrimes Activity


These are questions asked by nm

I am really confused by this behavior. Should the solution be different when calling dsolve(ode) vs. dsolve(ode,[x(t),y(t)]) where here ode is list of two coupled first order ode's?

Maple shows the solutions in reverse order in one case vs. the other. I do not see why adding [x(t),y(t)] should make x(t) solution now y(t)'s and y(t) solution now x(t)'s.  Here is an example

Here is worksheet. I just find the out changing very confusing. Should not the same solution for x(t) and y(t) remain the same regardless of adding the second option as list of not? What is the logic behaind this change or order, and how it one to know which is the correct one as they look different.

``

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1592 and is the same as the version installed in this computer, created 2023, November 27, 3:41 hours Pacific Time.`

restart;

20440

ode :=[diff(x(t), t) = (3*x(t))/2 + 2*y(t), diff(y(t), t) = x(t)/2 + y(t)]

[diff(x(t), t) = (3/2)*x(t)+2*y(t), diff(y(t), t) = (1/2)*x(t)+y(t)]

simplify(dsolve(ode,[x(t),y(t)]));

{x(t) = -(1/2)*c__2*(17^(1/2)-1)*exp(-(1/4)*(-5+17^(1/2))*t)+(1/2)*c__1*exp((1/4)*(5+17^(1/2))*t)*(17^(1/2)+1), y(t) = c__1*exp((1/4)*(5+17^(1/2))*t)+c__2*exp(-(1/4)*(-5+17^(1/2))*t)}

simplify(dsolve(ode));

{x(t) = c__1*exp((1/4)*(5+17^(1/2))*t)+c__2*exp(-(1/4)*(-5+17^(1/2))*t), y(t) = -(1/8)*c__2*(17^(1/2)+1)*exp(-(1/4)*(-5+17^(1/2))*t)+(1/8)*c__1*exp((1/4)*(5+17^(1/2))*t)*(17^(1/2)-1)}

#when using SET instead of LIST, then same solutions come out as above
simplify(dsolve(ode,{x(t),y(t)}));

{x(t) = c__1*exp((1/4)*(5+17^(1/2))*t)+c__2*exp(-(1/4)*(-5+17^(1/2))*t), y(t) = -(1/8)*c__2*(17^(1/2)+1)*exp(-(1/4)*(-5+17^(1/2))*t)+(1/8)*c__1*exp((1/4)*(5+17^(1/2))*t)*(17^(1/2)-1)}

 

Download why_solution_changes_nov_27_2023.mw

In my code, without knowing what the expression is, other than it has RootOf, the code called allvalues and got internal error 

Error, (in SolveTools:-Basis) invalid input: igcd received 5/7, which is not valid for its 2nd argument

Is this to be expected depending on the input, or is this some internal problem I need to report?

restart;
expr:=RootOf(R^4*b+R^2*a*_Z+2*_Z^2-exp(RootOf(tanh(1/2*(a^2-8*b)^(1/2)*(4*S-_Z)/a)^2*R^4*a^2-8*tanh(1/2*(a^2-8*b)^(1/2)*(4*S-_Z)/a)^2*R^4*b-R^4*a^2+8*R^4*b-8*exp(_Z))))

allvalues(expr)

Error, (in SolveTools:-Basis) invalid input: igcd received 5/7, which is not valid for its 2nd argument

Maple 2023.2 on windows 10

ps.  Reported to Maplesoft

I wonder if this a bug or Am I overlooking something?

I set infolevel[dsolve]:=5; and first time calling dsolve(ode), it works as expected. It prints on the screen the trace and steps it did.  But when I repeat the command dsolve, now it only prints one line and the rest of info that were printed before no longer show.

Should not the same information be printed each time? This is what happens on another example I tried. It seems infolevel does not work the same depending on the ode being solved?  Here is a worksheet attached to show the above.

Is there a workaround to make it display same information each time?

Maple 2023.2 on windows 10.

 

restart;

21424

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

ode:=[2*diff(x(t),t)+diff(y(t),t)=x(t)+y(t)+t,diff(x(t),t)+diff(y(t),t)=2*x(t)+3*y(t)+exp(t)];
infolevel[dsolve]:=5;
dsolve(ode);

[2*(diff(x(t), t))+diff(y(t), t) = x(t)+y(t)+t, diff(x(t), t)+diff(y(t), t) = 2*x(t)+3*y(t)+exp(t)]

5

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

-> Calling odsolve with the ODE diff(diff(y(x) x) x) = 4*(diff(y(x) x))-y(x)-3*x+1 y(x) singsol = none

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      trying a rational particular solution

      <- rational particular solution successful

<- solving first the homogeneous part of the ODE successful

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

infolevel[dsolve]:=5;

5

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

ode:=diff(y(x),x$2)+y(x)=sin(x);
dsolve(ode);

diff(diff(y(x), x), x)+y(x) = sin(x)

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      building a particular solution using variation of parameters

<- solving first the homogeneous part of the ODE successful

y(x) = sin(x)*c__2+cos(x)*c__1+(1/2)*sin(x)-(1/2)*cos(x)*x

dsolve(ode);

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      building a particular solution using variation of parameters

<- solving first the homogeneous part of the ODE successful

y(x) = sin(x)*c__2+cos(x)*c__1+(1/2)*sin(x)-(1/2)*cos(x)*x

 


On a side note. the first line of the display is hard to read. Any one know what it is supposed to mean by the space between the 1 and y(x) at the end there?

Download infolevel_stops_working.mw

This is strange problem. I have matrix M. when doing latex(M), it works. But when doing latex(simplify(evalf[16](M))) it gives internal Maple error 

Error, (in unknown) invalid input: ^ expects 2 arguments, but received 1

any workaround or ideas why it happens?

Maple 2023.2 on windows 10.

restart;

2848

interface(version)

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1590. The version installed in this computer is 1585 created 2023, October 29, 6:31 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2023\Physics Updates\lib\`

expr:=Matrix(3, 3, [[(-a^2-b^2-c^2)^(1/2),b*c/a,-b*c/a],[0,-(a^2+b^2)/(-a^2-b^2-c^2)^(1/2),c*a/b-c^2/(-a^2-b^2-c^2)^(1/2)],[0,0,0]]);
latex(expr);

Matrix(3, 3, {(1, 1) = sqrt(-a^2-b^2-c^2), (1, 2) = b*c/a, (1, 3) = -b*c/a, (2, 1) = 0, (2, 2) = -(a^2+b^2)/sqrt(-a^2-b^2-c^2), (2, 3) = c*a/b-c^2/sqrt(-a^2-b^2-c^2), (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

\left[\begin{array}{ccc}
\sqrt{-a^{2}-b^{2}-c^{2}} & \frac{b c}{a} & -\frac{b c}{a}
\\
 0 & -\frac{a^{2}+b^{2}}{\sqrt{-a^{2}-b^{2}-c^{2}}} & \frac{c a}{b}-\frac{c^{2}}{\sqrt{-a^{2}-b^{2}-c^{2}}}
\\
 0 & 0 & 0
\end{array}\right]

expr:=simplify(evalf[16](expr));
latex(expr);

Matrix(3, 3, {(1, 1) = 1.*sqrt(-a^2-b^2-c^2), (1, 2) = b*c/a, (1, 3) = -1.*b*c/a, (2, 1) = 0., (2, 2) = (-1.*a^2-1.*b^2)/sqrt(-a^2-b^2-c^2), (2, 3) = c*a/b-1.*c^2/sqrt(-1.000000000*a^2-1.000000000*b^2-1.000000000*c^2), (3, 1) = 0., (3, 2) = 0., (3, 3) = 0.})

Error, (in unknown) invalid input: ^ expects 2 arguments, but received 1

 

(will send to Maplesoft)

Download latex_problem_after_using_evalf_nov_23_2023.mw

This looks like a bug I have not seen before. Any one seen this before?

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

Can others reproduce it? I am using Maple 2023.2 on windows 10

btw, I found that by doing int(evala(integrand),t) instead of int(integrand,t) then the error goes away but not all the time. Below are two examples. The first where evala() fixes it, but the second it does not fix it. 

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1585 and is the same as the version installed in this computer, created 2023, October 29, 6:31 hours Pacific Time.`

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

restart;

15332

integrand:=-(((sqrt(3)*sqrt(27983)*I + 276)*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) + 15*I*sqrt(3)*sqrt(27983) + (25*(-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))/2 + 2265)*(-150 + (-150 + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))*sqrt(3)*I - (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) + 24*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3))*(150 + (-150 + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))*sqrt(3)*I + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) - 24*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3))*((sqrt(3)*sqrt(27983)*I + 276)*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) - 15*I*sqrt(3)*sqrt(27983) - 2265)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))*(-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3)*((-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) + 12*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) + 150)*sin(t)*cos(t))/(10101630528*(sqrt(3)*sqrt(27983)*I - 99)^2*(sqrt(3)*sqrt(27983)*I + 27983/33)*exp(t)) - ((-594 + 6*I*sqrt(83949))^(2/3) + 12*(-594 + 6*I*sqrt(83949))^(1/3) + 150)*(2*I*sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3) + 30*I*sqrt(83949) + 25*(-594 + 6*I*sqrt(83949))^(2/3) + 552*(-594 + 6*I*sqrt(83949))^(1/3) + 4530)*(-594 + 6*I*sqrt(83949))^(1/3)*(sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3)*I - 15*I*sqrt(83949) + 276*(-594 + 6*I*sqrt(83949))^(1/3) - 2265)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))*(8*cos(t)^2/exp(t) - 4/exp(t))/(5196312*(sqrt(83949)*I + 27983/33)*(sqrt(83949)*I - 99)) + ((-594 + 6*I*sqrt(83949))^(2/3) + 12*(-594 + 6*I*sqrt(83949))^(1/3) + 150)*(2*I*sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3) + 30*I*sqrt(83949) + 25*(-594 + 6*I*sqrt(83949))^(2/3) + 552*(-594 + 6*I*sqrt(83949))^(1/3) + 4530)*(-150 + (-594 + 6*I*sqrt(83949))^(2/3))*(-594 + 6*I*sqrt(83949))^(2/3)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))/(1154736*(sqrt(83949)*I + 27983/33)*(sqrt(83949)*I - 99)*exp(t)):

int(integrand,t)

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

 

Download handler_trig_exp_only_nov_18_2023.mw

But the trick of using evala() to avoid this error does not always work. Here is an example below. So need to find another workaround for this.

restart;

18704

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

integrand2:=1/40406522112*I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*exp(t*(5/3*3^(1/2)*2^(1/2)
*sin(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)-5*cos(1/3*arctan(1/99*83949^(1/2))+1/
6*Pi)*2^(1/2)-1))*(150+I*(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)+(-\
594+6*I*3^(1/2)*27983^(1/2))^(2/3)-24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3))*(
2265+(276+I*(27983^(1/2)+92)*3^(1/2)-27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2)
)^(1/3)+5*I*(-151+3*27983^(1/2))*3^(1/2)+15*27983^(1/2))*(2265-25*(-594+6*I*3^(
1/2)*27983^(1/2))^(2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+
6*I*3^(1/2)*27983^(1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*(
(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)+12*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+
150)*3^(1/2)*(-150+I*(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)-(-594+
6*I*3^(1/2)*27983^(1/2))^(2/3)+24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3))/(I*3^(1
/2)*27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)^2/exp(t)*sin(t)*cos(t)-1/
20785248*I*(I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*3^(1/2)+(-594+6*I*3^(1/2)*
27983^(1/2))^(2/3)-150*I*3^(1/2)-24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+150)*
exp(5/3*3^(1/2)*sin(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)*t-5*cos(1/3*
arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)*t-t)*(2265-25*(-594+6*I*3^(1/2)*27983^
(1/2))^(2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+6*I*3^(1/2)
*27983^(1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*(2265+(276+I
*(27983^(1/2)+92)*3^(1/2)-27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+5*I
*(-151+3*27983^(1/2))*3^(1/2)+15*27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2))^(1
/3)*3^(1/2)/(I*3^(1/2)*27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)*(8/exp(
t)*cos(t)^2-4/exp(t))+1/13856832*I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*(-450+I
*(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)-3*(-594+6*I*3^(1/2)*27983^
(1/2))^(2/3))*exp(t*(5/3*3^(1/2)*2^(1/2)*sin(1/3*arctan(1/99*83949^(1/2))+1/6*
Pi)-5*cos(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)-1))*(150+I*(-150+(-594+6
*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)-24*
(-594+6*I*3^(1/2)*27983^(1/2))^(1/3))*(2265-25*(-594+6*I*3^(1/2)*27983^(1/2))^(
2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+6*I*3^(1/2)*27983^(
1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*3^(1/2)/(I*3^(1/2)*
27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)/exp(t):

int(integrand2,t);

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

int(evala(integrand2),t);

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

 

Download handler_trig_exp_version_2.mw

ps. send to Maplesoft support.

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