Systems of ODEs

Brown University, Applied Mathematics


Return to computing page
Return to MuPAD tutorial page for the first course
Return to MuPAD tutorial page for the second course
Return to the main page (APMA0340)

Systems of ODEs

The tutorial accompanies the textbook Applied Differential Equations. The Primary Course by Vladimir Dobrushkin, CRC Press, 2015; http://www.crcpress.com/product/isbn/9781439851043

We consider a system of nonlinear differential equations in normal form (when the derivatives are isolated):

\[ \begin{cases} {\text d}x_1 /{\text d}t &= g_1 (t, x_1 , x_2 , \ldots , x_n ), \\ {\text d}x_2 /{\text d}t &= g_2 (t, x_1 , x_2 , \ldots , x_n ), \\ \vdots & \qquad \vdots \\ {\text d}x_n /{\text d}t &= g_n (t, x_1 , x_2 , \ldots , x_n ), \end{cases} \]
where \( g_k (t, x_1 , x_2 , \ldots , x_n ) , \quad k=1,2,\ldots , n, \quad \) is a given function of \( n+1 \) variables. INstead of \( {\text d}x /{\text d}t \) we will use either of shorter notations \( x' \) or the more customary notation \( \dot{x} \) to denote a derivative of \( x(t) \) with respect to variable t associated with time. If the slope functions do \( g_k (t, x_1 , x_2 , \ldots , x_n ) , \quad k=1,2,\ldots , n, \quad \) do not depend on time variable t, the system of differential equations is referred to as autonomous:

\[ \begin{cases} {\text d}x_1 /{\text d}t &= g_1 (x_1 , x_2 , \ldots , x_n ), \\ {\text d}x_2 /{\text d}t &= g_2 (x_1 , x_2 , \ldots , x_n ), \\ \vdots & \qquad \vdots \\ {\text d}x_n /{\text d}t &= g_n (x_1 , x_2 , \ldots , x_n ), \end{cases} \]
Differential equations are usually sugject to the initial conditions:
\[ x_1 (t_0 ) = x_{10} , \quad x_2 (t_0 ) = x_{20} , \quad \ldots , \quad x_n (t_0 ) = x_{n0} , \]

where \( t_0 \) is a specified value of t and \( x_{10} , x_{20} , \ldots , x_{n0} \) are prerscribed constants. The problem of finding a solution to a system of differential equations that satisfies the givne initial conditions is called an initial value problem.

When the functions \( g_k (t, x_1 , x_2 , \ldots , x_n ) , \quad k=1,2,\ldots , n, \quad \) are linear functions with respect to n dependent variables \( x_1 (t), x_2 (t), \ldots , x_n (t), \) we obtain the general system of first order linear differential equations in normal form:

\[ \begin{cases} \dot{x}_1 &= p_{11} \,x_1 + p_{12} (t)\, x_2 + \cdots + p_{1n} (t)\, x_n + f_1 (t), \\ \dot{x}_2 &= p_{21} \,x_1 + p_{22} (t)\, x_2 + \cdots + p_{2n} (t)\, x_n +f_2 (t), \\ \vdots & \qquad \vdots \\ \dot{x}_n &= p_{n1} \,x_1 + p_{n2} (t)\, x_2 + \cdots + p_{nn} (t)\, x_n +f_n (t). \end{cases} \]

In this system of differential equations, the \( n^2 \) coefficients \( p_{11}, p_{12}, \ldots , p_{nn} \) and the n functions \( f_1 (t) , f_2 (t) , \ldots , f_n (t) \) are assumed to be known. If the coefficients \( p_{ij} \) are constants, we have a constant coefficient system of equations. Otherwise, we have a linear system of differential equations with variable coefficients. The system id said to homogeneous or undriven if\( f_1 (t) \equiv f_2 (t) \equiv \cdots f_n (t) \equiv 0. \)

The linear system of differential equations can be written in compact vector form:

\[ \dot{\bf x} = {\bf P} (t)\, {\bf x} + {\bf f}(t) , \]
where \( {\bf P} (t) \) denotes the following square matrix:
\[ {\bf P} (t) = \begin{bmatrix} p_{11} (t) & p_{12} (t) & \cdots & p_{1n} (t) \\ p_{21} (t) & p_{22} (t) & \cdots & p_{2n} (t) \\ \vdots & \vdots & \vdots & \vdots \\ p_{n1} (t) & p_{n2} (t) & \cdots & p_{nn} (t) \\ \end{bmatrix} \]
Here \( {\bf x} (t) \) and \( {\bf f} (t) \) are n-dimensional vector-functions that are assumed to be columns.

In MuPad, defining matrices is done similar to Maple:

A1 := matrix([[3,2,4],[2,0,2],[4,2,3]])

phi1 := exp(A1*t)

phi1_dot := diff(phi1,t)

testeq(phi1_dot,A1*phi1)

A2 := matrix([[1,-1,-2],[1,3,2],[1,-1,2]])

phi2 := exp(A2*t)

phi2_dot := diff(phi2,t)

testeq(phi2_dot,A2*phi2)

reset

A3 := matrix([[-15,-7,4],[34,16,-11],[17,7,5]])

phi3 := exp(A3*t)

phi3_dot := diff(phi3,t)

testeq(phi3_dot,A3*phi3)

reset
a1 := x'(t) = -.1/20*x(t)

a2 := y'(t) = -x'(t) - .1/40*y(t)

a3 := z'(t) = .1/40*y(t) - .1/50*z(t)

fun := {a1,a2,a3,x(0)=15,y(0)=0,z(0)=0}

sol := ode::solve(fun,{x(t),y(t),z(t)})

x1(t) := sol[1][2]

x2(t) := sol[1][1]

x3(t) := sol[1][3]

% distinct eigenvalues
A := matrix([[5,9],[6,2]])
x := (t^L)*z
x_dot := diff(x,t)
one := matrix([[L,0],[0,L]])
y := det(one-A)
factor(y)
linalg::eigenvectors(A)


 



Congrats! You now have just opened MuPAD. Click "Next" to continue.

Home

Next >