77
Department of Mechatronics Engineering Module IV: SIMULINK and Neuro-Fuzzy Toolboxes MATLAB & SIMULINK with Applications

Simulink-01-01

Embed Size (px)

Citation preview

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 1/77

Department of Mechatronics Engineering

Module IV:SIMULINK and Neuro-Fuzzy Toolboxes

MATLAB &SIMULINK with

Applications

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 2/77

Department of Mechatronics Engineering

Session 1:Getting Started with Simulink

SIMULINK 

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 3/77

Department of Mechatronics Engineering

• What is SIMULINK 

• etting Starte! with SIMULINK 

• "ontin#o#s$time S%stem

• S#s%stems

• Mas'ing

• Discrete$time S%stem

(#tlines

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 4/77

Department of Mechatronics Engineering

Session (#tlines

• What is SIMULINK?

• Getting Started with SIMULINK 

• Modeling of ontinuous !ime

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 5/77

Department of Mechatronics Engineering

• SIMULINK is a software "a#kage that ena$les%ou to model& simulate and anal%'e s%stemd%nami# s%stem(

• )%nami#s s%stem* +eal d%nami#al s%stems: ,le#tri#al #ir#uits& sho#k

a$sor$er& $raking s%stem& et#(

* ontinuous time& dis#rete time and h%$rid s%stem

What is SIMULINK)

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 6/77

Department of Mechatronics Engineering

What is SIMULINK)

Simulink #an $e laun#hed $% using one of thefollowing wa%s from M-!L-.(

• .% #li#king the Simulink i#on on the M-!L-.

tool$ar

• .% entering the #ommand simulink at theM-!L-.

"rom"t(

Click the Simulink icon to start simulink

// simulink

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 7/77Department of Mechatronics Engineering

When Simulink o"ens %ou will see the $o0 #alledthe SIMULINK li$rar% $rowser will o"en as shownin the gure(

New window icon

Simulink library

icon

What is SIMULINK)

 !o see the #ontent ofthe tool$o0& #li#k on the2 sign at the $eginningof ea#h simulink i#on(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 8/77

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 9/77Department of Mechatronics Engineering

What is SIMULINK)

Elements of a Sim#lin' Mo!el

S%stem .lo#k)iagram

SinksSour#es

 !hree main element ofSimulink model:

• Sour#es• S%stem .lo#k)iagram• Sinks

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 10/77Department of Mechatronics Engineering

What is SIMULINK)

So#rces

 !he sour#e li$rar% #ontains of data3signals thatone would use in a d%nami# s%stem simulation inSimulink(

 !he sour#es ma%:• #onstant in"ut• sinusoidal wa4ein"ut• ste" in"ut• a re"eatingse5uen#%• ram" in"ut• et#

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 11/77Department of Mechatronics Engineering

What is SIMULINK)

So#rces

 6ou ma% also o"en the sour#e li$rar% on ase"arate window $% right7#li#k the sour#e i#on then sele#t o"en(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 12/77Department of Mechatronics Engineering

What is SIMULINK)

Sin's !he sinks are $lo#k were signals are terminatedor ultimatel% used(

 !he signals #ould $e• dis"la%ed• or e4en stored in ale3works"a#e(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 13/77Department of Mechatronics Engineering

What is SIMULINK)

So#rces

 6ou ma% also o"en the sinks li$rar% on ase"arate window $% right7#li#k the sour#e i#on then sele#t o"en(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 14/77

Department of Mechatronics Engineering

What is SIMULINK)

Simulink allow %ou to re"resent a model as#ontinuous as well as dis#rete s%stems $% usingtransfer fun#tion& integration $lo#ks& et#(

Sim#lin' Mo!el Lirar%

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 15/77

Department of Mechatronics Engineering

What is SIMULINK)

Simulink also "ro4ides nonlinear 8dis#ontinuous9$lo#ks and look7u" ta$le $lo#ks for $uilding amodel(

