You are on page 1of 5

TEACHER: Dr.

BILAL KHAN
LAB ENGINEER: Sir MASROOR
SUBJECT: CONTROL SYSTEM
LAB ASSIGNMENT: 3
CLASS: BCE-6A

NAME Registration Number

Ali Haroon Turk CIIT/ FA18-BCE -001/ATD

MARCH 25, 2021


Question:
Using matlab find the transfer function G(s)=X(s)/F(s) for the mechanical translational system
given below: (Hint: Find Equations of Motion and apply Crammer’s Rule)
Figure 1: I found the equation of motion of given mechanical system and then I converted
these equations from time domain into Frequency Domain using Laplace Transform. Then
I used Cramer’s Rule in MATLAB to find Transfer Functions
MATLAB CODE:

Figure 2: After finding the equation of motions and converting them to frequency domain,
I then used MATLAB to further solve these equations using Cramer’s Rule. First, I created
Array Z, then I created Array Ax1,Ax2 and Ax3 and replaced the column 1,2 and 3
respectively according to the rules of Cramer’s Rule method. After taking determinant and
dividing them, I then simplified all three equations using keywords ”simplify” and ”pretty”
and then I converted symbolic to polynomial for numerator and denominator separately.
Finally, I took the step response of all three transfer functions and plotted them.
Figure 3: Step responses of Transfer function X1(s)/F(s), X2(s)/F(s) and X3(s)/F(s).

CONCLUSION:
In this lab I learnt to calculate the Laplace transform and inverse Laplace transform. In MATLAB we
can use just one command “laplace(f(t))” to calculate the Laplace transform. While calculating the
inverse Laplace transform function F(s) we can use the command “ilaplace” in MATLAB, while
calculating the inverse Laplace transform, we often need to solve the partial fractions. MATLAB has a
command to obtain the partial fraction expansion of a function in the form B(s)/A(s). Then I learnt to
find the transfer function of a given system in MATLAB using Crammer’s Rule.

You might also like