next up previous contents
Next: Operators Up: Wester's test suite Previous: Series

Differential Equations

[New] Problem :solve the differential equation with the initial conditions .

>> loadlib("ode"):
>> ode({diff(f(t),t,t)+4*f(t)=sin(2*t),f(0)=0,D(f)(0)=0},f(t));

 ode({D(f)(0) = 0, f(0) = 0, 4 f(t) + diff(f(t), t, t) = sin(2 t)}, f(t))

>> solve(%);

                        -- sin(2 t)   t cos(2 t) --
                        |  -------- - ----------  |
                        --    8           4      --

Here we first load the ode package, then we define the equation with the ode command, and simply call solve on this equation.

[New] Problem :solve the equation .

>> solve(ode(x^2*diff(y(x),x)+3*x*y(x)=sin(x)/x,y(x)));

                        --     - 3    - 3        --
                        |  C3 x    - x    cos(x)  |
                        --                       --

[New] Problem : solve the equation for .

>> solve(ode(diff(y(x),x,x)+y(x)*diff(y(x),x)^3=0,y(x)));

             --            /                        3    \ --
             |  C5, RootOf \ 6 x + 6 C6 + 6 C4 y - y , y /  |
             --                                            --

This result says that the solution is either a constant function , or an algebraic function satisfying the equation where and are arbitrary constants.

[New] Problem : solve the equation .

>> solve(ode(diff(y(x,a),x)=a*y(x,a),y(x,a)));

                               [C1 exp(a x)]

MuPAD recognizes equations with only one differential variable as ordinary differential equations.

[New] Problem :solve the system .

>> sys := {diff(x(t),t)-x(t)+y(t)=0,diff(y(t),t)-x(t)-y(t)=0}:
>> solve(ode(sys, {x(t),y(t)}));

 [x(t) = (I) C5 exp((1 + I) t) + (- I) C6 exp((1 - I) t), y(t) = C5 exp((

                      1 + I) t) + C6 exp((1 - I) t)]

[New] Problem :verify the above is a solution.

>> eval(subs([op(sys)],op(%))); 

                              [0 = 0, 0 = 0]



Andre Heck
Sun Apr 23 10:32:10 MDT 1995