Docsity

Mastering MATLAB/Simulink: Fundamental Concepts and Practical Applications, Schemes and Mind Maps of Electronics

Toggle sidebar
bg1
Mastering MATLAB/Simulink
Class: 1 Date: 25/06/2021
Topic: Fundamental concepts of MATLAB/Simulink
Software Required: MATLAB R2018a or Equivalent.
Introduction to Simulink
What is Simulink?
The word ‘Simulink’ is derived from the word Simulation and Link which is
available in the form of a toolbox and is an integral part of MATLAB. It is linked
with the MATLAB for modeling, simulation and analysis of a dynamic system in
block diagram form. In this chapter, we will learn about the basic features of
Simulink from getting started to creating, running and analyzing a dynamic model of
a system and linking of .m file with .mdl/.slx file.
Simulation Steps:
Simulation in a system involves the following steps:
Observing the physical system.
Formulating a mathematical model.
Predicting the behavior of a system.
Testing the validity of the model.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d

Partial preview of the text

Download Mastering MATLAB/Simulink: Fundamental Concepts and Practical Applications and more Schemes and Mind Maps Electronics in PDF only on Docsity!

Mastering MATLAB/Simulink

Class: 1 Date : 25/06/ Topic: Fundamental concepts of MATLAB/Simulink Software Required: MATLAB R2018a or Equivalent.

Introduction to Simulink

What is Simulink?

The word ‘ Simulink ’ is derived from the word Simulation and Link which is available in the form of a toolbox and is an integral part of MATLAB. It is linked with the MATLAB for modeling, simulation and analysis of a dynamic system in block diagram form. In this chapter, we will learn about the basic features of Simulink from getting started to creating, running and analyzing a dynamic model of a system and linking of .m file with. mdl/.slx file.

Simulation Steps :

Simulation in a system involves the following steps:  Observing the physical system.  Formulating a mathematical model.  Predicting the behavior of a system.  Testing the validity of the model.

Types of mathematical model :

Mathematical models can be classified in many ways. Those are categorized as below:

  1. Linear and Non-linear Model:  Linear model: A model which obeys the principles of superposition.  Non-linear Model: A model which possesses mathematical relations that are not linear.
  2. Lumped and Distributed Parameter Model:  Lumped Parameter Model: A model that is described by ordinary differential equation with only one independent variable.  Distributed Parameter Model: A model which is described by partial differential equation with two or more independent variables (time and one or more parameters).
  3. Static and Dynamic model:  Static model: A model which does not take time variation into account.  Dynamic Model: A model which has time variant characteristics.
  4. Continuous and Discrete Model:  Continuous Model: A model in which dependent variables are continuous in time.  Discrete Model: A model in which equations are described at distinct instances of time. Simulink has built in blocks under different libraries such as continuous, discrete, math operations, sinks, sources etc. to facilitate the user as per the requirement.

Developing a Model :

For developing a model, we can follow these steps:  Identifying the purpose of the model and its constraints.

Figure- 2. From the command window. After starting Simulink by choosing any of options, blank model option will pop up. By clicking it, we will get a new page for Simulink where we mainly draw any model for simulation or any kind of math operations. Figure- 3. Option for Blank Model. New Model

Figure- 4. Simulink page. In the Simulink page, we can see the ‘ Library Browser option’ where different kinds of blocks are available. Continuous, Discontinuous, Discrete, Math operations, Sinks, Sources, Commonly Used Blocks etc. blocks are seen. From these blocks, we can use the elements to draw a model or solve a problem. Library

Table : A list of Commonly Used Blocks

and their Locations in Simulink Library Browser

Continuous Derivative Numerical derivative of input signal Integrator Continuous time integrator of input signal Transfer Function Transfer function of a system Transport Delay Apply specified delay to the input signal Discontinuities Dead Zone Output zero for inputs within the dead zone specified Relay Output the specified ‘on’ or ‘off’ value by comparing the input to the specified thresholds Saturation Limit input signal to the upper and lower saturation values Discrete Difference Output the current input value minus the previous input value Discrete Derivative Discrete time derivative of the input Memory Apply one integration step delay Unit Delay Sample and hold with the one sample period delay Math Operations Abs Output absolute value of input Add Add or subtract inputs (maybe more than two) Divide Multiply or divide inputs Gain Element wise gain or matrix gain of input signal Trigonometric Function Trigonometric and hyperbolic functions Sinks Display Numeric display of input value Scope Display signals during simulation To File Write data to a file To Workspace Write data to workspace in matrix form

Sources Clock Display system time Constant Inject a constant value as input From File Read data from a given file From Workspace Read data from a matrix in workspace Pulse Generator Generate Time-based or Sample-based pulses Repeating Sequence Repeat an arbitrary signal Signal Generator Generate various waveform such as sin, square, sawtooth etc. Sine Wave Sine wave generator Step Generate a step function

Creating/opening a Simulink model :

Once Simulink browser window is opened, the user can create a new model or open an existing model. By clicking on the new model icon from the toolbar of Simulink Library browser, a new model can be created using different elements from the box.

Opening an Existing model :

 By clicking on the Open Model icon from the toolbar of Simulink Library Browser.  By selecting Open option from the File menu of Simulink Library Browser.  By pressing Ctrl+O keys at the active Simulink Library Browser. A new Open dialog box will appear on the screen. The desired model file can be opened by selecting its location.

Creating and Simulating a Simulink Model :

The various steps involved to create a Simulink Model are as follows:

  1. Describe the mathematical model of the system (may be mix of integral and algebraic equation).
  2. Select the independent or dependent variables.
  3. Open a new model from the File menu.
  4. Copy different blocks from library on to the model (using drag and drop feature).

Step-2: Open “Commonly Used Blocks” and select “Scope” Step-3: Set parameters of sine wave

Step-4: Connect sine wave with scope and run this simulation at 0.06s simulation time Step-5: Click on scope to see the desired waveform

Step- 3 : Open “Math Operations” and select “Trigonometric Function”. Step-4: Change parameter to get cosine function

Step-5: Open “Commonly Used Blocks” and select “Product” block Step- 6 : Select “Digital Clock”

Step- 9 : Click on the “scope” to see waveforms of sine and cosine Sine Wave Cosine Wave

Problem-3.

Addition, Subtraction, Multiplication and Division operations. Step-1: Open “Sources” from Simulink library and select “Sine Wave” Step- 2 : Open “Math Operations” and select “Add” block

Step- 5 : Set parameters of sine waves

Step- 6 : Connect all the blocks and run the simulation