کامپیوتر و IT و اینترنتعلوم مهندسی

Application Software Course Control & Simulink

صفحه 1:
www.elecdl.com Application Software Course Control & Simulink By: Mahdi Akbari November,09

صفحه 2:
Roots ‏6+و5 + 42 + تو3 + “و2 + م - (و)6‎ >> roots([1,2,3,4,5,6]) ans = 0.5517+ 1.25331 0.5517- 1.25331 -1.4918 -0.8058+ 1.2229 -0.8058- 12229

صفحه 3:
Symbolic Mathematic Sym: Create symbolic object x=sym(’x’) << Syms: Shortcut for creating multiple symbolic objects syms x,y <<

صفحه 4:
5۱00 Integral Transforms fourier Fourier transform ifourier Inverse Fourier transform ilaplace Inverse Laplace transform iztrans Inverse Z-transform laplace Laplace transform ztrans Z-transform

صفحه 5:
Examp le 2 ‎ip) = +3846‏ + 75+ و3 + و syms s << >> f= (5*s*2 + 3*5 +6)/(s*4 + 3*8*3 + Sa 2 TONS ‏تم‎ ‎>> ilaplace(f )

صفحه 6:
Transfer Functions St+5 CS F428 43544545 >> num=[1,5]; >> den=[1,2,3,4,5]; >> G=tf(num,den)

صفحه 7:
Transfer Functions 6(s+5) G(s) = (S'+3s+1) (5+6)(8'+6s +5s+3) den=conv(conv(conv([1,3,1],[1,3,1]),[1,6]), << ;[1,6,5,3]) jnum=6*[1,5] << G=tf(num,den) <<

صفحه 8:
Transformation of System Model (Steady State) نا جلك دعر ‎y=Cx+ Du‏ >> G=ss(A,B,C,D)

صفحه 9:
© ۱ - ,066,۰06 :۵,66 ,۰66,466 ,666 :۰ ,406 ,6 ,06 ۵]عی <د :0.26 ,۵.۵6 ,42۵ ,۵6 :1664 >> [© ,0 :6 ,6 :6,6 زه ,]دمر :]0, ©, 0, ٩: ۵, 6, 0, 6[ >> >> (©,©) د >> (۵,۵,0,0)سع

صفحه 10:
Transformation of System Model درم وم ها _ و1 ‎Ag 7 den OF A B+D‏ X=Ax+ Bu y=Cx+ Du tf2ss (num, den) = [A, B, C, D] ss2tf (A, B, C, D) = [num, den] 0

صفحه 11:
Zero-pole-gain Description 53 + 0.928 72i)(s — 0.0433 + 0.6412i) (s+1 (s + 0.9567 + 1 G(s) =6 >> KGuc=O; >> T=[.960F; -0.09G9+0.9807;; -0.0969-0.980?]]; >> P=-O.9G0?+1.CC TE; -0.OGOTA.CS PE; 0. 0899*0060: +0.0F99-0.006]; << ‏,)ات‎ ۳,۵۰۰ a

صفحه 12:
step responses Y MP Y Rise time Y Fall time Y Over shoot step (num,den) << step (A,B,C,D) << :for find

صفحه 13:
:Form 3 >> [y,x,t] = step (num,den,t) >> plot(t,y) /\¢ oscil model 06

صفحه 14:
impulse responses As) _ 1 As) s+1 :For impulse responses R(s)=1 ‏کر‎ ee OB emer 5 _ Ad _ s 5 1 +1 Step (s G(s) ) ag

صفحه 15:
impulse responses impulse (num, den) <<

صفحه 16:
Ramp responses * Crp (GG )

صفحه 17:
ما ۳ 0 ب ‎Feedback‏ Gt=feedback(G,H) << syms 01 02 % declare symbolic variables << Gt=feedback(g1,g2,+1); %Defult: << negative feedback pretty(Gt) <<

صفحه 18:
:Example >> G1=tf(1,[1,2,1]); ‏سره‎ ‎>> G2=tf(1,[1,1]); >> G=feedback(G1,G2) %: 8+1 ae

صفحه 19:
Bis) _ num _ B(l)s" +6(2)s""1 +...4. b(n) A(s) قلعط‎ a(1)s" + a(2)s""1 +...+ a(n) residue(num, den) = [r, p, k]<< Bis) rl) r(2) rn) = h(a) + + +o 4 A(s) ‏(1)م-و‎ s~pl2) s— p(n)

