% Compute step response for a second-order syste num=1; t=0:0.1:12; zeta2=0.2; den2= [1 zeta1=0.1; den1= [1 2*zeta1 1]; sys1=tf(num, den1); 2*zeta2 1]; sys2=tf(num, den2); zeta3=0.4; den3= [1 2*zeta3 1]; sys3=tf(num, den3); zeta4=0.7; den4= [1 2*zeta4 1]; sys4=tf(num, den4); zeta5=1.0; den5= [1 2*zeta5 1]; sys5=tf(num, den5); zeta6=2.0; den6= [1 2*zeta6 1]; sys6=tf(num, den6);

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Can you please explain what every line of code does in this script written in Matlab. 

123456
78
9
1010341516
12
% Compute step response for a second-order system
t=0:0.1:12; num=1;
zeta1=0.1;
den1= [1 2*zeta1
den2= [1 2*zeta2
zeta2=0.2;
1]; sys1=tf(num, den1);
1]; sys2=tf(num, den2);
zeta3=0.4; den3=[1 2*zeta3 1]; sys3=tf(num, den3);
zeta4=0.7; den4=[1 2*zeta4 1]; sys4=tf(num, den4);
zeta5=1.0; den5= [1 2*zeta5 1]; sys5=tf(num, den5);
zeta6=2.0; den6= [1 2*zeta6 1]; sys6=tf(num, den6);
%
[y1, T1]=step (sys1,t); [y2, T2]=step(sys2,t);
[y3, T3]=step (sys3, t); [y4, T4]=step(sys4,t);
[y5, T5]=step(sys5,t); [y6, T6]=step(sys6,t);
%
plot (T1, y1, T2, y2, T3, y3, T4, y4, T5, y5, T6, y6)
xlabel('\omega_n t'), ylabel('y(t)')
title('\zeta =
0.1, 0.2, 0.4, 0.7, 1.0, 2.0'), grid
Transcribed Image Text:123456 78 9 1010341516 12 % Compute step response for a second-order system t=0:0.1:12; num=1; zeta1=0.1; den1= [1 2*zeta1 den2= [1 2*zeta2 zeta2=0.2; 1]; sys1=tf(num, den1); 1]; sys2=tf(num, den2); zeta3=0.4; den3=[1 2*zeta3 1]; sys3=tf(num, den3); zeta4=0.7; den4=[1 2*zeta4 1]; sys4=tf(num, den4); zeta5=1.0; den5= [1 2*zeta5 1]; sys5=tf(num, den5); zeta6=2.0; den6= [1 2*zeta6 1]; sys6=tf(num, den6); % [y1, T1]=step (sys1,t); [y2, T2]=step(sys2,t); [y3, T3]=step (sys3, t); [y4, T4]=step(sys4,t); [y5, T5]=step(sys5,t); [y6, T6]=step(sys6,t); % plot (T1, y1, T2, y2, T3, y3, T4, y4, T5, y5, T6, y6) xlabel('\omega_n t'), ylabel('y(t)') title('\zeta = 0.1, 0.2, 0.4, 0.7, 1.0, 2.0'), grid
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education