70 likes | 92 Views
Learn how to utilize Simulink, a powerful sub-program of Matlab, for graphical modeling, dynamic control, and simulation tasks. Explore the extensive library of standard Simulink models and various useful blocks for effective programming. Communicate with the workspace, customize simulations, and enhance your programming skills.
E N D
LOGIKA DAN PEMROGRAMAN KOMPUTER SIMULINK Wayan Nata Septiadi, ST nata@me.unud.ac.id
LOGIKA & PEMROGRAMAN KOMPUTER PENGERTIAN SIMULINK Simulink merupakan suatu sub program dari bahasa matlab yang dapat digunakan grafikal, pemodelan simulasi dan control dinamik. MATLAB commands and scripts can be executed interactively in the “Command Window”
LOGIKA & PEMROGRAMAN KOMPUTER Simulink Library Browser Library browser merupakan toolbook model yang terdiri dari sink, sources, math operation dan lain-lain Terdapat kurang lebih 2060 model simulink standar dalam library browser. Model tidak dapat dioperasikan pada comand windows Matlab. Model simulink dapat dioperasikan pada: Click File - New – Model (or Ctrl-N)
LOGIKA & PEMROGRAMAN KOMPUTER Model simulasi sederhana Connect block inputs and outputs according to the circuit equation Double-click a block to change parameter values To better document the model, double-click on the block name or on the connection line to change block and signal names as desired Drag an drop Gain block from Math Operations in the Library Drag an drop Sine Wave block from Sources in the Library Drag an drop Scope block from Sinks in the Library
LOGIKA & PEMROGRAMAN KOMPUTER Total simulation time (10 seconds in Click here to start simulation this example) can be changed here Click here to start simulation Autoscale Double-click on the Scope block to display the output waveform (current iR) Scope parameters Explore various menu options, block properties, etc. For example: • Add another axis to the Scope and display both iR and vR • Repeat simulations for different values of the sinewave amplitude or frequency, or different R
LOGIKA & PEMROGRAMAN KOMPUTER Communicating with the Workspace Any constant or variable defined in the Matlab workspace is available in the block diagram. The “simin” and “simout” blocks allow you to pass signals in from the workspace, and out to the workspace. Change the save format to “Array” for easiest use (double click on the To Workspace block for options). The “clock” source allows you to generate a time signal if you want to send that back to the workspace.
LOGIKA & PEMROGRAMAN KOMPUTER Other Useful Blocks Under “Discontinuous” you will find coulomb friction, dead zone, saturation, and relay. Under “Continuous” there is a delay block. Under “Simulink Extras” there is a PID controller, transfer function with nonzero initial conditions, some useful sinks (such as power spectral density), and radians-todegrees and Fahrenheitto- Celsius converters.