صفحه 20:
Root Locus Plots 0 G R 1+GH p 5 |G Cc 11 nocus (num, den) = [r, k] nocus (num, den, &) = [r, k] nocus (A, B, C, D) =[r, kK nocus (A, B, C, D, K) - ] Kl eo

صفحه 21:
Example a ‏رو + وق + وه‎ jnum = [000 1] << ;den = [159 0] << ;rlocus(num, den) << 5 Root Locus Imag Axis ‏هه‎

صفحه 22:
Bode Diagrams bode(num, den) bode(num, den, W) bode(A, B, C, D) (3.36) bode(A, B, C, D, W) bode (num, den) = [mag, phase, w] bode (num, den, w) = [mag, phase, w] bode (A, B, C, D) = [mag, phase, w] bode (A, B, C,D, w) = [mag, phase, w] bode (A, B, C, D, iu, w) = [mag, phase, w] ee

صفحه 23:
Example ) + 07۳ 5 G(s) = 29.125 Bode diagram% <~ jnum= [29.125 33.2025 9.4627] << ;den= [0 1 0] << ‏سر‎ ‎bode (num, den) << _ « ‏بعر‎ ه06

صفحه 24:
Nyquist Plots nyquist (num, den, w) nyquist (A, B, C, D) nyquist (A, B, C, D, w) nyquist (A, B, C, D, iu, w) nyquist (num, den) = [re, im, w] nyquist (num, den, w) = [re, im, w] nyquist (A, B, C, D) = [re, im, w] nyquist (A, B, C, D, w) = [re, im, w] nyquist (A, B, C, D, iu, w) = [re, im, w] ee

صفحه 25:
Example Gs) = k(s + Dis+ 3+ 7i(s+3-7i) ‏و)(:7 + ق + و)(3 + و)(1 + و)‎ + 3 - 71( 5153502 ددر >> [7*1 - 3 -7*1 + 3 - 5 - 3 -1 -] > مر ‎jk = 30 >>‏ nyquist (num, den) << Nyquist Diagram Imaginary Axis 9 es

صفحه 26:
?What Is Simulink ¢Simulink is a software package for modeling, simulating, and analyzing dynamical systems. * It supports linear and nonlinear systems, modeled in continuous time, sampled time, or a hybrid of the two.

صفحه 27:
How to open simulink ٠ Click oc this ‏مجلا‎ ah eA) seen ۰ ۲۲ ees en

صفحه 28:
یود create a model Dp cred the wodel, Pirst pe ‏اند‎ ۲ the DBTLOB cowwand wiedow. Ou ODierosoht Dicdaws, the Gicvulick Library Orawser uppeus. 9

صفحه 29:
Open new window TeX Yon tb eae | Sommer sed Blk sine Camnol [Commonly Used Blocks 8 Cat eden Ts To ‎Fist 3)‏ 0 2-7 26 ب هه هزه

صفحه 30:
Model Editor الالضلعا 9 ‎bar‏ سل فا م۳ مهافت ‎Tle‏ ‏سم | نع ه ۸ 3ه 2 هم ‎Contest‏ ‎canvas‏ لم ‎face‏ ۳ جى | ول« ‎me‏ ‎be o‏ دی ‎Ready foe Rf Status br‏ 280

