Question: clarification on current status of odetest in Maple 2024.2

These two issues probably came up before, but I can't find where and when searching Maple primes.

So I thought to summarize the issues I see with odetest in one post, in the hope to get clarification on current status on these from the powers who know.

The first issue

The order in which odetest returns the answer. When odetest is called to check the ode and IC, as in 

the_status := odetest(sol,[ode,IC])

One would expect the_status to be a list, where the first entry tells if sol verifies the ode, and the second entry tells if sol verifies IC.

i.e. the order is the same as in the input. right? Since ode is first and IC is second in the input list.

But Maple sometimes mixes the order. See example 1 below. This makes it impossible to determine if the solution verifies the ode or IC,  when one of the entries in the_status is zero and the other is not, since order can be reversed sometimes.

Second issue:

When the solution is implicit, Maple gives invalid odetest result on the IC, unless one rewrites the solution using (lhs-rhs)(sol)=0.

i.e. move everything to the left side of the equation with RHS zero. This happens sometimes and when the solution is implicit.

I have thought this was fixed in current Maple, but it is not.  I remember this came up before, but can't find when and where.

Example 2 below shows an example.

Will these two issues hopefully be fixed in Maple 2025? Sometimes one forgets to rewrite the solution using (lhs-rhs)(sol)=0 and this results in false negative. 

Please see worksheet below. ps. I hope forum manager does not delete this question.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1838 and is the same as the version installed in this computer, created 2024, December 2, 10:11 hours Pacific Time.`

libname;

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

restart;

 

Example 1: order of status from odetest is not same as order of input

 

ode:=1+x*y(x)*(1+y(x)^2*x)*diff(y(x),x) = 0:
IC:=y(1) = 0:
sol:=x = 1/(3*exp(y(x)^2/2) - y(x)^2 - 2);

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

#we see that odetest verifies the ode
odetest(sol,ode)

0

#but when adding IC, 0 is now in second entry, instead of first

odetest(sol,[ode,IC])

[(y(x)^4-y(x)^2*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))^3*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))-6*y(x)^2*exp((1/2)*y(x)^2)+3*exp((1/2)*y(x)^2)*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+4*y(x)^2-2*y(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))*(D(y))(-1/(y(x)^2-3*exp((1/2)*y(x)^2)+2))+9*exp(y(x)^2)-12*exp((1/2)*y(x)^2)+4)/(y(x)^2-3*exp((1/2)*y(x)^2)+2)^2, 0]

#SHOULD NOT zero above be in first slot in the list instead of second slot??

 

 

Example 2. We must write the solution using (lhs-rhs)(sol)=0

 

restart;

ode:=1+x*y(x)*(1+y(x)^2*x)*diff(y(x),x) = 0:
IC:=y(1) = 0:
sol:=x = 1/(3*exp(y(x)^2/2) - y(x)^2 - 2);

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

odetest((lhs-rhs)(sol)=0,[ode,IC])

[0, 0]

#we see that now it verified both IC and sol

 

 

 

 

Download issues_with_odetest_dec_16_2024.mw

Please Wait...