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

Feedback Nise Matlab

The document discusses various ways to analyze and plot the response of a continuous-time transfer function model in MATLAB. It includes examples of step response and impulse response plotting, linear simulation with a sinusoidal input, initializing the system with non-zero initial conditions, Bode plot, Nyquist plot, Nichols chart, and time response plotting. The transfer function model is defined as sys = tf([0 3 1],[1 7 5 1 0]).

Uploaded by

Ken
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)
75 views

Feedback Nise Matlab

The document discusses various ways to analyze and plot the response of a continuous-time transfer function model in MATLAB. It includes examples of step response and impulse response plotting, linear simulation with a sinusoidal input, initializing the system with non-zero initial conditions, Bode plot, Nyquist plot, Nichols chart, and time response plotting. The transfer function model is defined as sys = tf([0 3 1],[1 7 5 1 0]).

Uploaded by

Ken
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/ 8

2.

MATLAB - MECHANICAL FUNCTION

Source Code:

syms X; 'F(s)'
syms F; pretty(F)
syms G; 'TRANSFER FUNCTION'
X = 3*s+1; pretty(G)
F = (s*(s^3+7*s^2+5*s+1)); g=ilaplace(G);
G = (X)/(F); 'INVERSE LAPLACE'
'X2(s)' pretty(g)
pretty(X)

Computer Response:
3. Plotting

A. Step Response and Impulse Response

Source Code:

sys = tf([0 3 1],[1 7 5 1 0])

subplot(2,1,1)

step(sys)

subplot(2,1,2)

impulse(sys)

Computer Response:

sys =

3s+1

-----------------------

s^4 + 7 s^3 + 5 s^2 + s

Continuous-time transfer function.


B. Linear Simulation Plot

Source Code:

sys = tf([0 3 1],[1 7 5 1 0])

clf

t = 0:0.01:4;

u = sin(10*t);

lsim(sys,u,t) % u,t define the input signal

Computer Response:

sys =

3s+1

-----------------------

s^4 + 7 s^3 + 5 s^2 + s

Continuous-time transfer function.


C. Response Initial Conditions.

Source Code:

sys = tf([0 3 1],[1 7 5 1 0])

A = [-0.8 3.6 -2.1;-3 -1.2 4.8;3 -4.3 -1.1];

B = [0; -1.1; -0.2];

C = [1.2 0 0.6];

D = -0.6;

G = ss(A,B,C,D);

x0 = [-1;0;2]; % initial state

initial(G,x0)

grid

Computer Response:

sys =

3s+1

-----------------------

s^4 + 7 s^3 + 5 s^2 + s

Continuous-time transfer function.


D. BODE PLOT

Source Code:

sys = tf([0 3 1],[1 7 5 1 0])

bode(sys)

grid

Computer Response:

sys =

3s+1

-----------------------

s^4 + 7 s^3 + 5 s^2 + s

Continuous-time transfer function.


E. Nyquist Diagram

Source Code:

sys = tf([0 3 1],[1 7 5 1 0])

nyquist(sys)

grid

Computer Response:

sys =

3s+1

-----------------------

s^4 + 7 s^3 + 5 s^2 + s

Continuous-time transfer function.


F. Nichols Chart

Source Code:

sys = tf([0 3 1],[1 7 5 1 0])

nichols(sys)

grid

Computer Response:

sys =

3s+1

-----------------------

s^4 + 7 s^3 + 5 s^2 + s

Continuous-time transfer function.


G. Time Response

Source Code:

sys = tf([0 3 1],[1 7 5 1 0])

[y,t] = impulse(sys,linspace(1,3,200));

opts = timeoptions;

opts.Grid = 'on';

impulseplot(sys,opts)

Computer Response:

sys =

3s+1

-----------------------

s^4 + 7 s^3 + 5 s^2 + s

Continuous-time transfer function.

You might also like