SlideShare une entreprise Scribd logo
1  sur  19
MIT OpenCourseWare
http://ocw.mit.edu




6.094 Introduction to MATLAB®
January (IAP) 2009




For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
6.094
Introduction to Programming in MATLAB®



          Lecture 5: Simulink®




             Sourav Dey
           Danilo Šćepanović
              Ankit Patel
              Patrick Ho

                IAP 2009
What is Simulink?

• A model-based equation solver

• Some analysis packages (ANSYS, Multisim) have
  built in equations modeling complex engineering
  problems.
       Save lots of time
       Can only be used for tackling specific problems


• Simulink lets you build a GUI-based model and
  simulates the result.
       Unlimited complexity (constrained by runtime and
       memory)
       Adaptable for any field
       Downside? You have to do the modeling work
Getting Started

• Create a new file

• Examine the Simulink Library Browser
       Click on a library: “Sources”

       Drag a block into Simulink: “Constant”

       Visualize the block by going into “Sinks”

       Drag a “Scope” into Simulink
Connections

• Click on the carat/arrow on the right of the
  constant box

• Drag the line to the scope
       You’ll get a hint saying you can quickly connect
       blocks by hitting Ctrl
       Connections between lines represent signals


• Click the play button

• Double click on the scope.
       This will open up a chart of the variable over the
       simulation time
Simulink Math

• Everything is visual in Simulink!

• Click on the library Continuous
       Drag the integrator block between the constant and
       the scope


• Play and click on scope.

• What happens?
       Simulink has a built in ODE solver
       The equation that represents your model is solved by
       Simulink
       We’ve represented
Behind the curtain
• Go to “Simulation”->”Configuration Parameters”
  at the top menu
          See ode45? Change the solver type here




                Courtesy of The MathWorks, Inc. Used with permission.
So what’s going on?

• The toolboxes Simulink provides you are full of
  modeling tools

• By selecting components that correspond to your
  model, you can design a simulation
Toolboxes

• Math
        Takes the signal and performs a math operation
   » Add, subtract, round, multiply, gain, angle
• Continuous
        Adds differential equations to the system
   » Integrals, Derivatives, Transfer Functions,
     State Space
• Discontinuities
         Adds nonlinearities to your system
• Discrete
         Simulates discrete difference equations
         Useful for digital systems
Building systems

• Sources
  » Step input, white noise, custom input, sine
    wave, ramp input,
      Provides input to your system
• Sinks
  » Scope: Outputs to plot
  » simout: Outputs to a MATLAB vector on workspace
  » MATLAB mat file
Modifying Blocks
• Right click on the block, select the “Parameters” item
  corresponding to the item type
• Transfer Function:
   » Numerator on
   first row
   » Denominator on
   second row

• Summing Junction:
   » List of signs
   determines
   inputs to
   junction
   Not shown:
   Sampling time row
                           Courtesy of The MathWorks, Inc. Used with permission.
Modifying Scopes

• Within the scope:
  » Autoscale fits the axes
  to the curve automatically
  » Axes properties lets you
  customize the axes

• Changing the number of axes:
   » Left click on           icon                          Courtesy of The MathWorks, Inc. Used with permission.
             Courtesy of The MathWorks,
             Inc. Used with permission.


   » Change the number
   of axes field


   Courtesy of The MathWorks, Inc. Used with permission.
First System

• Drag a summing
  junction between the
  constant and
  integrator

• Change the signs to
  |+-

• Click on the open
  carat under the minus
  sign and connect it to
  the integrator output
Creating Subsystems

• Drag a box around the
  parts of the subsystem
        Summing Junction
        Integrator
• Right click and select
  “create subsystem”

• Double click the
  subsystem:
       The parts are now
       inside

• What’s the system do
  when you run it?
Example Systems
ODE                                         Classical Control System
d3y/dt3 + a*d2y/dt2 +
b* dy/dt + c*y = F




                                               Courtesy of The MathWorks, Inc. Used with permission.
                    Courtesy of The
                    MathWorks, Inc.
                    Used with permission.
Example: Nervous System

• Neural circuits in animals often exhibit oscillatory behavior

• Use Simulink to model one behavior of this type:
        Locomotion
             – Limbs go “Left-right, left-right, left-right”


• Locomotive behaviors are generated by “central pattern
  generators,” which oscillate on their own naturally

• When connected to an appendage, the central pattern
  generator will adapt its frequency and move the
  appendage. Open “RIOCPGDemo.mdl”

