Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
107 views4 pages

Department of Mathematics

1) This document describes solving systems of first-order and second-order linear differential equations using matrix methods. Key steps include writing the systems as matrix-vector equations, finding eigenvalues and eigenvectors, and using them to solve the homogeneous systems. 2) Several examples are provided to demonstrate solving 1st and 2nd order systems using MATLAB. Initial value problems for 1st order systems and general solutions involving eigenvalues/eigenvectors are obtained. 3) Exercises are given applying the methods, including mass-spring systems, mixing problems, and reducing a 3rd order equation to 1st order form.

Uploaded by

Madhu Sudhan T
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views4 pages

Department of Mathematics

1) This document describes solving systems of first-order and second-order linear differential equations using matrix methods. Key steps include writing the systems as matrix-vector equations, finding eigenvalues and eigenvectors, and using them to solve the homogeneous systems. 2) Several examples are provided to demonstrate solving 1st and 2nd order systems using MATLAB. Initial value problems for 1st order systems and general solutions involving eigenvalues/eigenvectors are obtained. 3) Exercises are given applying the methods, including mass-spring systems, mixing problems, and reducing a 3rd order equation to 1st order form.

Uploaded by

Madhu Sudhan T
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

WS 2018-19

DEPARTMENT OF MATHEMATICS
SCHOOL OF ADVANCED SCIENCES
Solution of homogeneous system of first order and second order differential
equations by Matrix method.

Course Code: MAT2002 Experiment: 4-A


Course Name: Application of Differential and Difference Equations Duration: 90 Minutes

System of First Order Linear Differential Equations

A system of n linear first order differential equations in n unknowns (an n × n system of linear equations)
has the general form:
 0

 x1 = a11 x1 + a12 x2 + · · · + a1n xn + g1 (t)
 x0 = a21 x1 + a22 x2 + · · · + a2n xn + g2 (t)

2
.. . . . . . (1)

 . = .. + .. + .. + .. + ..
 0

xn = an1 x1 + an2 x2 + · · · + ann xn + gn (t)
where the coefficients aij ’s are arbitrary constants, and gi ’s are arbitrary functions of t. If every term gi is
constant zero, then the system is said to be homogeneous.
The system (1) is most often given in a shorthand format as a matrix-vector equation, in the form:

X 0 = AX + G
where X 0 = [x0i ]n×1 , A = [aij ]n×n , X = [xi ]n×1 , and G = [gi (t)]n×1 .

If the coefficient matrix A has two distinct real eigenvalues λ1 and λ2 and their respective eigenvectors are
X1 and X2 , then the 2 × 2 system
X 0 = AX
has a general solution
X = C1 X1 eλ1 t + C2 X2 eλ2 t

System of Second Order Linear Differential Equations

Consider the system of second order linear differential equations of the form
 00

 x1 = a11 x1 + a12 x2 + · · · + a1n xn
x00 = a21 x1 + a22 x2 + · · · + a2n xn

2
.. . . . . (2)

 . = .. + .. + .. + ..
 00

xn = an1 x1 + an2 x2 + · · · + ann xn
where the coefficients aij ’s are arbitrary constants.
Then, the solution of (2), X 00 = AX, is
X = PY
where Y is the solution of Y 00 = DY , P is the modal matrix of A and D is it’s diagonal matrix.

1. Solve:
x01 = x1 + 2x2
x02 = 0.5x1 + x2
x1 (0) = 16, x2 (0) = −2

MATLAB CODE
clc
clear

syms t C1 C2

A=input(’Enter A: ’);

[P,D]=eig(A);
L1=D(1);L2=D(4);

y1=C1*exp(L1*t);y2=C2*exp(L2*t);
Y=[y1;y2];
X=P*Y;

Cond=input(’Enter the initial conditions [t0, x10,x20]: ’);


t0=Cond(1);x10=Cond(2);x20=Cond(3);

eq1=subs(X(1)-x10,t0);eq2=subs(X(2)-x20,t0);
[C1, C2] = solve(eq1,eq2);

X=subs(X);

INPUT
Enter A: [1 2;0.5 1]
Enter the initial conditions [t0, x10,x20]: [0 16 -2]
OUTPUT
X=
10*exp(t/4503599627370496) + 6*exp(2*t)
3*exp(2*t) - 5*exp(t/4503599627370496)

2. The governing equations of a certain vibrating system are


x001 = 2x1 + x2
x002 = 9x1 + 2x2
Solve the system of equations by matrix method.
MATLAB CODE
clc
clear

A=input(’Enter A: ’);

[P D]=eig(A);

Sol1 = dsolve([’D2y = ’,num2str(D(1)),’*y’]);


Sol2 = dsolve([’D2y = ’,num2str(D(4)),’*y’]);

X = P*[Sol1;Sol2];

disp(’x1=’);disp(X(1))
disp(’x2=’);disp(X(2))

INPUT
Enter A: [-5 2;2 -2]

OUTPUT
x1=
(10ˆ (1/2)*(C1*exp(5ˆ (1/2)*t) + C2*exp(-5ˆ (1/2)*t)))/10 - (10ˆ (1/2)*
(C3*cos(t) + C4*sin(t)))/10

x2=
(3*10ˆ (1/2)*(C3*cos(t) + C4*sin(t)))/10 + (3*10ˆ (1/2)*
(C1*exp(5ˆ (1/2)*t) + C2*exp(-5ˆ (1/2)*t)))/10
Exercise

3. Solve the following:


(a) x01 = 3x1 − 2x2 ; x02 = 2x1 − 2x2 ; x1 (0) = 1, x2 (0) = −1.
(b) x01 = −x2 + x3 ; x02 = 4x1 − x2 − 4x3 ; x03 = −3x1 − x2 + 4x3 .
4. Solve the following:
(a) x001 = −5x1 + 2x2 ; x002 = 2x1 − 2x2 .
(b) x001 + 2x1 − x2 = 0; x002 − x1 + 2x2 = 0.
5. Two particles of equal mass m = 1 move in one dimension at the junction of
three springs. The springs each have unstretched length a = 1 and have spring
stiffness constants, k, 3k and k (with k = 1) respectively see Figure. Applying
Newton’s second law and Hooke’s, this mass-spring system gives rise to the
differential equation system

x001 = −4x1 + 3x2

x002 = 3x1 − 4x2


Find the displacements x1 (t) and x2 (t).

6. Reduce the third order equation y 000 + 2y 00 − y 0 − 2y = 0 to the system of first


order linear equations and solve by matrix method.
7. Consider tanks T1 and T2 which contain initially 100 gallons of water each. In
T1 water is pure whereas 150 pounds of salt is dissolved in T2 . By circulating
the liquid at the rate of 2 gallons per minute and stirring, the amount of salt y1 (t)
in T1 and y2 (t) in T2 change with time t, find the amount of salt in the two tanks
after a time t.

————————————–

You might also like