0% found this document useful (0 votes)
319 views

Assignment 1 Solution

This document contains the solutions to three questions regarding modeling systems using transfer functions in MATLAB. For the first question, a transfer function is created to model a car with mass m and coefficient of friction b, and its step response is plotted. The second question plots the impulse and step responses of a different transfer function. The third question discusses how changing the values of b and m in the first transfer function affects the pole location and the time it takes for transients to decay. Plots are provided comparing the impulse responses for different values of b and m.

Uploaded by

M Faizan Farooq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
319 views

Assignment 1 Solution

This document contains the solutions to three questions regarding modeling systems using transfer functions in MATLAB. For the first question, a transfer function is created to model a car with mass m and coefficient of friction b, and its step response is plotted. The second question plots the impulse and step responses of a different transfer function. The third question discusses how changing the values of b and m in the first transfer function affects the pole location and the time it takes for transients to decay. Plots are provided comparing the impulse responses for different values of b and m.

Uploaded by

M Faizan Farooq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Solution to Assignment 1

Question 1:
Code:
clear all;
close all;
clc;

b = 50; % Coefficient of Friction
m = 1000; % Mass of the car
u = 500; % Step force

Num = [1/m]; % Numerator
Den = [1, b/m]; % Denominator
sys=tf(Num,Den); % Transfer Function

figure,
step(u*sys); % Plots step response with amplitude 'u'


Question 2:
Code:
clear all;
close all;
clc;

Num = [2 1]; % Numerator
Den = [1 2 5]; % Denominator
sys=tf(Num,Den); % Transfer Function

figure,
Step Response
Time (sec)
A
m
p
l
i
t
u
d
e
0 20 40 60 80 100 120
0
1
2
3
4
5
6
7
8
9
10
System: untitled1
Settling Time (sec): 78.2
System: untitled1
Final Value: 10
System: untitled1
Final Value: 10
System: untitled1
Rise Time (sec): 43.9
impulse(sys); % Plots impulse response

figure,
step(sys); % Plots step response with amplitude '1'

Impulse Response:

Step Response:

Question 3:
Impulse Response
Time (sec)
A
m
p
l
i
t
u
d
e
0 1 2 3 4 5 6
-1
-0.5
0
0.5
1
1.5
2
System: sys
Settling Time (sec): 3.47
System: sys
Settling Time (sec): 3.47
Step Response
Time (sec)
A
m
p
l
i
t
u
d
e
0 1 2 3 4 5 6
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
System: sys
Peak amplitude: 0.625
Overshoot (%): 212
At time (sec): 0.663
System: sys
Settling Time (sec): 4.4
System: sys
Settling Time (sec): 4.4
System: sys
Rise Time (sec): 0.0875
Related to Question 1, factor b/m is a real pole on sigma axis in S-domain. Adjusting values of b or m
or both affects the time constant of the system. The observations are consistent with the fact that
system transients decay faster with increasing value of sigma see figures below:


0 20 40 60 80 100 120
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x 10
-3
Impulse Response
Time (sec)
A
m
p
l
i
t
u
d
e
b = 50, m= 1000
0 10 20 30 40 50 60
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x 10
-3
Impulse Response
Time (sec)
A
m
p
l
i
t
u
d
e
b=100, m=1000

0 20 40 60 80 100 120 140 160 180
0
1
2
3
4
5
6
7
8
x 10
-4
Impulse Response
Time (sec)
A
m
p
l
i
t
u
d
e
b=50, m=1500

You might also like