•   Model based on Iwasaki, T., Zheng, M. (2006a). Sensory feedback
    mechanism underlying entrainment of central pattern generator to
    mechanical resonance. Biological Cybernetics, 94(4), 245-261
Central Pattern Generator Model



                             Scope for
                              Output




 Limb
Playing with the model

• Look at scopes
       What are the output signals?
• Delete signals
       Especially the signal after the feedback gain
• Change gains
       Muscular actuator gains
       Switch feedback gain from negative to positive
• Look inside subsystems
       What’s inside the CPG?
       What’s inside the neuron firing dynamics?
Toolboxes

• Simulink has many advanced toolboxes
        Control Systems
        Neural Networks
        Signal Processing
        SimMechanics
        Virtual Reality
        Real Time

• Hopefully you’ll get to use some of these powerful tools!

Contenu connexe

Similaire à learn matlab for ease Lec5

Intro to LV in 3 Hours for Control and Sim 8_5.pptx
Intro to LV in 3 Hours for Control and Sim 8_5.pptxIntro to LV in 3 Hours for Control and Sim 8_5.pptx
Intro to LV in 3 Hours for Control and Sim 8_5.pptxDeepakJangid87
 
Simulink Presentation.ppt
Simulink Presentation.pptSimulink Presentation.ppt
Simulink Presentation.ppthodeeeeee1
 
Software Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesSoftware Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesAngelos Kapsimanis
 
Simulink7-GEtting Started Guide Simulink7-GEtting Started Guide.ppt
Simulink7-GEtting Started Guide Simulink7-GEtting Started Guide.pptSimulink7-GEtting Started Guide Simulink7-GEtting Started Guide.ppt
Simulink7-GEtting Started Guide Simulink7-GEtting Started Guide.pptHassenMOuakkad
 
Applications of simulation in Business with Example
Applications of simulation in Business with ExampleApplications of simulation in Business with Example
Applications of simulation in Business with ExamplePratima Ray
 
Getting Started with Innoslate
Getting Started with InnoslateGetting Started with Innoslate
Getting Started with InnoslateElizabeth Steiner
 
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOT
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOTCONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOT
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOTShubhamArora175
 
000000 lw04 simulink
000000 lw04 simulink000000 lw04 simulink
000000 lw04 simulinkdpm gumti
 
Discrete event simulation
Discrete event simulationDiscrete event simulation
Discrete event simulationssusera970cc
 
08 neural networks
08 neural networks08 neural networks
08 neural networksankit_ppt
 
Mat lab workshop
Mat lab workshopMat lab workshop
Mat lab workshopVinay Kumar
 
Tools for analysis and evaluation of CPU Performance
Tools for analysis and evaluation of CPU PerformanceTools for analysis and evaluation of CPU Performance
Tools for analysis and evaluation of CPU PerformanceMourad Bouache
 
Machine Learning Essentials Demystified part2 | Big Data Demystified
Machine Learning Essentials Demystified part2 | Big Data DemystifiedMachine Learning Essentials Demystified part2 | Big Data Demystified
Machine Learning Essentials Demystified part2 | Big Data DemystifiedOmid Vahdaty
 
Pcb design training in mumbai
Pcb design training in mumbaiPcb design training in mumbai
Pcb design training in mumbaivibrantuser
 

Similaire à learn matlab for ease Lec5 (20)

Intro to LV in 3 Hours for Control and Sim 8_5.pptx
Intro to LV in 3 Hours for Control and Sim 8_5.pptxIntro to LV in 3 Hours for Control and Sim 8_5.pptx
Intro to LV in 3 Hours for Control and Sim 8_5.pptx
 
Simulink Presentation.ppt
Simulink Presentation.pptSimulink Presentation.ppt
Simulink Presentation.ppt
 
Software Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesSoftware Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniques
 
When Should I Use Simulation?
When Should I Use Simulation?When Should I Use Simulation?
When Should I Use Simulation?
 
Simulink7-GEtting Started Guide Simulink7-GEtting Started Guide.ppt
Simulink7-GEtting Started Guide Simulink7-GEtting Started Guide.pptSimulink7-GEtting Started Guide Simulink7-GEtting Started Guide.ppt
Simulink7-GEtting Started Guide Simulink7-GEtting Started Guide.ppt
 
Applications of simulation in Business with Example
Applications of simulation in Business with ExampleApplications of simulation in Business with Example
Applications of simulation in Business with Example
 
