SIMULINK tool in MATLAB is used by Electrical engineers to Simulate electrical circuits. Today you’ll learn:
Also, learn the Basics of MATLAB for Electrical Engineers.
Contents
Get Started
Press the SIMULINK on the home tab. You can also write Simulink in the command window.
The Simulink Library Browser
Once you open Simulink, a library browser containing different items pops up:
Open new Simulink model from File > New > Model
Alternatively, you can use the shortcut Ctrl + NThe Simulink model is the mains screen where you drag items from the library.
Let’s make a circuit in Simulink.
A simple Series Circuit in Simulink
From the library, browser Go to SimPowerSystems library > Electrical Sources
Drag the DC Voltage source to the Simulink model file.
Click on SimPowerSystems > Elements and drag an RLC Series branch in the Simulink model.
Double click the branch and set the branch type to R.
After this set the resistance to 2000 ohms and hit Apply button in the lower right corner. Refer to figure below:
Press the CTRL + R button to rotate and properly align the resistor in a circuit.
Hold the left mouse button and connect the top terminal of the resistor to the +ve terminal of the source. Similarly, connect the lower terminal of the resistor to the -ve terminal of the source.
Click the DC Source and set its amplitude to 12 V.
Now, we have a series circuit of the form.
How to measure voltage in Simulink
Go to SimPowerSystems > Measurements > Voltage Measurement
Drag the Voltage Measurement block to the model and connect it in parallel to the resistor.
How to measure current in Simulink
Go to SimPowerSystems > Measurements > Current Measurement
Drag the Current Measurement block to the model, rotate it once and connect it in series to the resistor.
Now we have the following setting:
So far we have successfully obtained the voltage and current measurement.
However, we can’t read the measured values.
Let’s connect display block for reading the measured quantities.
How to add Display Block to Read Voltages and Current
Head over to the Simulink Library > Sinks > Display
Connect two display buttons at the output of voltage measurement and current measurement.
Click on Run Simulation.
Voltage always remains same in series, the 2000 ohms resistor dissipates all 12 V input and this voltage appears across the display block.
The current block measures the current in the series circuit. which is 0.006 Amps.
Theoretically: I = V/R = 12 V / 2000 ohms = 6 mA = 0.006
Labels in Simulink
Good Engineering practice involves proper labeling of circuit elements. Simple double click the labels to rename them.