Presentation is loading. Please wait.

Presentation is loading. Please wait.

SYSTEM OF DIFFERENTIAL EQUATIONS

Similar presentations


Presentation on theme: "SYSTEM OF DIFFERENTIAL EQUATIONS"— Presentation transcript:

1 SYSTEM OF DIFFERENTIAL EQUATIONS
f(t) : Input u(t) and v(t) : Outputs to be found System of constant coefficient differential equations with two unknowns * First order derivative terms are on the left hand side x : State variable matrix (nx1) A : System matrix (nxn) * Non-derivative terms are on the right hand side u : Input matrix (mx1) B : Matrix with dimension (nxm)

2 X(s) = [s I – A]-1 x0 + [s I – A]-1 B U (s)
Laplace Transformation: s X(s) - x0 = A X(s) + B U(s) [s I – A] X(s) = x0 + B U (s) X(s) = [s I – A]-1 x0 + [s I – A]-1 B U (s) Homogeneous part Particular part

3 Example: At t=0 u=-2 , v=3 ; F(s) = -4/s D(s)=det[sI-A]=s2+3s+120 : Eigenvalue equation X(s) = [s I – A]-1 x0 + [s I – A]-1 B U (s)

4 Calculation of eigenvalues with Matlab:
a=[0,1 ; -120,-3] ; eig(a) Determination of matrix [sI-A]-1: syms s; a=[0,1;-120,-3] ; i1=eye(2); a1=inv(s*i1-a); pretty(a1)

5 Example: f(t):Input x(t) and y(t) : Outputs to be found and Let’s use the variables

6 m=20 kg c=40 Ns/m k=5000 N/m SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS
Example: Write the equation of motion of the mechanical system given below in the State Variables Form. Force applied on the system is F(t)=100 u(t) (a step input having magnitude 100 Newtons) and at t=0 x0=0.05 m and dx/dt=0. Find x(t) and v(t). State variables are x and v=dx/dt . m=20 kg c=40 Ns/m k=5000 N/m Matlab program to obtain eigenvalues: >>a=[0 1; ];eig(a)

7 Solution due to the initial conditions
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS Applying Laplace transform and arranging, Solution due to the initial conditions Solution due to the input

8 i1=eye(2); %identity matrix with dimension 2x2 siA=s*i1-A;
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS clc;clear; syms s; A=[0 1; ]; i1=eye(2); %identity matrix with dimension 2x2 siA=s*i1-A; x0=[0.05;0]; %Initial conditions B=[0;0.05]; Fs=100/s; X=inv(siA)*x0+inv(siA)*B*Fs; pretty(X) For x(t) ; clc;clear; num=[ ]; den=[ ]; [r,p,k]=residue(num,den)

9 Initial value, x0 Steady-state value (Final value)
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS Steady-state value (Final value) Initial value, x0

10 [r,p,k]=residue(num,den)
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS For v(t) clc;clear; num=[-7.5]; den=[ ]; [r,p,k]=residue(num,den)

11 SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS
Example: Mathematical model of a mechanical system is defined as a system of differential equations as follows: where f is input, x1 are x2 outputs. At t=0 x1=2 and x2=-1. Find the eigenvalues of the system. If f is a step input having magnitude of 3, find x1(t). If f is a step input having magnitude of 3, find x2(t). Find the response of x1 due to the initial conditions. Find the response of x2 due to the initial conditions. How do you obtain [sI-A]-1 with MATLAB?

12 SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS
Let us obtain the State Variables Form so as to 1st order derivative terms are left-hand side and non-derivative terms are on the right-hand side. State Variables Form A B D(s)

13 Solution due to the initial conditions Homogeneous Solution
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS a) Eigenvalues are roots of the polynomial D(s) or eigenvalues of the matrix A. or General Solution Solution due to the initial conditions Homogeneous Solution Solution due to the input Particular Solution Initial Conditions b) x1(t) due to the forcing clc;clear; num=[ ]; den=[ ]; [r,p,k]=residue(num,den)

14 System is unstable because of the positive root.
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS System is unstable because of the positive root. c) x2(t) due to input clc;clear; num=[6 174]; den=[ ]; [r,p,k]=residue(num,den) Laplace transform of x2p

15 [r,p,k]=residue(num,den)
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS d) x1 due to the initial conditions. clc;clear; num=[2 -25]; den=[ ]; [r,p,k]=residue(num,den) e) x2 due to the initial conditions clc;clear; num=[-1 4]; den=[ ]; [r,p,k]= residue(num,den) f) [sI-A]-1 with Matlab. clc;clear; syms s; i1=eye(2) A=[-20 15;12 5]; a1=inv(s*i1-A) pretty(a1)

16 Write the equations in the form of state variables.
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS Example: Mathematical model of a system is given below. Where V(t) is input, q1(t) and q2(t) are outputs. Write the equations in the form of state variables. Write Matlab code to obtain eigenvalues of the system. Write Matlab code to obtain matrix [sI-A]-1. Results of (b) and (c) which are obtained by computer are as follows: 2 t (s) V2(t) At t=0 and V(t) is a step input having magnitude of 2. Find the Laplace transform of due to the initial conditions. e) Find the Laplace transform of q1 due to the input.

17 State variables clc;clear A=[-1.5 1.5 0;0 0 1;3.75 -3.75 0]; syms s;
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS a) State variables are q1, q2 and System of differential equations is arranged so as to 1st order derivative terms are left-hand side and non-derivative terms are on the right-hand side. A B State variables b) Matlab code which gives the eigenvalues of the system. A=[ ;0 0 1; ]; eig(A) c) Matlab code which produces [sI-A]-1 clc;clear A=[ ;0 0 1; ]; syms s; i1=eye(3); sia=inv(s*i1-A); pretty(sia)

18 SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS

19 SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS
Example: Mathematical model of a mechanical system having two degrees of freedom is given below. If F(t) is a step input having magnitude 50 Newtons, find the Laplace transforms of x and θ. R=0.2 m m=10 kg k=2000 N/m c=20 Ns/m State variables

20 clc;clear A=[0 0 1 0;0 0 0 1;-400 80 0 0;2000 -600 0 -2]; syms s;
SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS clc;clear A=[ ; ; ; ]; syms s; eig(A) i1=eye(4); sia=inv(s*i1-A); pretty(sia) If the initial conditions are zero, only the solution due to the input exists. Eigenvalues: System is stable since real parts of all eigenvalues are negative.

21 SYSTEM OF ORDINARY DIFFERENTIAL EQUATIONS


Download ppt "SYSTEM OF DIFFERENTIAL EQUATIONS"

Similar presentations


Ads by Google