Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
1. 2 | L a b 2
Task 1: Find the Laplace transform of the following functions.
1) g(t)= sin(t)
>> syms t w
>>g=sin(w*t)
g =
sin(t*w)
>> laplace(g)
ans =
w/(s^2 + w^2)
2) g(t) =
>> syms t
>> g=t^2
g =
t^2
>> laplace(g)
ans =
2/s^3
3) g(t) =
>> syms t a
>> g=exp(a*t)
g =
exp(a*t)
>> laplace(g)
2. 3 | L a b 2
ans =
-1/(a - s)
4) g(t) =5t
>> syms t
>> g=5*t*exp(-5*t)
g =
5*t*exp(-5*t)
>> laplace(g)
ans =
5/(s + 5)^2
5) g(t) = 2 sin(2t)
>> syms t
>> g=2*exp(-2*t)*sin(2*t)
g =
2*sin(2*t)*exp(-2*t)
>> laplace(g)
ans =
4/((s + 2)^2 + 4)
Comments: In Matlab we can find Laplace transform of a function using command
laplace(function). It will give us the exact output of the function.
3. 4 | L a b 2
Task 2: Find Inverse Laplace transform following time domain signals.
1) G(s) =
>> syms s
>> g= (5*s+3)/((s+2)*(s+3))
g =
(5*s + 3)/((s + 2)*(s + 3))
>> ilaplace(g)
ans =
12*exp(-3*t) - 7*exp(-2*t)
2) G(s) =
>> syms s
>> g=1/(s*(s+2))
g =
1/(s*(s + 2))
>> ilaplace(g)
ans =
1/2 - exp(-2*t)/2
3) G(s) =
>> syms s
>> g=100*(s+2)/((s+2)*(s+3))
g =
(100*s + 200)/((s + 2)*(s + 3))
>> ilaplace(g)
4. 5 | L a b 2
ans =
100*exp(-3*t)
4) G(s) =
>> syms s
>> g=(s+3)/(s^2+5*s+2)
g =
(s + 3)/(s^2 + 5*s + 2)
>> ilaplace(g)
ans =
exp(-(5*t)/2)*(cosh((17^(1/2)*t)/2) + (17^(1/2)*sinh((17^(1/2)*t)/2))/17)
5) G(s) =
>> syms s
>> g=(4*s^2+16*s+12)/(s^3+44*s^2+48*s+12)
g =
(4*s^2 + 16*s + 12)/(s^3 + 44*s^2 + 48*s + 12)
>> ilaplace(g)
ans =
12*sum(exp(r3*t)/(3*r3^2 + 88*r3 + 48), r3 in RootOf(s3^3 + 44*s3^2 + 48*s3 + 12, s3)) +
16*sum((r3*exp(r3*t))/(3*r3^2 + 88*r3 + 48), r3 in RootOf(s3^3 + 44*s3^2 + 48*s3 + 12,
s3)) + 4*sum((r3^2*exp(r3*t))/(3*r3^2 + 88*r3 + 48), r3 in RootOf(s3^3 + 44*s3^2 + 48*s3
+ 12, s3))
Comments: In Matlab we can find Inverse Laplace transform of a function using
command ilaplace(function). It will give us the exact output of the function.
5. 6 | L a b 2
Task 3: Find partial fraction with residue command
1)
>> n=[1 3 1]
n =
1 3 1
>> d=[1 3 3 1]
d =
1 3 3 1
>> [R P k]=residue(n,d)
R =
1.0000
1.0000
-1.0000
P =
-1.0000
-1.0000
-1.0000
k =
[]
=
6. 7 | L a b 2
2)
>> n=[23 28 35 3]
n =
23 28 35 3
>> d=[1 16 8 2]
d =
1 16 8 2
>> [R P k]=residue(n,d)
R =
1.0e+02 * -3.4158
0.0079 + 0.0065i
0.0079 - 0.0065i
P =
-15.4919
-0.2540 + 0.2541i
-0.2540 - 0.2541i
k =
23
=
7. 8 | L a b 2
>> n=[4 16 12]
n =
4 16 12
>> d=[1 12 44 0 48]
d =
1 12 44 0 48
>> [R P k]=residue(n,d)
R =
-0.1425 - 0.3256i
-0.1425 + 0.3256i
0.1425 - 0.1459i
0.1425 + 0.1459i
P =
-6.1372 + 2.9440i
-6.1372 - 2.9440i
0.1372 + 1.0085i
0.1372 - 1.0085i
k =
[]
Comments: In Matlab we can find partial fraction using residue(x,y) command. It will give
us the exact output of the function.
8. 9 | L a b 2
>> n=3
n =
3
>> d=[1 4 3]
d =
1 4 3
>> sys=tf(n,d)
sys =
3
-------------
s^2 + 4 s + 3
Continuous-time transfer function.
>> step(sys)
9. 10 | L a b 2
a) When Vin = 1V
b) When Vin = 3V
0 1 2 3 4 5 6 7 8
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Step Response
Time (seconds)
Amplitude
0 1 2 3 4 5 6 7 8
0
0.5
1
1.5
2
2.5
3
Step Response
Time (seconds)
Amplitude
10. 11 | L a b 2
c) When Vin = 5V
d) When Vin = 10V
0 1 2 3 4 5 6 7 8
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Step Response
Time (seconds)
Amplitude
0 1 2 3 4 5 6 7 8
0
1
2
3
4
5
6
7
8
9
10
Step Response
Time (seconds)
Amplitude
11. 12 | L a b 2
>> n=1
n =
1
>> d=[1.2 3 5]
d =
1.2000 3.0000 5.0000
>> sys=tf(n,d)
sys =
1
-----------------
1.2 s^2 + 3 s + 5
Continuous-time transfer function.
>> step(sys); grid
12. 13 | L a b 2
Using SIMULINK:
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0.05
0.1
0.15
0.2
0.25
Step Response
Time (seconds)
Amplitude
0 1 2 3 4 5 6 7 8 9 10
0
0.05
0.1
0.15
0.2
0.25
13. 14 | L a b 2
(1)
Similarly
0 =
0 =
0 = (2)
Similarly
0 =
0 = (3)
Now using Matlab
>> syms I V z s
>> I=[i1; i2; i3];
>> V=[v;0;0];
>> z=[2+2*s -1-2*s -1; -1-2*s 7+5*s -1-2*s; -1 -3-3*s 3+3.2*s]
15. 16 | L a b 2
>> TFtn=Vout/V
TFtn=
(20*(3*s^2 + 7*s + 5))/(18*s^3 + 105*s^2 + 149*s + 55)
>>VL= (I(1)-I(2))*2
VL=
(2*(25*s^2 + 71*s + 45))/(18*s^3 + 105*s^2 + 149*s + 55) - (4*(8*s^2 + 14*s + 5))/(18*s^3
+ 105*s^2 + 149*s + 55)
Conclusion:
In this lab I observed the response of different physical systems using Matlab in frequency
domain. The motion or working of these systems can be modeled mathematically and their
behavior can be observed using software like Matlab. This feature helps us in designing of a
system. An important tool used in control system is Laplace transform which helps us in
development of system mathematical model and its analysis using transfer function. After
finding transfer function, we can simulate it in Matlab that give us output response of that
system for a given input.