Sim#lin' Mo!el Lirar%

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 16/77

Department of Mechatronics Engineering

What is SIMULINK)

ther useful$lo#ks are Math$lo#k(

Sim#lin' Mo!el Lirar%

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 17/77

Department of Mechatronics Engineering

etting Starte!

Let;s start $% $uilding a simulink model thatsol4es the following di<erential e5uation

)t2sin(3)t(x   = where   1)0(x   −=

 !he two7ste" "ro#esses:• .uilding the model

• Simulate the model

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 18/77

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 19/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!elIf ne#essar%& o"en the Simulink $lo#k li$rar%(Simulink #an $e laun#hed $% using one of thefollowing wa%s from M-!L-.(

• .% #li#king the Simulink i#on on the M-!L-.tool$ar

• .% entering the #ommand simulink at theM-!L-.

"rom"t(

Click the Simulink icon to start simulink

// simulink

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 20/77

Department of Mechatronics Engineering

etting Starte!

When Simulink o"ens %ou will see the $o0 #alledthe SIMULINK li$rar% $rowser will o"en as shownin the gure(

New window icon

Simulink library

icon

B#il!ing a Mo!el

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 21/77

Department of Mechatronics Engineering

etting Starte!

 !o $uild the model& %ou rst need a s"a#e to#reate model(

li#k New windowi#on to #reate anew s"a#e

-n em"t% windowfor $uilding themodel(

B#il!ing a Mo!el

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 22/77

Department of Mechatronics Engineering

etting Starte!

Ne0t& sele#t the Simulink i#on to e0"and the listof a4alai$le elements whi#h #an $e used to #reatea s%stem model

li#k Simulink i#on

B#il!ing a Mo!el

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 23/77

Department of Mechatronics Engineering

etting Starte!

,a#h folder #ontains elements whi#h ma% $e usedto #reate a s%stem model(

B#il!ing a Mo!el

When needed& these elements ma% sim"l% $e#li#ked& dragged and dro""ed into the model

works"a#e(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 24/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!elLet;s refer $a#k the sket#hed model(

In"ut:=sin8>t9

ut"ut:08t9

s

1

Initial #ondition:089@71

 !o #onstru#t this model& we re5uire threeelements• - Sine Wa4e .lo#k• -n Integrator .lo#k

• - S#o"e .lo#k(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 25/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!el

Lo#ate the sine wa4eunder the sour#efolder and #li#k& drag

and dro" it in themodel works"a#ewindow to #reatein"ut $lo#k(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 26/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!el

Lo#ate the integratorunder the #ontinuousfolder and #li#k& drag

and dro" it in themodel works"a#ewindow to #reateo"erator $lo#k(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 27/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!el

 !hen& lo#ate thes#o"e under the sinksfolder and #li#k& drag

and dro" it in themodel works"a#ewindow to #reateout"ut $lo#k(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 28/77

Department of Mechatronics Engineering

 !he $lo#ks #an $e #onne#ted $% dragging a linefrom the out"ut of one $lo#k to the in"ut ofanother $lo#k(

etting Starte!

B#il!ing a Mo!el

Make the following #onne#tion• out"ut of the sine wa4e  in"ut of theintegrator

• out"ut of the integrator  in"ut of the s#o"e

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 29/77

Department of Mechatronics Engineering

 !he resulting model is as follows

etting Starte!

B#il!ing a Mo!el

 !he ne0t ste" is setting the model "arameters(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 30/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!elLet;s refer $a#k the sket#hed model(

In"ut:=sin8>t9

ut"ut:08t9

s

1

Initial #ondition:089@71

 !o #onstru#t this model& we re5uire three

elements• - Sine Wa4e .lo#k

• am"litude 1 and fre5uen#%• -n Integrator .lo#k

• initial #ondition 71

i !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 31/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!elMost $lo#ks ha4e di<erent "arameters that areasso#iated with them( !o a##ess "arameters&sim"l% dou$le7#li#k on the $lo#k of interest( !his

will $ring u" a dialog $o0 whi#h allows the"arameters to $e #hanged(

dou$le7#li#k on the $lo#k of interest

i S !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 32/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!elLet;s modif% the sine wa4e "arameters(

)ou$le7#li#k on the sinewa4e $lo#k and then set

the following"arameters:• -m"litude @ =• Are5uen#% @ >

i S !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 33/77

Department of Mechatronics Engineering

etting Starte!

B#il!ing a Mo!el

Ne0t& let;s modif% the integrator $lo#k(

)ou$le7#li#k on the

integrator $lo#k andthen set the initial#ondition e5ual to 71

tti St t !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 34/77

Department of Mechatronics Engineering

)ou$le7#li#k on thes#o"e $lo#k(

 !his $lo#k does notha4e an% "arameterswhi#h need setting& $utinstead dis"la%s thes#o"e dis"la% s#reen(

etting Starte!

B#il!ing a Mo!el

Ne0t& let;s modif% the integrator $lo#k(

tti St t !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 35/77

Department of Mechatronics Engineering

etting Starte!

Sa*ing a Mo!el

Now the model has $een #reated and dened(We ma% sa4e this model $efore we run themodel( !o sa4e the #reated model& #li#k Sa4e as under

Aile menu& then enter the name of the model(li#k K (

tti St t !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 36/77

Department of Mechatronics Engineering

etting Starte!

+#nning a Mo!el

Now the model has $een #reated and dened&the model is read% to run(

 !o start simulation&

"ull down menu thesimulation menu andsele#t start(

Biew the out"ut of thesimulation on thes#o"e window(

tti St t !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 37/77

Department of Mechatronics Engineering

etting Starte!

+#nning a Mo!el

)t2sin(3)t(x   =

where

1)0(x   −=

tti St t !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 38/77

Department of Mechatronics Engineering

etting Starte!

Mo!el Mo!i,cation

We #an modif% the simulink $lo#k( Aor e0am"le&we want to dis"la% $oth in"ut and out"ut in as#o"e( !o do so& drag mu0 $lo#k to the model

works"a#e(

)elete the line#onne#ting out"utintegrator and s#o"e

in"ut(

tti St t !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 39/77

Department of Mechatronics Engineering

etting Starte!

Mo!el Mo!i,cation

 !hen& #onne#t the mu0 in"ut to the $oth sine and integrator $lo#k out"uts(

tti St t !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 40/77

Department of Mechatronics Engineering

+#nning a Mo!el

Now the model has $een modied& the model isread% to run(

 !o start simulation&

"ull down menu thesimulation menu andsele#t start(

Biew the out"ut of thesimulation on thes#o"e window(

etting Starte!

tti St t !

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 41/77

Department of Mechatronics Engineering

+#nning a Mo!el

)t2sin(3)t(x   =

where

1)0(x   −=

etting Starte!

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 42/77

Department of Mechatronics Engineering

"on,g#ring the Sim#lation

etting Starte!

When we #hoose Simulation:Start from themodel window menu $ar& Simulink sol4es themodel numeri#all% using one of its sol4ermethods(

.efore we run a simulation we ma% set 4arious"arameters su#h as starting and ending time&

simulation ste" si'e& a num$er of toleran#e andsol4er method(

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 43/77

Department of Mechatronics Engineering

"on,g#ring the Sim#lation

etting Starte!

 !o set simulation "arameters& #hoose SimulationCarametersD under Simulation menu(

Simulation"arameters dialog$o0 o"ens(

Aour ta$$ed"ages

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 44/77

Department of Mechatronics Engineering

"on,g#ring the Sim#lation

etting Starte!

Sol4er "age #onsists of three se#tionE simulationtime& sol4er o"tion and out"ut o"tion(

hange the following:

• start • end >• 0ed ste" sol4er• deF 8+unge7Kutta9

• Ai0ed ste" si'e (1

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 45/77

Department of Mechatronics Engineering

"on,g#ring the Sim#lation

etting Starte!

 !he Works"a#e I3 "age "ermits us to a#5uiresimulation in"ut from the M-!L-. works"a#eand send out"ut dire#tl% to the M-!L-.

works"a#e(,nter the following:• !ime: t• ut"ut: %• Limit data "oint:>

li#k K  to #lose the $o0(

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 46/77

Department of Mechatronics Engineering

"on,g#ring the Sim#lation

etting Starte!

In M-!L-. & to set simulation "arameters&#hoose onguration CarametersD underSimulation menu(

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 47/77

Department of Mechatronics Engineering

hange the following:

• start • end >• 0ed ste" sol4er• deF 8+unge7Kutta9

• Ai0ed ste" si'e (1

Sol4er "age #onsists of three se#tionE simulationtime& sol4er o"tion and out"ut o"tion(

"on,g#ring the Sim#lation

etting Starte!

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 48/77

Department of Mechatronics Engineering

"on,g#ring the Sim#lation

etting Starte!

 !he )ata ,0"ort3Im"ort "ermits us to a#5uiresimulation in"ut from the M-!L-. works"a#eand send out"ut dire#tl% to the M-!L-.

works"a#e(,nter the following:• !ime: t• ut"ut: %• Limit data "oint:>• he#k Stateli#k K  to #lose the $o0(

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 49/77

Department of Mechatronics Engineering

"on,g#ring the Sim#lation

etting Starte!

 !he )iagnosti# "age allows us to sele#t the

a#tion taken for 4arious e0#e"tional #onditionsand it also in#ludes o"tions to #ontrol automati#$lo#k out"ut #onsisten#% #he#king& $ounds#he#king and simulation "roling(

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 50/77

Department of Mechatronics Engineering

+#nning a Mo!el

Now the model has $een modied& the model isread% to run(

 !o start simulation&

"ull down menu thesimulation menu andsele#t start(

Biew the out"ut of thesimulation on thes#o"e window(

etting Starte!

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 51/77

Department of Mechatronics Engineering

+#nning a Mo!el

Now the model has $een modied& the model isread% to run(

 !o start simulation in

M-!L-. & "ull downmenu the simulationmenu and sele#t start(

Biew the out"ut of thesimulation on thes#o"e window(

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 52/77

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 53/77

Department of Mechatronics Engineering

etting Starte!

Sim#lin' -elp S%stem

Simulink in#ludes an e0tensi4e hel" s%stem inthe form of on7line User;s Guide in H!ML formatand an integrated $rowser(

 !his hel" s%stem is a4aila$le $% #li#king the Hel" $utton in the dialog $o0 of a "arti#ular $lo#k(

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 54/77

Department of Mechatronics Engineering

)ou$le7#li#k on the

integrator $lo#k andthen #li#k hel" $utton(

etting Starte!

Sim#lin' -elp S%stem

Aor e0am"le& we want to a##ess the hel" s%stemfor integrator $lo#k(

etting Starte!

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 55/77

Department of Mechatronics Engineering

etting Starte!

Sim#lin' -elp S%stem

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 56/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

"onceptontinuous s%stem is d%nami#al s%stem that #an$e des#ri$ed using di<erential e5uation(

Let;s #onsider a mass7s"ring7dam"er s%stem asour e0am"le(

Motione5uation

)t(f )t(kx)t(xc)t(xm   =++  

We ma% #onstru#t a Simulink model $% using"rimiti4e $lo#ks& transfer fun#tion $lo#k andstate 4aria$le model(

)t(f 

)t(x

c

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 57/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

.rimiti*e Bloc's !he motion e5uation #an rewrite as follows

[ ])t(kx)t(xc)t(f m

1)t(xm   −−=  

+

-

)t(f 

∫    ∫ 

c

-

)t(x   )t(x   )t(xm/1

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 58/77

Department of Mechatronics Engineering

+

-

)t(f 

∫    ∫ 

c

-

)t(x   )t(x   )t(xm/1

"ontin#o#s S%stem

.rimiti*e Bloc's

Step8Sour#e

9

ain8Sinks9Integrator

8Math9

Scope8Sinks9

ADD8Math9

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 59/77

Department of Mechatronics Engineering

 !o $uild the model& %ou rst need a s"a#e to#reate model(

li#k New windowi#on to #reate anew s"a#e

-n em"t% windowfor $uilding themodel(

"ontin#o#s S%stem

.rimiti*e Bloc's

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 60/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

.rimiti*e Bloc'sLo#ate the Ste" .lo#k under the sour#e folder and#li#k& drag and dro" it in the model works"a#ewindow to #reate in"ut $lo#k(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 61/77

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 62/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

.rimiti*e Bloc's

Lo#ate the Gain .lo#k in the Math "erationli$rar% and li#k& )rag and )ro" it into %our newworks"a#e( 6ou need to do this three times or %ouma% use o"% and Caste for making three Gain

.lo#ks(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 63/77

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 64/77

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 65/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

.rimiti*e Bloc's

 !he se#ond and third gain $lo#ks ma% $e i""edto make an easier #onne#tion( li#k theres"e#ti4e gain $lo#k& then sele#t Ali" .lo#ks under Aormat Menu(

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 66/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

.rimiti*e Bloc's

Ne0t& insert two integrator and s#o"e $lo#ks $%drag and dro" them into the model works"a#e(

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 67/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

.rimiti*e Bloc's

Ainall%& make #onne#tion $etween $lo#k #orre#tl%to nish the model $uilding(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 68/77

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 69/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

Transfer /#nction Bloc's

Lo#ate the !ransfer Aun#tion in the ontinuousli$rar% and li#k& )rag and )ro" it into theworks"a#e(

)ou$le #li#k the transfer fun#tion then enter J1 and Jm # k on the numerator and denominatorres"e#ti4el%(

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 70/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

Transfer /#nction Bloc's

-dd one S#o"e .lo#k to the model works"a#ethen #onne#t it to the !ransfer Aun#tion .lo#k(onne#t also the Ste" .lo#k out"ut to the

 !ransfer Aun#tion .lo#k in"ut(

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 71/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

State Space Bloc'  !he motion e5uation #an also $e rewritten in theform of state s"a#e as follows

BuAxx   +=   DuCxy   +=

where

−−=

m/cm/k 

10A

=

m/1

0B

[ ]01=C [ ]0D =

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 72/77

Department of Mechatronics Engineering

"ontin#o#s S%stem

Transfer /#nction Bloc's

Lo#ate the State S"a#e .lo#k in the ontinuousli$rar% and li#k& )rag and )ro" it into theworks"a#e(

)ou$le #li#k the transfer fun#tion then enter -& .& and ) state s"a#e "arameter elds(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 73/77

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 74/77

Department of Mechatronics Engineering

%

.arameters De,nition

.efore we run the model& we ha4e to dene themodel "arameters sin#e we ust enter #onstant4aria$le(In the M-!L-. "rom"t& write the following

00 m123c143'125300 A165 23$'7m $c7m8300 B165327m8300 "162 58300 D16583

"ontin#o#s S%stem

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 75/77

Department of Mechatronics Engineering

%

+#nning a Mo!el

Now we ha4e simulation model& and we are read%to simulate it( 6ou ma% #hange the simulation"arameters if ne#essar%(

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 76/77

Department of Mechatronics Engineering

En! of Session 2

/#rther +ea!ing• Using Simulink

8/20/2019 Simulink-01-01

http://slidepdf.com/reader/full/simulink-01-01 77/77