Question

A classic second order system has transfer function G(s)where the symbols have their usual meanings. Take the undamped natura

A classic second order system has transfer function

the undamped natural frequency to be 10 rad/s throughout this exercise. Note, for the following MATLAB simulations you need to use format long defined at the top of the program to get full precision.

a) Use MATLAB to plot the step response for three damping factors of ζ =0.5,1 and 1.5 respectively. step(g,tfinal)_ where tfinal is the max time you need to make it 2 secs and g is the

b) Takeζ =1 and do the following. Assume a sampling frequency of fs=100Hz. Use the Bilinear Transform s 2z1 s T z1   − =     + and hence calculate the approximate discrete-time transfer function in terms of z. Write your solution in the form 2 1 2 2 1 2 z bz b G z gainX z az a ( )   + + =     + +

c) Use the MATLAB commands [numd1,dend1] = bilinear(num,den,fs) (converts from continuous to discrete-time) g2z= tf(numd1,dend1,ts) (where ts=1/fs) and find the MATLAB solution – compare the step response of the discrete model with the analogue version in a) d) Write down the difference equation obtained from MATLAB for ζ =0.5. e) Take your difference equation from

d) and write a computer program in Matlab to simulate a unit step response. (that is, for an input of unity, compute the output of the difference equation). Show the code and plot the result. Do not use a ready-made function such as step(), write the code from scratch using similar methods to the pseudo code method used in class. Run your program to 2.5 seconds. Show your code.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Part A

wn=10;
rho=[0.5 1 1.5];
for i=1:3
G(i)=tf([wn*wn],[1 2*rho(i)*wn wn*wn]);
end
step(G(1),G(2),G(3),2);legend('\rho=0.5','\rho=1','\rho=1.5');

Step Response p-0.5 p-1 p 1.5 1.2 0.8 0.6 0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Time (seconds)

Part B

0.01 s)- Iot0 200 ( 2+1 (2+1 100 21 2 문다 2포+ 54b 十2.3 2-7 441 1乙2-1982 +361 41 44

PART C

rho1=1;
fs=100;
[numd1,dend1]=bilinear([wn*wn],[1 2*rho1*wn wn*wn],100);
g2z=tf(numd1,dend1,1/fs);
display(g2z);
display(G(2));
step(g2z,G(2),2);legend('Discrete','Analog');

The output is:

g2z =

0.002268 z^2 + 0.004535 z + 0.002268
------------------------------------
z^2 - 1.81 z + 0.8186

G(2)=

100
----------------
s^2 + 20 s + 100

Step Response - Discrete -Analog 0.9 0.8 0.6 트 0.5 0.4 0.3 0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Time (seconds)

===========================================================================

PART D

10 100 oo24) 002 408002 202 20 + 2241422 :22 1222 798 2 38 42 42

========================================================================

PART E

2.5 seconds stands for 251 samples

n=0:1:250;
t=0:(1/100):2.5;
x=ones(1,length(n)); %unit step input
y(1)=1/421;
y(2)=(3+798/421)*(1/421);
for i=3:length(n)
y(i)=(x(i)+2*x(i-1)+x(i-2)+798*y(i-1)-381*y(i-2))*(1/421);
end
figure;stairs(t,y);

1.4 1.2 0.8 0.6 0.4 0.2 0.5 1.5 2.5

Add a comment
Know the answer?
Add Answer to:
A classic second order system has transfer function the undamped natural frequency to be 10 rad/s throughout this exercise. Note, for the following MATLAB simulations you need to use format long defi...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT