Dear All,
I did not find the answer to this elementary question elsewhere ---
please apologize if it was already answered.
I want to solve the 2nd order ODE y''(x)+y(x)=0 with initial
conditions y(0)=1, y'(0)=0. Obviously the solution is unique and it is
y(x)=cos(x). Let's try:
x=var('x')
y=function('y',x)
desolve(diff(y,x,2)+y(x)==0,y,[0,1,0])
Answer from SAGE:
y(0)*cos(x)
Why isn't the answer simply cos(x)? Similarly, if I try with initial
conditions y(0)=0,y'(0)=1, instead of sin(x) I get sin(x)+y(0)*cos(x).
However, I checked that Maxima (which, I understood, SAGE drives to
solve the ODE) gives the correct answer:
-----------------------------------------------------------------------
Maxima 5.16.3 http://maxima.sourceforge.net
Using Lisp SBCL 1.0.22
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) s: ode2('diff(y,x,2)+y,y,x);
(%o1) y = %k1 sin(x) + %k2 cos(x)
(%i2) ic2(s,x=0,y=1,'diff(y,x)=0);
(%o2) y = cos(x)
-----------------------------------------------------------------------
Thanks for your advice.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---