simulink
simulinksimulink
simulink
 
Getting Started with Innoslate
Getting Started with InnoslateGetting Started with Innoslate
Getting Started with Innoslate
 
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOT
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOTCONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOT
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOT
 
Scilab
ScilabScilab
Scilab
 
Industry Training: 03 Awareness Simulation
Industry Training: 03 Awareness SimulationIndustry Training: 03 Awareness Simulation
Industry Training: 03 Awareness Simulation
 
000000 lw04 simulink
000000 lw04 simulink000000 lw04 simulink
000000 lw04 simulink
 
Discrete event simulation
Discrete event simulationDiscrete event simulation
Discrete event simulation
 
08 neural networks
08 neural networks08 neural networks
08 neural networks
 
scilab
scilabscilab
scilab
 
Mat lab workshop
Mat lab workshopMat lab workshop
Mat lab workshop
 
Tools for analysis and evaluation of CPU Performance
Tools for analysis and evaluation of CPU PerformanceTools for analysis and evaluation of CPU Performance
Tools for analysis and evaluation of CPU Performance
 
Machine Learning Essentials Demystified part2 | Big Data Demystified
Machine Learning Essentials Demystified part2 | Big Data DemystifiedMachine Learning Essentials Demystified part2 | Big Data Demystified
Machine Learning Essentials Demystified part2 | Big Data Demystified
 
Pcb design training in mumbai
Pcb design training in mumbaiPcb design training in mumbai
Pcb design training in mumbai
 
Developing Digital Twins
Developing Digital TwinsDeveloping Digital Twins
Developing Digital Twins
 

Plus de Amba Research (20)

Case Econ08 Ppt 16
Case Econ08 Ppt 16Case Econ08 Ppt 16
Case Econ08 Ppt 16
 
Case Econ08 Ppt 08
Case Econ08 Ppt 08Case Econ08 Ppt 08
Case Econ08 Ppt 08
 
Case Econ08 Ppt 11
Case Econ08 Ppt 11Case Econ08 Ppt 11
Case Econ08 Ppt 11
 
Case Econ08 Ppt 14
Case Econ08 Ppt 14Case Econ08 Ppt 14
Case Econ08 Ppt 14
 
Case Econ08 Ppt 12
Case Econ08 Ppt 12Case Econ08 Ppt 12
Case Econ08 Ppt 12
 
Case Econ08 Ppt 10
Case Econ08 Ppt 10Case Econ08 Ppt 10
Case Econ08 Ppt 10
 
Case Econ08 Ppt 15
Case Econ08 Ppt 15Case Econ08 Ppt 15
Case Econ08 Ppt 15
 
Case Econ08 Ppt 13
Case Econ08 Ppt 13Case Econ08 Ppt 13
Case Econ08 Ppt 13
 
Case Econ08 Ppt 07
Case Econ08 Ppt 07Case Econ08 Ppt 07
Case Econ08 Ppt 07
 
Case Econ08 Ppt 06
Case Econ08 Ppt 06Case Econ08 Ppt 06
Case Econ08 Ppt 06
 
Case Econ08 Ppt 05
Case Econ08 Ppt 05Case Econ08 Ppt 05
Case Econ08 Ppt 05
 
Case Econ08 Ppt 04
Case Econ08 Ppt 04Case Econ08 Ppt 04
Case Econ08 Ppt 04
 
Case Econ08 Ppt 03
Case Econ08 Ppt 03Case Econ08 Ppt 03
Case Econ08 Ppt 03
 
Case Econ08 Ppt 02
Case Econ08 Ppt 02Case Econ08 Ppt 02
Case Econ08 Ppt 02
 
Case Econ08 Ppt 01
Case Econ08 Ppt 01Case Econ08 Ppt 01
Case Econ08 Ppt 01
 
pyton Notes9
pyton Notes9pyton Notes9
pyton Notes9
 
Notes8
Notes8Notes8
Notes8
 
Notes7
Notes7Notes7
Notes7
 
pyton Notes6
 pyton Notes6 pyton Notes6
pyton Notes6
 