صفحه 31:
View Command History + Beek =(Depkye ke 5 ‏تاه و‎ Pornward=( (Displays the ee ee 2 ‏)متا‎ So Parect ) 90

صفحه 32:
Building a Simple Model ° Dhis exccple shows pou how to ‏لايجا‎ a code usicgy c7tay oP the worded buikdiccy * ‏یه له ممم‎ pou will use to build pour sud wodels ° Dke wodel ioteqrotes o stor wove ood displays the resul, uizag wits the sice wave. Nhe block dora oF the wooded lochs lke this

صفحه 33:
Create example model Do oredr this wodel, you wil ‏صا لوه‎ copy blocks toto the wodet Prov the Pollouvtcgy Gieruttak block thrones: (Cores dra (be Ore (are beet) (Gre teary (he Geece beech) Couticuvus library (the ‏هه‎ block) . Oxqrs & Opstews tbrury (the Dux block)

صفحه 34:
2 0 computor etn ۳ سای نج سس ] سس locate ‏مره الیو بط‎ ‏عن ملسا ل‎ 5 ‏عادص فاه‎ و هه 1 وود هه دود نک ‎om seca‏ دود ند ‎Bae‏ ‎‘Be Sources [Be] | Signal Generar‏ ‎User-Defined Functions:‏ 2 ‎2a ١ ‏م‎ ‎۱ ‏مومت ۷ ‎Bisons so ‏ما بط‎ ita teustonToobae ‎RA] ‏سین‎ ‎fib] ‎| ‎2 ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎3 Uri Rana _ Sock Params ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎

صفحه 35:
اه 5 ایا ‘Fle Edt View Simulation Format Tools Help 1 Die 5| ۸ ‏دهاع ه‎ ۵ م 6096لا

صفحه 36:
(ik ol he blocks copied tv the sordel widow, the code should looks ‏سوام‎ the. ۳ } ا اج ‎=e‏ Imegraior Qow t's tere ty opener the blocks. ‏بط لاور‎ the comer butoa ced wove he cursor to he top apd port oF the Dre block, Dotice that he tor ts dashed while the wouse bution te dow cd tat thr puree cope ‏ماو ۱ سوه مها موه وا وا موم‎ fae (Doe 4 و block.

صفحه 37:
۰ Dow ‏مت من با واه‎ The blocks one ovocerted & ل و ۰ Press und hold dow the Ot key. Press ۶ ۲۵۵۵ 0 Rea deay the pointer to the Ioteqrator block's iaput port or over the ‏وا اس مه[‎ م8

صفحه 38:
۱ block cooceniives. Dkeo pou door, pour wodet should look sowethtary like this. 80

صفحه 39:
نالهك Feet Tack Hep وس 1 ۳ سا ۱ ها زب ۳۰۵ : 51 8 8اه تنن يي جيم ‎Peay‏ 66

صفحه 40:
Qow, opes the Scope bck to view ‏موجه‎ culpa. Keepiay ie Scope widow oped, ‏موه 0 ۵ موجه مد و )ود وه‎ ‎Paraweters Brow the Gkoukaioa wrcu.‏ موه روا مور موجه با ‎Ou‏ ‎ihe thedon box bool ‏وميه‎ ‎swiire thot the ‏عم م۵0‎ ‏ص ادك سا‎ 000.0 ‎oh)‏ فمخط ص) ‎0 ‎

صفحه 41:
۰ Choose Groat Prow the Groukaiog weou ood Wwaoick the teases oP the Goope block's input. 60

