chapter 3 dynamic response
Download
Skip this Video
Download Presentation
Chapter 3: Dynamic Response

Loading in 2 Seconds...

play fullscreen
1 / 47

Chapter 3: Dynamic Response - PowerPoint PPT Presentation


  • 124 Views
  • Uploaded on

Chapter 3: Dynamic Response. Part C: Transient-response analysis with MATLAB. Introduction. The practical procedure for plotting time response curves of systems higher than second-order is through computer simulation .

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Chapter 3: Dynamic Response' - jalia


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
chapter 3 dynamic response

Chapter 3: Dynamic Response

Part C: Transient-response analysis with MATLAB.

introduction
Introduction
  • The practical procedure for plotting time response curves of systems higher than second-order is through computer simulation.
  • In this part, computational approach to the transient-response analysis with MATLAB is presented through various examples.
representation of a linear system
Representation of a Linear System

A linear system can be representedeither:

  • In state-variable form:

with the values of the matrices F, G, H and the constant J.

Or

  • By its transfer function:

Either in numerator-denominator polynomial form,

Or in pole-zero form

Or in partial expansion form

example 1 standard state variable form
Example 1: Standard State-Variable Form
  • Consider a linear system described by:
unit step response for a control system defined in state variable form
F = [0 1;0 -0.05];

G = [0;0.001];

H = [0 1];

J = 0;

step(F,G,H,J)

% defines state variable matrices

% generates plot of unit-step response (with Time (sec)and Amplitudelabels on x- and y-axis respectively, andStep responsetitle )

Note: time vector is automatically determined when t is not explicitly included in the step command.

Unit-Step Response for a Control System defined in State-Variable form
50 step response for a system defined in state variable form
F = [0 1;0 -0.05];

G = [0;0.001];

H = [0 1];

J = 0;

sys = ss(F, 50*G, H, J);

step(sys)

% defines state variable matrices

% defines system by its state-space

matrices

% generates plot of 50-step response vs t

Note:State-variable form is also called state-space form

50-Step Response for a system defined in State-Variable form
unit step response on specific time interval for a system defined in state variable form
F = [0 1;0 -0.05];

G = [0;0.001];

H = [0 1];

J = 0;

sys = ss(F, G, H, J);

t = 0:0.2:100;

y=step(sys,t);

plot(t,y)

% defines state variable matrices

% defines system by its state-space

matrices

% setup time vector ( dt = 0.2 sec)

% plots unit step response versus time ranging from 0 to 100 sec (with x- and y-labels)

Unit-Step Response on specific time interval for a system defined in State-Variable form
impulse response for a system defined in state variable form
F = [0 1;0 -0.05];

G = [0;0.001];

H = [0 1];

J = 0;

sys = ss(F, G, H, J);

impulse(sys)

% defines state variable matrices

% defines system by its state-space

matrices

% generates plot of impulse response

(with labels & title)

Note: an alternative use of impulse command is:

impulse(F,G,H,J)

Impulse Response for a system defined in State-Variable form
example 2 initial conditions
Example 2: Initial Conditions
  • Consider a linear system such as:
  • In state-variable form, it is described by:
initial condition response for a system defined in state variable form
F = [0 1;-10 -5];

G = [0;0];

H = [1 0];

J = 0;

t = 0:0.5:3;

y=initial(F,G,H,J,[2;1],t);

plot(t,y)

% defines state variable matrices

% set up time vector

% computes initial condition response

% generates plot of response

Note: Initial conditions are defined between [ ].

Initial Condition Response for a system defined in State-Variable form
example 3 transfer function in numerator denominator form
Example 3: Transfer function in numerator-denominator form
  • Consider a linear system whose the transfer function is:
unit step response for a system transfer function defined in num den polynomial form
num = [0 0 25];

den = [1 4 25];

step(num,den)

% defines numerator

% defines denominator

% generates plot of unit-step response (with labels and title)

Unit-Step Response for a system Transfer Function defined in num/den polynomial form
50 step response for a system transfer function defined in num den polynomial form
num = [0 0 50];

den = [1 0.2 1];

step(num,den)

% defines numerator

% defines denominator

% generates plot of 50-step response (with labels and title)

50-Step Response for a system Transfer Function defined in num/den polynomial form
unit step responses for system transfer functions defined by
t = 0:0.2:10;

zeta = [0 0.2 0.4 0.6 0.8 1];

for n = 1:6;

num = [0 0 1];

den = [1 2*zeta(n) 1];

[y(1:51,n),x, t] = step(num,den,t);

end

plot(t,y)

% setup time vector

% defines zeta,

numerator and

denominator

% generates 2-D plot of the n unit-step responses (on same graph)

Unit-Step Responses for system Transfer Functions defined by
unit step responses for system transfer functions defined by1
t = 0:0.2:10;

