Question: odetest gives different residual on the ode when adding IC to the call.

I am very confused about this result. 

I call the result of odetest the residual. Which should be zero or simplifies to zero if dsolve solution is correct.

Now, if I do     odetest(solution,ode), I get residual which simplifies to zero. OK. But doing odetest(solution,[ode,IC]) now gives output for the ode residual (first entry) completely different than the first case and which can't be simplified to zero any more. 

odetest also says the solution satisfies the IC, since the second entry of the residual is zero.     

So we have case where the solution satisfies the ODE itself and also satisfies the IC. But when calling odetest with both the ode and the IC, now it says the solution does not satisfiy the ode.

How could this be? What Am I overlooking here? Should not the ode residual remain the same in both calls?

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1787 and is the same as the version installed in this computer, created 2024, August 10, 8:50 hours Pacific Time.`

restart;

ode:=diff(y(x), x, x) = sqrt(1 + diff(y(x), x)^2);

diff(diff(y(x), x), x) = (1+(diff(y(x), x))^2)^(1/2)

IC:=y(0)=1;

y(0) = 1

sol:=[dsolve([ode,IC])][-1]; #just interested in last solution now

 

y(x) = cosh(x+c__1)+1-cosh(c__1)

residual:=odetest(sol,ode)

cosh(x+c__1)-(1/2+(1/2)*cosh(2*x+2*c__1))^(1/2)

simplify(residual) assuming positive;

0

#Why now the residual changes on the ode??
residual:=odetest(sol,[ode,IC])

[cosh(c__1)*cosh(x)+sinh(c__1)*sinh(x)-(1+sinh(x)^2*cosh(c__1)^2+2*sinh(x)*cosh(c__1)*cosh(x)*sinh(c__1)+cosh(x)^2*sinh(c__1)^2)^(1/2), 0]

#no longer simplifes to zero.
map(X->(simplify(X) assuming positive),residual)

[cosh(c__1)*cosh(x)+sinh(c__1)*sinh(x)-(1+sinh(x)^2*cosh(c__1)^2+2*sinh(x)*cosh(c__1)*cosh(x)*sinh(c__1)+cosh(x)^2*sinh(c__1)^2)^(1/2), 0]

 

 

Download odetest_problem_august_14_2024.mw

Please Wait...