صفحه 42:
‎Oiewiery Ghonouts‏ اول۱(0) ‎Microsoft Windows: ۳ ۷ 1 9 Arrow ‎۳ ‎0 ‎0 ‎f ‎Space ‎Hold dawn p or q and drag mouse ot ShifteLeft Arrow ‎‘tor Shif¥Right Arrow ‎Delete or Back Space ‎Use arrow keys ‎ ‎ ‎Task ‎Zoomin ‎Zoom out ‎Zoom to normal (100%), Pan et ‎Pan nght Pan up Pan down ‎Fitselectonto screen Fit ciagramt0 sersen ‎Penwith mouse ‎[Go backin parvzoom history ‏رطان ممسكودم ل سوسوم و‎ ‏مامه واو‎ ‎Move selection ‎ ‎6 ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎

صفحه 43:
‎(lock Oingreaws‏ سر[ ‎Gelert Low ‏وا‎ Prow the Oiew eau (or ype 7) to edhe the view. rte Dove Ou Prow the Orw wea (or pe v) to ‏اه‎ ‎ ‎ ‎the view. Gekert Pt Opstew To Otew Prow he Otew weau (or press he spare bur) ty Pathe dagrenn he view. 3 ‏سس‎ ‎Gelert ‏مت وتا‎ he Otew ‏تج‎ | ‏۲ «ممسوعمك جما بصا وا )0 ‎(or pe‏ ‎whl size. i ‎9

صفحه 44:
colors ۰ ‏لوق‎ ulows you to speciPy the Poregrousrd ood backyrued polors oF cay block * select ‏موق‎ olor Prow the Giulia Porat wea ee

صفحه 45:
Connecting Blocks Crceentoy Tu Blocks Te cute pooner ty blocks: Gelert te source block. © Wold devs Ot ced fePoioks the desticratica blo. Gierukets czcraerts the source block to the desticratica blot ‎ff‏ | ظ ‎ ‎ ‎ ‎ ‏يا ‎ ‎ ‎ ‎ ‏عه مه روموت عه عرو ول( ‎possible beter the tue blocks us thustrated ‏مومت رجشسصاا( عا و‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎Before avlaconnect ‘Mier ouloconnect ‎©) Okeu coocertiagy tw blocks, Oi ‎9 ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎

صفحه 46:
Connecting Groups of Source Blocks ‎oP sexier blocker tot deat bleeds pa a‏ و و و و امه ‏و اه وت و امه و وا ماو اه ی و و اما مود ‎blots:‏ ما و ره توا ‎* Gelert the source blocks. * Wold dows Ord ced teP ‏عاصاص‎ the desticatica block. ‎ ‎ ‎ ‎Bl #4 ‎ ‎ ‎ ‎ ‎ ‎

صفحه 47:
connect a source block toa group of destination blocks * Gelert the desticaiva blocks. قلا سپس قلا دود اوعد * Wold dove Cid aed feP click the source block. Co 8 Display ‏قلا‎ ‎Displayl

صفحه 48:
Moving a Line Segment ۰ Do wove ‏ه‎ hee veut: * (osiivg the poister vo the seqsved pou woot 7 wovr. ٠ Orog the pointer to the desired lovato. 6

صفحه 49:
Inserting Blocks in a Line :عملا ه دز كاعصاط د و و ۰ * @osiico the poister over the blocs ced press the tePt ous buttos. Ba ‏تاه‎ ٠ ‏هذ صجلا جكاا عصيص عاصصاط جذاا بع(‎ whick pou woot 7 tasert the block. iba Bsa * Release the wouse buttos to drop the blocks vo the foe. * Gtevuhok toserts the block where pou dropped it. ۲ 9

صفحه 50:
Disconnecting Blocks ٠ ‏سول و‎ u block Prow ‏روم جلا‎ lies, ‏لاوا‎ dow the GHP Rep, theo drag the block to a ‏.ددص زره‎

صفحه 51:
Creating Subsystems * Os pour wodel eoreuses fa size ced powplexiy, pou cot sioplPy it by evupiey blocks into subspstews. )1( 55 subspstews hus these advectayes! ۰ A thelps reduce the cucber oP blocks displayed to pour ‏اس مت‎ ۱ ‏و‎ toyether

صفحه 52:
Creating a Subsystem by Adding the Subsystem Block * To create a subsystem before adding the blocks * Copy the Subsystem block from the Ports & Subsystems library into your model. * Open the Subsystem block by double-clicking it. * In the empty Subsystem window, create the subsystem. ¢ For example, the subsystem shown includes a Sum block and inport and Outport blocks to represent input (7 it subsystem. In 7 + ‏رت‎ ‎(24 Out Sum ‎Ind‏ ده ‎ ‎ ‎ ‎ ‎

صفحه 53:
Creating a Subsystem by Grund Existing Blocks dl woeased ‏و سس مسا‎ ae ‏هط تن‎ ne emer ited سلج ‎toe ler‏ جا امد دص ‎meee: te‏ عسي لحن ليلا نمايو < 23 كاها ماممدا ها رخاس متحت رولا بجنا ‎lrg eer aka coved‏ .لمهت ذا تصصاد©) جما يجاوب برا عجن زرط ‎by selectag thew‏ Choose Create Gubs مت ‎the ender ry sys,‏ مس © ‎AP pou open the Cubs‏ ۰ ‎shown below.‏

Application Software Course Control & Simulink By: Mahdi Akbari November,09 1 Roots G(s)  s5  2s4  3s3  4s2  5s  6 >> roots([1,2,3,4,5,6]) ans = 0.5517+ 1.2533i 0.5517- 1.2533i -1.4918 -0.8058+ 1.2229i -0.8058- 1.2229i 2 Symbolic Mathematic Sym: Create symbolic object x=sym(’x’) >> Syms: Shortcut for creating multiple symbolic objects syms x,y >> 3 Symbolic Mathematic 4 Examp le syms s >> >> f = (5*s^2 + 3*s +6)/(s^4 + 3*s^3 + 7*s^2 + 9*s +12); >> ilaplace(f ) 5 Transfer Functions s 5 G(s)  4 3 2 s  2s  3s  4s  5 >> num=[1,5]; >> den=[1,2,3,4,5]; >> G=tf(num,den) 6 Transfer Functions den=conv(conv(conv([1,3,1],[1,3,1]),[1,6]), >> ;[1,6,5,3]) ;num=6*[1,5] >> G=tf(num,den) >> 7 Transformation of System Model (Steady State)  . x  Ax Bu   y Cx Du >> G=ss(A,B,C,D) 8 Example >> A=[2.25, -5, -1.25, -0.5; 2.25, -4.25, -1.25, -0.25; 0.25, -0.5, 1.25,-1; 1.25, -1.75, -0.25, -0.75]; ;B=[4, 6; 2, 4; 2, 2; 0, 2] >> ;C=[0, 0, 0, 1; 0, 2, 0, 2] >> ;D=zeros(2,2) >> G=ss(A,B,C,D) >> 9 Transformation of System Model Y(s) num  C(SI A) 1 B  D u(s) den  . x  Ax Bu   y Cx Du tf2ss (num, den) = ]A, B, C, D[ ss2tf (A, B, C, D) = ]num , den[ 10 Zero-pole-gain Description >> KGain=6; >> Z=[-1.9294; -0.0353+0.9287j; -0.0353-0.9287j]; >> P=[-0.9567+1.2272j; -0.9567-1.2272j; 0.0433+0.6412j; +0.0433-0.6412j]; >> G=zpk(Z,P,KGain) 11 step responses step (num,den) >> step (A,B,C,D) >> :for find     12 MP Rise time Fall time Over shoot :Form 3 >> [y,x,t] = step (num,den,t) >> plot(t,y) 13 impulse responses C(s) 1  R(s) s  1 :For impulse responses R(s)=1 1 s 1 C(s) G(s)  ( ) s 1 s 1 s C(s) s   1 s 1 u(s)  s Step ( s G(s) ) 14 impulse responses impulse (num, den) >> 15 Ramp responses • Step ( G(s)/S ) 16 Feedback Gt=feedback(G,H) >> syms g1 g2 % declare symbolic variables >> Gt=feedback(g1,g2,±1); %Defult: >> negative feedback pretty(Gt) >> 17 :Example >> G1=tf(1,[1,2,1]); >> G2=tf(1,[1,1]); >> G=feedback(G1,G2) %for negative feedback >> G=feedback(G1,G2,+1) % for positive feedback 18 residue(num, den) = ]r, p, k[>> 19 Root Locus Plots rlocus (num, den) = ]r, k[ rlocus (num, den, k) = ]r, k[ rlocus (A, B, C, D) = ]r, k[ rlocus (A, B, C, D, K) = ]r, k[ 20 Example ;num = [0 0 0 1] >> ;den = [1 5 9 0] >> ;rlocus(num, den) >> 21 Bode Diagrams bode(num, den) bode(num, den, W) bode(A, B, C, D) (3.36) bode(A, B, C, D, W) bode (num, den) = ]mag, phase, w[ bode (num, den, w) = ]mag, phase, w[ bode (A, B, C, D) = ]mag, phase, w[ bode (A, B, C,D, w) = ]mag, phase, w[ bode (A, B, C, D, iu, w) = ]mag, phase, w[ 22 Example Bode diagram% >> ;num= [29.125 33.2025 9.4627] >> ;den= [0 1 0] >> bode (num, den) >> 23 Nyquist Plots nyquist nyquist nyquist nyquist (num, den, w) (A, B, C, D) (A, B, C, D, w) (A, B, C, D, iu, w) nyquist nyquist nyquist nyquist nyquist (num, den) = ]re, im, w[ (num, den, w) = ]re, im, w[ (A, B, C, D) = ]re, im, w[ (A, B, C, D, w) = ]re, im, w[ (A, B, C, D, iu, w) = ]re, im, w[ 24 Example ;z = [– 1 – 3 + 7*i – 3 – 7*i] >> ;p = [– 1 – 3 – 5 – 3 + 7*i – 3 – 7*i] >> ;k = 30 >> nyquist (num, den) >> 25 ?What Is Simulink •Simulink is a software package for modeling, simulating, and analyzing dynamical systems. • It supports linear and nonlinear systems, modeled in continuous time, sampled time, or a hybrid of the two. 26 How to open simulink • Click on this item 27 create a model • To create the model, first type simulink in the MATLAB command window. On Microsoft Windows, the Simulink Library Browser appears. 28 Open new window • Click on New Model button •Simulink opens a new model window. 29 Model Editor 30 View Command History • Back =(Displays the previous view in the view history.Forward ) •forward=( Displays the next view in the view history.Go To Parent ) •Go To Parent=Opens, if necessary, the parent of the current subsystem and brings its window to the top of the desktop. 31 Building a Simple Model • This example shows you how to build a model using many of the model building • commands and actions you will use to build your own models • The model integrates a sine wave and displays the result, along with the sine wave. The block diagram of the model looks like this 32 Create example model • To create this model, you will need to copy blocks into the model from the following Simulink block libraries: 1. Sources library (the Sine Wave block) 2. Sinks library (the Scope block) 3. Continuous library (the Integrator block) 4. Signals & Systems library (the Mux block) 33 • first expand the Library Browser tree to display the blocks in the Sources library. Do this by • clicking first on the Simulink node to display the Sources node • Sources node to display the Sources library blocks. • Finally right click on the Sine Wave node to select the Sine Wave 34 • Copy the rest of the blocks in a similar manner from their respective libraries into the model window 35 • With all the blocks copied into the model window, the model should look something like this. • Now it’s time to connect the blocks. • Hold down the mouse button and move the cursor to the top input port of the Mux block. Notice that the line is dashed while the mouse button is down and that the cursor shape changes to double-lined cross hairs as it approaches the Mux block. 36 • Now release the mouse button. The blocks are connected • Press and hold down the Ctrl key. Press the mouse button, then drag the pointer to the Integrator block’s input port or over the Integrator block itself. 37 • Finish making block connections. When you’re done, your model should look something like this. 38 39 • Now, open the Scope block to view the simulation output. Keeping the Scope • window open, set up Simulink to run the simulation for 10 seconds. • the simulation parameters by choosing Parameters from the Simulation menu. On the dialog box that appears notice that the Stop time is set to 10.0 (its default value) 40 • Choose Start from the Simulation menu and watch the traces of the Scope block’s input. 41 Model Viewing Shortcuts 42 Zooming Block Diagrams • Select Zoom In from the View menu (or type r) to enlarge the view.Select Zoom Out from the View menu (or type v) to shrink the view. • Select Fit System To View from the View menu (or press the space bar) to fit the diagram to the view. • Select Normal from the View menu (or type 1) to view the diagram at actual size. 43 colors • Simulink allows you to specify the foreground and background colors of any block • select Screen color from the Simulink Format menu 44 Connecting Blocks • Connecting Two Blocks To auto connect two blocks: Select the source block. • Hold down Ctrl and left-click the destination block.Simulink connects the source block to the destination block • When connecting two blocks, Simulink draws as many connections as possible between the two blocks as illustrated in the following example. 45 Connecting Groups of Source Blocks • Simulink can connect a group of source blocks to a destination block or a source block to a group of destination blocks.To connect a group of source blocks to a destination block: • Select the source blocks. • Hold down Ctrl and left-click the destination block. 46 connect a source block to a group of destination blocks • Select the destination blocks. • Hold down Ctrl and left-click the source block. 47 Moving a Line Segment • To move a line segment: • Position the pointer on the segment you want to move. • Press and hold down the left mouse button. • Drag the pointer to the desired location. 48 Inserting Blocks in a Line • To insert a block in a line: • Position the pointer over the block and press the left mouse button. • Drag the block over the line in which you want to insert the block. • Release the mouse button to drop the block on the line. • Simulink inserts the block where you dropped it. 49 Disconnecting Blocks • To disconnect a block from its connecting lines, hold down the Shift key, then drag the block to a new location. 50 Creating Subsystems • As your model increases in size and complexity, you can simplify it by grouping blocks into subsystems. Using subsystems has these advantages: • It helps reduce the number of blocks displayed in your model window. • It allows you to keep functionally related blocks together 51 Creating a Subsystem by Adding the Subsystem Block • To create a subsystem before adding the blocks • Copy the Subsystem block from the Ports & Subsystems library into your model. • Open the Subsystem block by double-clicking it. • In the empty Subsystem window, create the subsystem. • For example, the subsystem shown includes a Sum block and inport and Outport blocks to represent input to and output from the subsystem. 52 Creating a Subsystem by Grouping Existing Blocks • If your model already contains the blocks you want to convert to a subsystem, you can create the subsystem by grouping those blocks: • Enclose the blocks and connecting lines that you want to include in the subsystem within a bounding box. You cannot specify the blocks to be grouped by selecting them individually or by using the Select All command. • Choose Create Subsystem from the Edit menu. • If you open the Subsystem block, Simulink displays the underlying system, as shown below. 53

51,000 تومان