pyton Notes1
pyton Notes1pyton Notes1
pyton Notes1
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Dernier (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

learn matlab for ease Lec5

  • 1. MIT OpenCourseWare http://ocw.mit.edu 6.094 Introduction to MATLAB® January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
  • 2. 6.094 Introduction to Programming in MATLAB® Lecture 5: Simulink® Sourav Dey Danilo Šćepanović Ankit Patel Patrick Ho IAP 2009
  • 3. What is Simulink? • A model-based equation solver • Some analysis packages (ANSYS, Multisim) have built in equations modeling complex engineering problems. Save lots of time Can only be used for tackling specific problems • Simulink lets you build a GUI-based model and simulates the result. Unlimited complexity (constrained by runtime and memory) Adaptable for any field Downside? You have to do the modeling work
  • 4. Getting Started • Create a new file • Examine the Simulink Library Browser Click on a library: “Sources” Drag a block into Simulink: “Constant” Visualize the block by going into “Sinks” Drag a “Scope” into Simulink
  • 5. Connections • Click on the carat/arrow on the right of the constant box • Drag the line to the scope You’ll get a hint saying you can quickly connect blocks by hitting Ctrl Connections between lines represent signals • Click the play button • Double click on the scope. This will open up a chart of the variable over the simulation time
  • 6. Simulink Math • Everything is visual in Simulink! • Click on the library Continuous Drag the integrator block between the constant and the scope • Play and click on scope. • What happens? Simulink has a built in ODE solver The equation that represents your model is solved by Simulink We’ve represented
  • 7. Behind the curtain • Go to “Simulation”->”Configuration Parameters” at the top menu See ode45? Change the solver type here Courtesy of The MathWorks, Inc. Used with permission.
  • 8. So what’s going on? • The toolboxes Simulink provides you are full of modeling tools • By selecting components that correspond to your model, you can design a simulation
  • 9. Toolboxes • Math Takes the signal and performs a math operation » Add, subtract, round, multiply, gain, angle • Continuous Adds differential equations to the system » Integrals, Derivatives, Transfer Functions, State Space • Discontinuities Adds nonlinearities to your system • Discrete Simulates discrete difference equations Useful for digital systems
  • 10. Building systems • Sources » Step input, white noise, custom input, sine wave, ramp input, Provides input to your system • Sinks » Scope: Outputs to plot » simout: Outputs to a MATLAB vector on workspace » MATLAB mat file
  • 11. Modifying Blocks • Right click on the block, select the “Parameters” item corresponding to the item type • Transfer Function: » Numerator on first row » Denominator on second row • Summing Junction: » List of signs determines inputs to junction Not shown: Sampling time row Courtesy of The MathWorks, Inc. Used with permission.
  • 12. Modifying Scopes • Within the scope: » Autoscale fits the axes to the curve automatically » Axes properties lets you customize the axes • Changing the number of axes: » Left click on icon Courtesy of The MathWorks, Inc. Used with permission. Courtesy of The MathWorks, Inc. Used with permission. » Change the number of axes field Courtesy of The MathWorks, Inc. Used with permission.
  • 13. First System • Drag a summing junction between the constant and integrator • Change the signs to |+- • Click on the open carat under the minus sign and connect it to the integrator output
  • 14. Creating Subsystems • Drag a box around the parts of the subsystem Summing Junction Integrator • Right click and select “create subsystem” • Double click the subsystem: The parts are now inside • What’s the system do when you run it?
  • 15. Example Systems ODE Classical Control System d3y/dt3 + a*d2y/dt2 + b* dy/dt + c*y = F Courtesy of The MathWorks, Inc. Used with permission. Courtesy of The MathWorks, Inc. Used with permission.
  • 16. Example: Nervous System • Neural circuits in animals often exhibit oscillatory behavior • Use Simulink to model one behavior of this type: Locomotion – Limbs go “Left-right, left-right, left-right” • Locomotive behaviors are generated by “central pattern generators,” which oscillate on their own naturally • When connected to an appendage, the central pattern generator will adapt its frequency and move the appendage. Open “RIOCPGDemo.mdl” • Model based on Iwasaki, T., Zheng, M. (2006a). Sensory feedback mechanism underlying entrainment of central pattern generator to mechanical resonance. Biological Cybernetics, 94(4), 245-261
  • 17. Central Pattern Generator Model Scope for Output Limb
  • 18. Playing with the model • Look at scopes What are the output signals? • Delete signals Especially the signal after the feedback gain • Change gains Muscular actuator gains Switch feedback gain from negative to positive • Look inside subsystems What’s inside the CPG? What’s inside the neuron firing dynamics?
  • 19. Toolboxes • Simulink has many advanced toolboxes Control Systems Neural Networks Signal Processing SimMechanics Virtual Reality Real Time • Hopefully you’ll get to use some of these powerful tools!