EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a...
-
Upload
isaac-gregory -
Category
Documents
-
view
222 -
download
0
Transcript of EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a...
![Page 1: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/1.jpg)
EE3417 – Introduction to Simulink
• Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose
• Dynamic system is described by differential equations.
• Simulink is a numerical differential equation solver.
• Launch Simulink>> simulink
![Page 2: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/2.jpg)
Create a new model
• Click the new-model icon in the upper left corner to start a new Simulink file
• Select the Simulink icon to obtain elements of the model
![Page 3: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/3.jpg)
Your workspace
Library of elements Model is created in this window
![Page 4: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/4.jpg)
Save your model
• You might create a new folder, like the one shown below, called simulink_files
• Use the .mdl suffix when saving
![Page 5: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/5.jpg)
Example 1: a simple model
• Build a Simulink model that solves the differential equation
• Initial condition• First, sketch a simulation diagram of this
mathematical model (equation)
tx 2sin3.1)0( x
![Page 6: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/6.jpg)
Simulation diagram
• Input is the forcing function 3sin(2t)• Output is the solution of the differential
equation x(t)
• Now build this model in Simulink
xxs1
3sin(2t)(input)
x(t)(output)
1)0( x
integrator
![Page 7: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/7.jpg)
Select an input block
Drag a Sine Wave block from the Sources library to the model window
![Page 8: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/8.jpg)
Select an operator block
Drag an Integrator block from the Continuous library to the model window
![Page 9: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/9.jpg)
Select an output block
Drag a Scope block from the Sinks library to the model window
![Page 10: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/10.jpg)
Connect blocks with signals
• Place your cursor on the output port (>) of the Sine Wave block
• Drag from the Sine Wave output to the Integrator input
• Drag from the Integrator output to the Scope input Arrows indicate the direction of the
signal flow.
![Page 11: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/11.jpg)
Select simulation parameters
Double-click on the Sine Wave block to set amplitude = 3 and freq = 2.
This produces the desired input of 3sin(2t)
![Page 12: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/12.jpg)
Select simulation parameters
Double-click on the Integrator block to set initial condition = -1.
This sets our IC x(0) = -1.
![Page 13: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/13.jpg)
Select simulation parameters
Double-click on the Scope to view the simulation results
![Page 14: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/14.jpg)
Run the simulation
In the model window, from the Simulation pull-down menu, select Start
View the output x(t) in the Scope window.
![Page 15: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/15.jpg)
Simulation results
To verify that this plot represents the solution to the problem, solve the equation analytically.
The analytical result,
matches the plot (the simulation result) exactly.
ttx 2cos)( 23
21
![Page 16: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/16.jpg)
Example 2• Build a Simulink model that solves the
following differential equation– 2nd-order mass-spring-damper system– zero ICs– input u(t) is a step with magnitude 1– parameters: m = 1, c = 0.5, k = 2
![Page 17: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/17.jpg)
(Continue)
![Page 18: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/18.jpg)
(Continue)
• You can flip the orientation of the block by right click > Format > Flip Block
![Page 19: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/19.jpg)
(Continue)
• The last thing we need to do is to add all the signals together using ‘Sum’ block.
![Page 20: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/20.jpg)
(Continue)
• At this point, the model accurately solves the ordinary differential equation.
![Page 21: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/21.jpg)
(Continue)
• At this point, the model accurately solves the ordinary differential equation.
![Page 22: EE3417 – Introduction to Simulink Simulink is a tool for simulating dynamic systems with a graphical interface specially developed for this purpose Dynamic.](https://reader036.fdocuments.in/reader036/viewer/2022062410/5697bfde1a28abf838cb24ab/html5/thumbnails/22.jpg)
(Continue)
u(t) Signal z(t) Signal