Simulink Tutorial Series – 1
Are you new to the world of Model-Based Development? Are you looking for a good working Simulink model examples / Simulink Tutorial to understand how Model-Based Development works?
If yes, then you are on the right page!
In this article, I am going to discuss exactly, what you are looking for.
Matlab/Simulink is the leading software in the industry for model based development.
There are several other online resources, where you can get theoretical knowledge about Matlab/Simulink. But, there are not many resources to explain the theory along with good examples. This is going to be a Simulink Tutorial for beginners with examples. In every series, I will add real-life working examples and show how to build models for a particular problem.
What is Simulink
Simulink is a product from Matlab. Simulink is mainly used for Model Based Design and Development.
How to start Simulink
You can open the Matlab by clicking on the desktop shortcut. Then, you need to just type “simulink” in the Command Window and hit enter.
The Simulink tool will open up.
Now, this is how the simulink start page will look like. In the Simulink start page, you will see options for creating blank model, blank library, blank project etc.
How to Open a Blank Model
To open a Blank model, you need to click on the “Blank Model” option. I can also create a Blank Library or a blank project.
When you click on the “Blank Model” option, you can see a simulink blank canvas/blank model opened up.
Simulink Library Browser
Now, there is another important option we need to know is – Library Browser. This is where all the Simulink library blocks exist. We can find the “Library Browser” option below the title bar of the Simulink blank model. I have marked in a red rectangular box in the image below.
Once the Simulink Library Browser is opened up, I can select required block and drag and drop on my Simulink blank canvas/model. We can connect all the required blocks and build a meaningful model.
The Simulink Library browser may take some time to open up based on your system speed and Simulink libraries. installed on your system.
Create a Simple Simulink Model
So far, we have seen how to start Matlab and how to open up the Simulink. We have also seen, how to create a blank Simulink model and how to open the Library Browser.
In the Simulink Library Browser, You can find various sections. In each section, you can find the relevant blocks. For example, in the “Math Operations” section, I can find all the blocks required to perform mathematical operations.
Blocks Required for our simple model
I need the following blocks for implementing a simple model:
- Constant Block
- Gain Block
- Display Block
Now, I have to find these blocks in the Library Browser. Then, I can drag and drop those blocks in my blank Simulink model.
If you want to find a particular block in the Simulink library browser, there are several ways to find it. The quick way for the beginners is just typing the required block name in the find box in the Simulink Library Browser and hit enter. But, when you have a good experience you can easily find a particular block by navigating to the relevant section.
Similarly, I can easily find the gain block just by typing the “gain” in the find box in the Simulink Library Browser and hit enter.
Now, lastly, I need a display block to show the output of the model. I can easily find the display block in the Simulink Library Browser by just typing the “display” in the Find box and hit enter.
Building the Model
Now since we have found all the required blocks for our simple model, I will just drag and drop them one by one into my blank simulink model:
Now, I will set the constant value. The default constant value is set to 1. I want to change it to 10. I will just double click on the constant block. A block parameters dialog box will open up and I can set the value there.
Similarly, I want to set the gain value as 5. I will double click on the gain block and set the gain value as 5 in the block parameters dialog box.
Now, I our Model is ready. I will now, run the model and see if the output is displaying correctly. The Green Play button, circled in red color, is used to execute the model. The output will be displayed in the display block.
So, now, I have the simple model ready and giving the expected output.
Today, in this article – Simulink Tutorial Series – 1, I have explained step-by-step, how to create a simple Simulink model from scratch.
If you have any questions, please feel free to comment in the comment box below.
In the next series – Simulink Tutorial Series – 2, I will explain about how to implement if-else logic in Simulink model.
I will keep sharing useful real-life Simulink model example here in this series.