Math 122 - Calculus for Biology II
Special Maple Help Page  

 © 2009, All Rights Reserved, SDSU & Joseph M. Mahaffy
San Diego State University -- This page last updated 09-Dec-10


 Special Maple Help Page

Solving second order differential equations using Maple

Consider the following second order linear differential equation:

y" + 4y' + 5y = 0, y(0) = 2, y'(0) = 4.

To solve this equation in Maple we use the following commands:

> de := diff(y(t),t$2) + 4*diff(y(t),t) + 5*y(t) = 0;

> dsolve({de, y(0) = 2, D(y)(0) = 4}, y(t));

> Y := unapply(rhs(%), t);

The first command simply stores the second order linear differential equation as de. The second command, dsolve, actually solves the initial value problem. The final command takes the solution and creates a function Y(t) that can be used for graphing, finding extrema, etc. (Recall that finding extrema (absolute and relative) are best found by looking at the graph (checking endpoints) and finding the derivative equal to zero over appropriate domains.)

The resulting solution is given by:

y(t) = 8 e-2tsin(t)+2 e-2tcos(t).

 

Solving two equations and two unknowns using Maple

Finding equilibria for a two species model involves solving two often nonlinear equations in two unknowns. Consider the following equilibrium calculation.

0.1X(1 - X/9.5) - 0.03XY = 0 .

0.07Y(1 - Y/6.5) - 0.015XY = 0 .

This can be solved by hand by factoring out the X in the first equation and the Y in the second equation, then finding the four points of intersection, examining each possible case. To solve this equation in Maple we use the following commands:

> eq1 := 0.1*X*(1 - X/9.5) - 0.03*X*Y;

> eq2 := 0.07*Y*(1 - Y/6.5) - 0.015*X*Y;

> solve({eq1 = 0, eq2 = 0}, {X, Y});

These commands will result in all four points of intersection.