Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Introduction to MATLAB and Simulink, Solution of Differential Equations

Using MATLAB and Simulink and Transfer Function Based Modelling

PRE-LAB: IMPLEMENT EXAMPLE CIRCUIT IN SIMULINK.

In these tasks, circuit’s equation was implemented to obtain the output across capacitor. Circuit’s
equation was obtained by KVL and the resultant equation was in the form of derivative. Along
with the derivative equation, coefficients were multiplied with some terms as well. These
coefficients are denoted by Gain block in block diagram. Four different inputs were applied at
the input of same circuit i.e. step, impulse, ramp and sinusoidal as per demanded in the question.

Block Diagram using Unit step as input:

Block Diagram using Unit Impulse as input:


Block Diagram using Ramp as input:
Block Diagram using Sinusoid as input:

IN-LAB TASKS:
TASK 1: CONSIDERING G(S), PROVE THAT TF2ZP() AND ZP2TF() ARE INVERSE
OF EACH OTHER. ALSO, PROVE THAT LAPLACE() AND ILAPLACE() EXHIBITS
THE SAME PROPERTY.

s+ 0.25
G(s) =
s (s +1)(s +2)( s+ 3)

MATLAB Code:

TASK 2: FIND INVERSE LAPLACE TRANSFORM F(T) & HENCE FIND INVERSE
FROM PARTIAL FRACTION FORM (USE MATLAB TO COMPUTE THE RESIDUES)
WHERE:

s 5+ 8 s 4 +233 +35 s2 +28 s +3


F(s) =
s 3 +6 s 2 +8 s
TASK 3: CONSIDER THE FOLLOWING RLC CIRCUIT AND TAKE VALUES OF
YOUR CHOICE. MAKE A MATHEMATICAL EQUATION OF THIS CIRCUIT AND
THEN MAKE ITS SIMULINK BLOCK DIAGRAM.

R= 28Ω.

L= 30H.

C= 32F.

Derivation:

−V i + V R +V L +V o = 0;

Ldi
−V i + IR+ +V o = 0;
dt

CdV
Put I c= ;
dt

CdV
Ld ( )
CdV dt = 0;
−V i + R+ +V o
dt dt

Cd V o LC d 2 V o
−V i + R+ +V o = 0;
dt dt 2

After substituting values,

d2V o dVo
2
=0.001V i−0.0010V 0 −0.93
dt dt
Block diagram according to the equation is designed and implemented in SIMULINK. RLC
circuit was given to compute the differential equation. Different inputs are applied at the input
and graphs are attached accordingly.

Block Diagram for Unit Step input:


Block Diagram for Impulse input:

Block Diagram for Ramp input:


Block Diagram for Sinusoidal input:

POST-LAB TASK:
TASK 1: SOLVE THE DIFFERENTIAL EQUATION TO COMPUTE X(T):

X’’+2X’+10X = t 2

Solution:

d2 x dx
2 + 2 +10 = t 2;
dt dt

d2 x dx
2 = - 2 -10 + t 2;
dt dt

Block Diagram for Unit Step input:

Block Diagram for Impulse input:


Block Diagram for Sinusoidal input:
Block Diagram for ramp input:

TASK 2: USE THE MATHEMATICAL MODEL, COMPUTED IN IN-LAB TASK 02,


AND FIND ITS STATE SPACE REPRESENTATION USING MATLAB.
CRITICAL ANALYSIS:
In this lab we learned about transfer functions in MATLAB and the
implementation of control systems in MATLAB using Simulink block diagram.
There are many functions used for building linear models in MATLAB. We
came to know about the different commands of the MATLAB and performed
various tasks to explore them. There are normally four types of representations
are used in MATLAB for representing linear models. This lab also concerned
the transfer function-based modelling i.e. plotting, calculating different
parameters of a same transfer function. Furtherly, we verified the same results
using different commands to learn that one thing can be achieved through many
ways.

You might also like