zeta = [0 0.2 0.4 0.6 0.8 1];

for n = 1:6;

num = [0 0 1];

den = [1 2*zeta(n) 1];

[y(1:51,n),x, t] = step(num,den,t);

end

mesh(t,zeta,y’)

% setup time vector

% defines zeta,

numerator and

denominator

% generates 3-D plot of the n unit-step responses (on same graph)

Unit-Step Responses for system Transfer Functions defined by
unit step response for a 3 rd order system defined by its transfer function
num = [0 0 0 1];

den = [1 1 1 0];

step(num,den)

% defines numerator

% defines denominator

% generates plot of unit-step response (with x- and y-labels)

Unit Step Response for a 3rd order system defined by its Transfer Function
impulse response for a system transfer function defined in num den polynomial form
num = [0 0 1];

den = [1 0.2 1];

sys=tf(num,den);

impulse(sys)

% defines numerator

% defines denominator

% defines system by its transfer function

% generates plot of impulse response

Note: an alternative use of impulse command is:

impulse(num,den)

Impulse Response for a system Transfer Function defined in num/den polynomial form
alternative approach to obtain impulse response
num = [0 1 0];

den = [1 0.2 1];

step(num,den)

% defines numerator of sG(s)

% defines denominator

% generates plot of impulse response (with x- and y-labels)

Alternative approach to obtain Impulse Response
example 4 transfer function in standard 2 nd order system
Example 4: Transfer function in standard 2nd order system
  • Consider a standard second order system:

natural

undamped

frequency

damping

ratio

matlab description of standard second order system
w0 = 5;

damping_ratio = 0.4;

[num0,den] = ord2(w0,damping_ratio);

num = 5^2*num0;

printsys(num,den,’s’)

% defines natural undamped frequency

% defines damping ratio

% defines numerator

% prints num/den as a ratio of s-polynomials

num/den =

MATLAB Description of Standard Second Order System
example 5 transfer function in pole zero form
Example 5: Transfer function in pole-zero form
  • Consider a linear system whose the transfer function is:
unit step response for a system transfer function defined in pole zero form
num = conv([1 2],[1 4]);

den = conv([1 1 0],[1 3]);

step(num,den)

% defines zero ratios

% defines pole ratios

% plots unit-step response

Unit-Step Response for a system Transfer Function defined in pole-zero form
example 6 transfer function in partial expansion form
Example 6: Transfer function in Partial Expansion Form
  • Consider a linear system whose the transfer function is:
unit step response for a system transfer function defined in partial expansion form
r = [8/3 -3/2 -1/6];

p = [0 -1 -3];

K = [] ;

[num,den] = residue(r,p,K)

step(num,den)

% defines residues

% defines poles

% define additive constant

% convert partial expansion form to polynomial form

% plots unit-step response

Note: to see ratio use

printsys(num,den,’s’)

Unit-Step Response for a system Transfer Function defined in partial expansion form
convertion
State-variable form

Transfer function:

In num-den polynomial form

In zero-pole form

In partial expansion form

Convertion

[num,den] = ss2tf(F,G,H,J)

[z,p,k]=tf2zp(num,den)

[r,p,K]=residue(num,den)

[z,p,k] = ss2zp(F,G,H,J)

convertion1
State-variable form

Transfer function:

In num-den polynomial form

In zero-pole form

In partial expansion form

Convertion

[F,G,H,J] = tf2ss(num,den)

[num,den]=zp2tf(z,p,k)

[num,den]=residue(r,p,K)

[F,G,H,J] = zp2ss(z,p,k)

title grid labels on the graphical screen
title (‘Step-response’);

grid;

sys = …;

t = 0:0.2:100;

y = step(sys,t);

plot (t,y);

xlabel(‘t (sec)’);

ylabel(‘response’)

% writes the title Step-response

% draws a grid between ticks

% defines system by …

% setup time vector ( dt = 0.2 sec)

% computes step response

% plots step response

% writes label t (sec) on x-axis.

% writes label response on y-axis.

Title, Grid & Labels on the graphical screen
writing text on the graphical screen
text(3.4, -0.06, ‘Y111’);

text(4.1,1.86,’\zeta’);

gtext(‘blabla’)

% writes Y111 beginning at the coordinates x=3.4, y=-0.06.

% writes  at x=4.1, y=1.86

% waits until the cursor is positioned (using the mouse) at the desired position in the screen and then writes on the plot at the cursor’s location the text enclosed in simple quotes.

Note: any number of gtext command can be used in a plot.

Writing Text on the Graphical Screen
use of symbols in graph
num = [0 0 25];

den = [1 6 25];

t = 0:0.5:5;

y = step(num,den,t);

plot(t,y,’o’,t,1,’-’);

% defines numerator

% defines denominator

% defines time vector

