Maple Tutorial 6:
Solving Differential Equations
M.M. Yovanovich
TUTORIAL6.MWS
Solving differential equations. Initial value problems.
> restart:
> eq1:= diff(x(t),t) + alpha*x(t) = 0;
> sol1:= dsolve({eq1, x(0) = x0}, x(t));
> simplify(subs(sol1,eq1));
> eq2:= diff(y(t),t,t) + omega^2*y(t) = 0;
> sol2:= dsolve({eq2, y(0) = y0, D(y)(0) = v0}, y(t));
> simplify(subs(sol2, eq2));
> deq:= diff(y(x),x$2) = 9*y(x) + 2*x;
> invals:= y(0) = 1, D(y)(0) = 0;
> solde:= dsolve({deq, invals}, y(x));
Nonlinear second-order ODE.
> eq3:= diff(y(t),t,t) + sin(y(t)) = 0;
> sol3:= dsolve({eq3, y(0) = 1, D(y)(0) = 0}, y(t), numeric);
Maple has returned a numerical solution based on the Runge-Kutta method. We can get the solution for values of t. For example:
> sol3(0.5);
> rhs(sol3(0.5)[2]); rhs(sol3(0.5)[3]);
Series solution.
> eqn1:= diff(y(x),x$2) - x*diff(y(x),x) - y(x) = 0;
> soln1:= dsolve({eqn1, y(0) = 2, D(y)(0) = 1}, y(x), type = series);
> soln11:= convert(rhs(soln1), polynom);
>
Order:= 11;
soln1:= dsolve({eqn1, y(0) = 2, D(y)(0) = 1}, y(x), type = series);