Basic Tutorial on RLC Circuit Simulation with MATLAB

This article demonstrates how to perform circuit simulation using MATLAB to measure the voltage of an RLC circuit. I am using R2014a, and the interface may vary slightly in different versions of the software.

Open the MATLAB software and create a new Simulink Model, as shown in the figure below.

Basic Tutorial on RLC Circuit Simulation with MATLAB

After the untitled window pops up, enter the following command in the command line window and press Enter:

>> powerlib

This will invoke the powerlib library.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Double-click on Electrical Sources to open the power module.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Drag the AC Voltage Source into the untitled window.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Then double-click on Elements in the powerlib library.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Drag the Series RLC Branch into the window, select it, and press Ctrl+C, Ctrl+V to copy another Series RLC Branch1.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Double-click on the AC Voltage Source in the window to bring up the parameter settings dialog, as shown in the figure, setting the voltage to 10V and the frequency to 60Hz.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Click on the label, press Ctrl+A to select it, turning it blue.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Rename the two Series RLC Branches to RLC Load1 and RLC Load2, respectively.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Double-click on RLC Load1 and RLC Load2 to set the resistance, inductance, and capacitance parameters.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Click and drag the terminal connections to connect the circuit.

Basic Tutorial on RLC Circuit Simulation with MATLAB

You need to call the Voltage Measurement from the Measurements module to measure the voltage, dragging it into the window.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Use the virtual oscilloscope Scope from the Sinks in the Simulink module to display the waveform, dragging it into the window.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Drag the interactive interface tool powergui into the window.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Finally, the connected circuit simulation model is as shown below.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Click the Run button to start the simulation.

Basic Tutorial on RLC Circuit Simulation with MATLAB

After the simulation is complete, double-click on Scope to view the simulation waveform.

Basic Tutorial on RLC Circuit Simulation with MATLAB

Leave a Comment