Top Banner
An Introduction To MatLAB & Simulink
27

-stability bode nyquist pdf-

Apr 11, 2015

Download

Documents

api-3755845

Introduction To MatLAB& Simulink : MatLAB soft and Simulink from Matworks extra-simplified the best tutorial ever seen before (for me !!! )
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: -stability bode nyquist  pdf-

An Introduction To MatLAB &

Simulink

Page 2: -stability bode nyquist  pdf-

Basic MatLAB CommandsMatLAB Syntax:Do Not Display Results: Comma

after command

Matrix Creation: [1 2; 3 4] = ⎥⎦

⎤⎢⎣

⎡4321

Page 3: -stability bode nyquist  pdf-

Basic MatLAB PlottingPlotting x and y: plot(x(),y())

Transfer FunctionTf([ Numerator Coefficients],[ Denominator Coefficients])

i.e. sys = tf([1],[1 3 2]);

231

2 ++=

sssys

Page 4: -stability bode nyquist  pdf-

Basic MatLAB CommandsConversionsTransfer Function To State Space [A,B,C,D] = tf2ss([Num],[Den]);

State Space To Transfer Function [Num, Den] = ss2tf(A,B,C,D);

Transfer Function To Zero/Poles [z,p,k] = tf2zp([Num],[Den]);

Zero/Poles To Transfer Function [Num, Den] = zp2tf(z,p,k);

State Space To Zero/Poles [z,p,k] = ss2zp(A,B,C,D,iu);

Zero/Poles To State Space [A,B,C,D] = zp2ss(z,p,k);

Page 5: -stability bode nyquist  pdf-

Basic MatLAB Commands

Page 6: -stability bode nyquist  pdf-

Basic MatLAB CommandsSymbolic Variables syms variable;

i.e. syms tLaplace Transforms laplace(function);

i.e. syms t;f = sin(t);laplace(f)

Inverse Laplace Transforms ilaplace(function);i.e. syms s;

f = (s+1)/(s^2+3s+2);ilaplace(f)

Page 7: -stability bode nyquist  pdf-

Basic MatLAB CommandsIntegration int(function, variable)

i.e. syms x;f = sin(x);int(f,x)

Differentiation diff(function, variable)i.e. syms x;

f = sin(x);diff(f,x)

Page 8: -stability bode nyquist  pdf-

Basic MatLAB Commands: Examples

Page 9: -stability bode nyquist  pdf-

MatLAB: Special

Characters

Page 10: -stability bode nyquist  pdf-

Basic MatLAB Plots

For the next three plots and simulink models, this is the system used:

Spring-Dashpot Mass Systemm=1 Input Sineb=4 Amp=50k=2 Freq=5

Fkxxbxm =++ &&&

( )( ) 24

12 ++

=sssF

sX

[ ] [ ]

[ ][ ] Fxy

Fxx

0011/1

01/41/2

10

+=

⎥⎦

⎤⎢⎣

⎡+⎥

⎤⎢⎣

⎡−−

=&

M

k

F

b

x

Page 11: -stability bode nyquist  pdf-

Basic MatLAB Plots – Bode Diagrams

A graphical wayof representingsystems througha magnitude andphase plot. Usingthe frequency domainthese plots can beobtained. Thesecan be used in:

Control Systems DynamicsElectronics

MatLAB Command: bode(sys) or bode(tf([Num],[Den]))

Page 12: -stability bode nyquist  pdf-

Basic MatLAB Plots – Root Locus Diagram

A diagram of the poles andzeros of a system,using a real andimaginary axes.

rlocus(sys) orrlocus(tf([Num],[Den]))

Page 13: -stability bode nyquist  pdf-

Basic MatLAB Plots – NyquistDiagram

This allows the prediction ofstability and Performanceusing the systemsopen loop form.

nyquist(sys) ornyquist(tf([Num],[Den]))

Page 14: -stability bode nyquist  pdf-

Introduction To Simulink

Simulink is a graphical representation of systems, differential equations, or problems encountered in engineering fields. Blocks can be assembled to reproduce almost anything as long as it can be modeled mathematically. Simulink has become an important part of aeronautical, astronautical, computer, electrical, and mechanical engineering programs and industries.

Page 15: -stability bode nyquist  pdf-

Simulink: Computer Integrated

Simulink can be used to control systems with the correct hardware and software. Texas Instruments and other electronic equipment manufacturers creates circuit boards for integration with a PC running Simulink. Output can be directly saved to a computer and analyzed to improve the model or write the report, more efficiently than in the past.

Page 16: -stability bode nyquist  pdf-

Simulink Toolboxes

These are some of the toolboxes simulink has.

We will use only the firsttoolbox ‘Simulink’ and‘Simulink Extras’ furtherdown.

Page 17: -stability bode nyquist  pdf-

Simulink: Most Commonly Used Blocks

These are the most commonly used blocks for Mechanical Engineers.

Page 18: -stability bode nyquist  pdf-

Simulink: Most Commonly Used Blocks

These are the most commonly used blocks for Electrical Engineers.

Page 19: -stability bode nyquist  pdf-

Simulink: Creation Of A Model1. A mathematical model has to be finished or a

prior simulation had to been performed.2. Create the block diagram by opening a new

model sheet and grabbing and dropping the blocks onto the model sheet.

3. Arrange blocks in the order that the model shows and connect them by dragging the arrow coming out of the block to the next block or clicking on both blocks while holding down ‘control’.

4. Make sure the model is correct before running the simulation. Then run the simulation.

Page 20: -stability bode nyquist  pdf-

Simulink: Creation Of A Model

Page 21: -stability bode nyquist  pdf-

Simulink: Model ParametersChanging the simulation parameters will help or hurt your model depending on what is changed.

Page 22: -stability bode nyquist  pdf-

Simulink: Output Of The Model

There are several ways to use or view the data received from the model.

Page 23: -stability bode nyquist  pdf-

Simulink: Example 1 & 2

Page 24: -stability bode nyquist  pdf-

Simulink: Example 3

Page 25: -stability bode nyquist  pdf-

Simulink: Lab 2 Diagram

Page 26: -stability bode nyquist  pdf-

Simulink: Moderate to Advanced Models

Research Model: Modeling and control of swimming robotic fish

Page 27: -stability bode nyquist  pdf-

An Introduction To MatLAB& Simulink