rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

Incorrect solution of ODEs "inf" #3874

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-08 20:13:45 Created by sslavi on 2015-10-20 17:13:38 Original: https://sourceforge.net/p/maxima/bugs/3036


Maxima seem to consider "inf" as a constant and hence doesn't solve correctly initial value problems involving "inf". The problem is present in both ic1 and ic2 functions. Please take a look at the attached example.

For your convenience, this is the transcript of the session:

Input: *> f1: 'diff(y,x)=1/x^2$

ode2(f1,y,x); ic1(%,x=inf,y=0); Output: > (%o2) y=%c-1/x (%o3) y=(x-inf)/(infx)* the correct answer is 1/(2x).

Input: *> f2: 'diff(y,x,2)=1/x^3$

ode2(f2,y,x); ic2(%,x=inf,y=0,diff(y,x)=0); Output: >(%o5) y=%k2x+1/(2x)+%k1 (%o6) y=x/(2inf^2)+1/(2x)-1/inf* the correct answer is 1/(2x).

Attachments:

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-08 20:13:46 Created by billingd on 2016-09-24 02:44:03 Original: https://sourceforge.net/p/maxima/bugs/3036/#be69


rtoy commented 4 months ago

Imported from SourceForge on 2024-07-08 20:13:50 Created by aleksasd on 2016-09-24 04:45:34 Original: https://sourceforge.net/p/maxima/bugs/3036/#be69/e986


Solve y' = 1/x^2, y(inf)=0.

Solve y'' = 1/x^3, y(inf)=0, y'(inf)=0.

(%i2) eq1:'diff(y,x)=1/x^2$ eq2:'diff(y,x,2)=1/x^3$

(%i5) ode2(eq1,y,x); ic1(%,x=a,y=0); limit(%,a,inf); (%o3) y=%c-1/x (%o4) y=(x-a)/(a*x) (%o5) y=-1/x

(%i8) ode2(eq2,y,x); ic2(%,x=a,y=0,diff(y,x)=0); limit(%,a,inf); (%o6) y=%k2x+1/(2x)+%k1 (%o7) y=x/(2a^2)+1/(2x)-1/a (%o8) y=1/(2*x)

Other solution with odes: (%i9) load(odes)$

(%i11) ode1_ic(eq1,y,x,[a,0]); limit(%,a,inf); (%o10) y=(x-a)/(a*x) (%o11) y=-1/x

(%i13) ode2_ic(eq2,y,x,[a,0,0]); limit(%,a,inf); (%o12) y=x/(2a^2)+1/(2x)-1/a (%o13) y=1/(2*x)

best

Aleksas D

2016-09-24 5:44 GMT+03:00 David Billinghurst billingd@users.sf.net:

  • assigned_to: David Billinghurst

Status: open Group: None Labels: ic1 ic2 inf Created: Tue Oct 20, 2015 05:13 PM UTC by sslavi Last Updated: Tue Oct 20, 2015 05:21 PM UTC Owner: David Billinghurst Attachments:

Maxima seem to consider "inf" as a constant and hence doesn't solve correctly initial value problems involving "inf". The problem is present in both ic1 and ic2 functions. Please take a look at the attached example.

For your convenience, this is the transcript of the session:

Input: *> f1: 'diff(y,x)=1/x^2$

ode2(f1,y,x); ic1(%,x=inf,y=0);

  • Output:> (%o2) y=%c-1/x (%o3) y=(x-inf)/(infx) the correct answer is 1/(2x).

Input: *> f2: 'diff(y,x,2)=1/x^3$

ode2(f2,y,x); ic2(%,x=inf,y=0,diff(y,x)=0);

  • Output:>(%o5) y=%k2x+1/(2x)+%k1 (%o6) y=x/(2inf^2)+1/(2x)-1/inf the correct answer is 1/(2x).

Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/maxima/bugs/3036/

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/