% computes unit-step response

% plot of unit step response y and unit step input 1 using oooo and ---- symbols respectively.

Use of Symbols in graph
use of symbols in graph cont d
num = [0 0 25];

den = [1 6 25];

t = 0:0.5:5;

y = step(num,den,t);

plot(t,y,’x’,t,y,’-’);

% defines numerator

% defines denominator

% defines time vector

% computes step response

% plot of unit step response y using -x-x-x-x- symbols

Use of Symbols in graph (cont’d)
additional convenient matlab commands
Computing roots using MATLAB

Plotting pole(s) and zero(s) in the s-plane using MATLAB

Plotting Step-response versus a parameter range

Obtaining rise time, peak time, maximum overshoot and settling time using MATLAB

Additional Convenient MATLAB Commands
computing roots
pol= [1 4 3 2 1 4 4];

roots(pol)

ans =

-3.2644

-0.6046 + 0.9935i

-0.6046 - 0.9935i

0.6797 + 0.7488i

0.6797 - 0.7488i

-0.8858

Computing Roots
stability analysis by computing roots
den= [1 5 11 23 28 12];

roots(den)

ans =

-3.0000

0.0000 + 2.0000i

0.0000 - 2.0000i

-1.0000 + 0.0000i

-1.0000 - 0.0000i

Stability Analysis by Computing Roots

2 poles are in the RHP

plotting poles and zero in the s domain
num=[0 2 1];

den= [2 3 2];

zmap(num,den)

Plotting Poles and Zero in the s-domain

poles as crosses

zero as circle

step response versus a parameter range
xlabel(\'Time (sec)\');

ylabel(\'Amplitude\');

Title(\'Step-Response

versus K parameter\');

grid;

text(7.1,3.8,\'K=6.5\');

text(7.5,3.15,\'7\');

text(7.15,2.65,\'7.5\');

text(7.1,2.3,\'8\');

text(6.65,1.37,\'10\');

text(6.4,0.75,\'12.5\');

t=0:0.1:10;

K=[6.5 7 7.5 8 10 12.5];

for n=1:6

num=[K(n) K(n)];

den=[1 5 K(n)-6 K(n)];

[y(1:101,n),x,t]=step(num,den,t);

end

plot(t,y);

Step-Response versus a Parameter Range
reminder rise time
Reminder: Rise Time
  • The rise time is the time requiredfor the responseto rise from 0% to 100% of its final value.

1

t

d

0.5

0

t

r

Note: for overdamped systems, the 10%

to 90% rise time is commonly used.

computing rise time using m atlab
num= [0 0 25];

den=[1 6 25];

t=0:0.001:5;

[y,x,t]=step(num,den,t);

r=1;

while y(r) <1.0001;

r=r+1;

end;

rise_time=(r-1)*0.001

rise_time =

0.5540

Computing Rise Time using MATLAB

No ;

reminder peak time
Reminder: Peak Time
  • The peak time is the time requiredfor the responseto reach the first peak of the overshoot.

t

p

1

t

d

0.5

0

t

r

computing peak time using matlab
num= [0 0 25];

den=[1 6 25];

t=0:0.001:5;

[y,x,t]=step(num,den,t);

[ymax,tp]=max(y);

peak_time=(tp-1)*0.001

peak_time =

0.7850

Computing Peak Time using MATLAB

No ;

reminder maximum overshoot
Reminder: Maximum Overshoot
  • The maximum overshoot is the relative maximum peak value of the response curve measured from the final value.

t

p

M

p

1

t

d

0.5

0

t

r

Note: the maximum overshoot directly indicates

the relative stability of the system.

computing maximum overshoot using matlab
num= [0 0 25];

den=[1 6 25];

t=0:0.001:5;

[y,x,t]=step(num,den,t);

[ymax,tp]=max(y);

peak_time=(tp-1)*0.001

max_overshoot=ymax-1

peak_time =

0.7850

max_overshoot =

0.0948

Computing Maximum Overshoot using MATLAB
reminder settling time
Reminder: Settling Time
  • The settling time is the time required for the response curve to reach and stay within a range about1% or 2% of the final steady-state value.

t

p

M

p

±1%

1

t

d

0.5

0

t

t

r

s

Note:t is the time it takes the

system transients to decay.

s

computing settling time using matlab based on 2
num= [0 0 25];

den=[1 6 25];

t=0:0.001:5;

[y,x,t]=step(num,den,t);

s=5001;

while y(s)>0.98 & y(s)<1.02;

s=s-1;

end;

settling_time=(s-1)*0.001

settling_time =

1.1880

Computing Settling Time using MATLAB(based on +/-2%)
slide47
Results given by MATLAB are:

rise_time = 0.5540; peak_time = 0.7850,

max_overshoot = 0.0948, settling_time = 1.1880

ad