ode2( 'diff(y,x)=%i*y+sin(x), y, x) gives division by 0
Logged In: YES user_id=588346
Same problem if you solve the equation 'diff(y,x)= k*y+sin(x) -- the solution is not valid at k=%i, but it doesn't ask.
Correct solution for k=%i is
y = -((-x-%i*%c-%i)*sin(x)+(%i*x-%c)*cos(x))/2
Logged In: YES user_id=501686
Observed in 5.9.3cvs.
With the current CVS version 5.18post this differential equation gives a correct result:
(%i53) ode2('diff(y,x)-%i*y-sin(x),y,x); (%o53) y = (%c-%i*(x-%i*%e^-(2*%i*x)/2)/2)*%e^(%i*x) (%i54) expand(%); (%o54) y = -%i*x*%e^(%i*x)/2+%c*%e^(%i*x)-%e^-(%i*x)/4
I think this is now correct because of an improvement of the routine SCE-INT in sin.lisp with revision 1.48.
Closing this bug report as fixed.
Dieter Kaiser
Log in to post a comment.
Logged In: YES
user_id=588346
Same problem if you solve the equation 'diff(y,x)=
k*y+sin(x) -- the solution is not valid at k=%i, but it
doesn't ask.
Correct solution for k=%i is
y = -((-x-%i*%c-%i)*sin(x)+(%i*x-%c)*cos(x))/2
Logged In: YES
user_id=501686
Observed in 5.9.3cvs.
With the current CVS version 5.18post this differential equation gives a correct result:
(%i53) ode2('diff(y,x)-%i*y-sin(x),y,x);
(%o53) y = (%c-%i*(x-%i*%e^-(2*%i*x)/2)/2)*%e^(%i*x)
(%i54) expand(%);
(%o54) y = -%i*x*%e^(%i*x)/2+%c*%e^(%i*x)-%e^-(%i*x)/4
I think this is now correct because of an improvement of the routine SCE-INT in sin.lisp with revision 1.48.
Closing this bug report as fixed.
Dieter Kaiser