LAB2_previus
LAB2_previus
Group Members:
Abdullah Shafiq : FA20-EPE-077
Muhammad Furqan khan: FA20-EPE-074
Submitted to:
Mam Zainab
Lab
02
A P C
TOTAL MARKS
OBTAINED MARKS
Mathematical Modeling of Electrical and Mechanical Systems Using
MATLAB/Simulink
Objective:
Every day we deal with different physical systems. Interesting fact is that motion or working of
these systems can be modeled mathematically and their behavior can be observed using
software’s like MATLAB. This feature helps us in the design of a system. Once the system
dynamic mathematical model is developed, we can transform it into frequency or time domain
representation to further analyze the system performance. In this lab students should be able to
mathematically model and simulate the system using MATLAB / Simulink environment.
Class work.
Introduction:
A basic RLC circuit is shown is the Figure.1. The system has a voltage source and voltage drops
across each element in the network as shown.
Its dynamic time domain model on terms of differential equations after following the KVL is
This is the cause of conversation of energy. As the sum of all voltage drops across each
component is equal to the total applied voltage. There is one resistive and two reactive
components in the network. The circuit is a simple series circuit where it has the same current in
the network.
For Vc:
A Simulink model is developed in the Figure 2. In this figure the dynamic mathematical model
(1) is developed in the Simulink environment. The system output is upto the choice of designer
for the given input.
Figure 2: RLC circuit modeled in the Simulink environment
This system could also be modeled in the identical manner using MATLAB/Simulink. The choice of the
output is up to the student for the given input:
For X:
Simulink circuit
OUTPUT
Task:
Statement of the TASK:
Use the MATLAB/Simulink environment to model and simulate the 3DOF system shown in
Figure 3. Take the step response and discuss the results. Provide the complete and solid analysis
on the system response. Lab report should be presented under the instructions provided in the
earlier lab.
The set of differential equations representing the 3 degree of freedom system
SOLUTION:
clc
clear all
close all
syms v s i1 i2 i3
A=[(4+2*s) -(1+2*s) -1;-(1+2*s) 5*s -(1+3*s);1 -(2+3*s) (1+3*s+5/s)];
A1=[v 0 0;-(1+2*s) 5*s -(1+3*s);1 -(2+3*s) (1+3*s+5/s)];
A2=[(4+2*s) -(1+2*s) -1;v 0 0;1 -(2+3*s) (1+3*s+5/s)];
A3=[(4+2*s) -(1+2*s) -1;-(1+2*s) 5*s -(1+3*s);v 0 0];
I1=det(A1)/det(A);
disp('I1=')
pretty(I1)
I2=det(A2)/det(A);
disp('I2=')
pretty(I2)
I3=det(A3)/det(A);
disp('I3=')
pretty(I3)
Simulink