+ All Categories
Home > Documents > Workshop Simulink

Workshop Simulink

Date post: 18-Oct-2015
Category:
Upload: rakesh-singh-lodhi
View: 65 times
Download: 10 times
Share this document with a friend
Description:
MATLAB_Introduction to SimulinmkExamples of Simulation
Popular Tags:

of 32

Transcript
  • */14Introduction to SimulinkMr. Rakesh Singh LodhiAssistant ProfessorDepartment of Electrical EngineeringVindhya Institute of Technology & ScienceEmail Id-: [email protected] No.- +91-9755934324

  • ContentsWhat is SimulinkWhy SimulationIntroduction to Simulink in MATLAB environmentStarting and Running SimulinkSignals and Systems in SimulinkBasic Simulink Examples

    */14

  • What is SimulinkSimulink 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.

    Simulink offers a friendly, graphical environment, in which you can model systems in the form of block diagrams, by simply clicking and dragging blocks into a model window.

    Simulink has a comprehensive block library of sinks, sources, subsystems (linear, nonlinear, and time-varying)

  • Why Simulation?Goal: Study system performance, operationReal-system not available, is complex/costly or dangerous (eg: space simulations, flight simulations)Quickly evaluate design alternatives (eg: different system configurations)Evaluate complex functions for which closed form formulas or numerical techniques not available

  • */14Introduction to Simulink in MATLAB EnvironmentSimulink is a graphical, drag and drop environment for building simple and complex signal and system dynamic simulations.

    It allows users to concentrate on the structure of the problem, rather than having to worry (too much) about a programming language.

    The parameters of each signal and system block is configured by the user (right click on block)Signals and systems are simulated over a particular time.

  • */14Introduction to Simulink in MATLAB Environment

  • */14Starting and Running SimulinkType the following at the MATLAB command prompt >> simulinkThe Simulink library should appear

    Click File-New to create a new workspace, and drag and drop objects from the library onto the workspace.

    Selecting Simulation-Start from the pull down menu will run the dynamic simulation. Click on the blocks to view the data or alter the run-time parameters

  • */14Starting and Running SimulinkDouble click on component to edit parametersWire components togetherright button down and drag wireactivate output, hold CTRL and click on input

  • */14Signals and Systems in SimulinkTwo main sets of libraries for building simple simulations in Simulink:Signals: Sources and SinksSystems: Continuous and Discrete

  • */14Basic Simulink ExamplesCopy sine wave source and scope sink onto a new Simulink work space and connect.

    Set sine wave parameters modify to 2 rad/sec

    Run the simulation:Simulation - Start

    Open the scope and leave open while you change parameters (sin or simulation parameters) and re-run

  • Example 1: a simple modelBuild a Simulink model that solves the differential equation

    Initial conditionFirst, sketch a simulation diagram of this mathematical model (equation)

  • Simulation diagramInput is the forcing function 3sin(2t)Output is the solution of the differential equation x(t)

    Now build this model in Simulink3sin(2t)(input)x(t)(output)integrator

  • Select an input blockDrag a Sine Wave block from the Sources library to the model window

  • Select an operator blockDrag an Integrator block from the Continuous library to the model window

  • Select an output blockDrag a Scope block from the Sinks library to the model window

  • Connect blocks with signalsPlace your cursor on the output port (>) of the Sine Wave blockDrag from the Sine Wave output to the Integrator inputDrag from the Integrator output to the Scope inputArrows indicate the direction of the signal flow.

  • Select simulation parametersDouble-click on the Sine Wave block to set amplitude = 3 and freq = 2.

    This produces the desired input of 3sin(2t)

  • Select simulation parametersDouble-click on the Integrator block to set initial condition = -1.

    This sets our IC x(0) = -1.

  • Select simulation parametersDouble-click on the Scope to view the simulation results

  • Run the simulationIn the model window, from the Simulation pull-down menu, select Start

    View the output x(t) in the Scope window.

  • Simulation resultsTo verify that this plot represents the solution to the problem, solve the equation analytically.

    The analytical result,

    matches the plot (the simulation result) exactly.

  • Simulink Problem:-2Problem: We need to simulate the resonant circuit and display the current waveform as we change the frequency dynamically.+v(t) = 5 sin ti10 100 uF0.01 HVaries from 0 to 2000 rad/sObserve the current. What do we expect ?The amplitude of the current waveform will become maximum at resonant frequency, i.e. at = 1000 rad/s

  • Continue:-..How to model our resonant circuit ?+v(t) = 5 sin ti10 100 uF0.01 HWriting KVL around the loop,

  • Differentiate w. r. t. time and re-arrange:Taking Laplace transform:Continue:-..

  • Thus the current can be obtained from the voltage:Continue:-..

  • Start Simulink by typing simulink at Matlab promptSimulink library and untitled windows appearContinue:-..

  • Constructing the model using Simulink:Drag and drop block from the Simulink library window to the untitled windowContinue:-..

  • Constructing the model using Simulink:Continue:-..

  • RLC-Series Circuit*/14

  • */14

  • Implementation

  • Thankyou*/14

    *


Recommended