#994 initial value problem gives rise to error

closed
nobody
5
2006-12-26
2006-09-28
No

(%i1) 'diff(y,x)+2*y=3;
(%o1) 'diff(y,x,1)+2*y=3
(%i2) ic1(%, x=0, y=1);
Attempt to differentiate with respect to a number:
0
#0: ic1(soln='diff(y,x,1)+2*y = 3,xc=x = 0,yc=y =
1)(ode2.mac line 300)
#1: ic1(?_l=['diff(y,x,1)+2*y = 3,x = 0,y = 1])
-- an error. Quitting. To debug this try
debugmode(true);

The problem does have a solution, though:

(%i3) ode2(%o1, y, x);
(%o3) y=%e^(-2*x)*((3*%e^(2*x))/2+%c)
(%i4) subst(0, x, %);
(%o4) y=%c+3/2
(%i5) subst(1, y, %);
(%o5) 1=%c+3/2
(%i6) solve([%], [%c]);
(%o6) [%c=-1/2]

Discussion

  • Robert Dodier

    Robert Dodier - 2006-12-26

    Logged In: YES
    user_id=501686
    Originator: NO

    Pedro, thanks for your interest in Maxima and thanks for submitting the bug report.

    ic1 (and also ic2 and bc2) is supposed to be called after ode2 finds a solution. ic1 itself does not find the solution. So it works like this:

    (%i2) 'diff(y, x) + 2*y = 3;
    (%o2) 'diff(y,x,1)+2*y = 3
    (%i3) ode2(%, y, x);
    (%o3) y = %e^-(2*x)*(3*%e^(2*x)/2+%c)
    (%i4) ic1(%, x=0, y=1);
    (%o4) y = %e^-(2*x)*(3*%e^(2*x)-1)/2

    Certainly, the documentation should be clearer.

    Closing this report as invalid (not a bug).

     
  • Robert Dodier

    Robert Dodier - 2006-12-26
    • status: open --> closed
    • labels: 887072 --> Lisp Core - Differential eqns
     

Log in to post a comment.