Involvement of simulation in teaching is to provide better support and more clear and visual operation of complex circuits to the faculty members of electrc circuits in classroom teaching. The simulations available for the simulation of electrical circuits are MATLAB, C+, and many more. The use of simulation in classroom teaching provides additional support to the faculty members, and it is better than the time-consuming black board practice. This paper provides a case study of electrc circuits such as RC, RL, and RLC in Matlab software. Different electrics circuit models are prepared on Matlab software and generate simulation voltage forms. This paper is helpful for to find the applications of Matlab in teaching.
Keywords: Matlab; Simulation; Electrical circuits; Teaching
Received: Jan 22, 2024 · Revised: Apr 20, 2024 · Accepted: May 11, 2024 · Published: 2024-06-14
Corresponding author: Hassan Asnaoui, [email protected]
This is an open access article under the CC BY 4.0 license.
How to cite: Hassan Asnaoui, M. Kalis, M. Boulaalam, "The Study of Simulation of RC, RL and RLC Circuits Using Matlab in Teaching," International Journal of Engineering and Applied Physics, vol. 4, no. 2, pp. 955–960, 2024.
MATLAB is a widely used tool in the electrical and electronic fields. The original concept of a small and handy tool has evolved to become a workhorse widely used for research and design purposes [1]. It is now accepted that MATLAB and its numerous toolboxes can replace and/or enhance the use of traditional simulation tools for advanced engineering applications [2]. With all these features, MATLAB, with or without toolboxes, has come to occupy an indisputable position in the list of available software in all technical institutions [3]. In fact, it has become a de facto standard. Since it is already easily available in institutions, in this paper it is proposed to use MATLAB to create a GUI-based package for effective teaching of electricity [4].
Teachers are constantly in search of better methods to teach students [5]. Where the learning process was a teacher-centred one, whereas the recent trend is to adopt a student-centred learning process. To make teaching highly efficient and successful, it is required to diversify modern teaching methods [6]. For this reason, we will employ modern technology to study some physical phenomena, especially in the field of electricity, through scientific experiments to confirm the textbook results for the baccalaureate level, such as RC, RL, and RLC. And in this regard, in [7], the authors presented a derivation of fractional-order circuit elements. Furthermore, the authors obtained experimentally the curves of charge and discharge of different capacitors in electrical RC circuits and charge variation in an electrical LC circuit; compared with classical simulations [8, 9]. With these, we can predict the reactions of various systems, such as RC, RL, and the oscillations of an RLC circuit. Through the use of simulations in Matlab, it becomes possible to accurately model the behaviour of such system.
In the second-level sciences baccalaureate in Morocco, for the electricity part, there are three main circuits combining resistors (R), capacitors (C) and inductors (L). These are the RC, RL, and RLC circuits, where the circuit elements can be connected in series, parallel, or a combination, as these circuits are typically utilised in physics laboratory programmes.
In a series RC circuit, when measuring across the resistor, a capacitor is a high-pass filter. This is due to the generator tension of the capacitors reactance, where the electric current is proportional to the voltage in the RC circuit. In the tension response, the interesting point occurs when the power is equally divided between the resistor and the capacitor. The voltage versus time for the capacitor charging and discharging are given as Eqs. (1) and (2) [10, 11].

In a series RL circuit, again measuring across the resistor and for coil L, the current versus time is given as Eqs. (3) and (4) [12–15].

Equations (3) and (4) represent represent establishment and interruption of current, respectively.
In a series RLC circuit, the combination of the inductor, the resistor, and the capacitor. At this moment, the circuit is closed, and we intend to study the behaviour and variation of circuit electrical parameters after connection. The integral-differential equation which corresponds this considered circuit (RLC) is the


The basic Matalb process is represented in Fig. 1. A circuit is represented in Matlab in four blocks: the Matlab interface, the Simulink library, the Simscope, and the SimpowerSystems. As the following chart shows.
Matlab interface


Simpower Systems
Figure 1. Chart of circuit analysis by Matlab
In laboratory experiments, due to the lack of equipment, we have combined simulation techniques in Matlab to study electrical circuits as RC, RL, and RLC, which consist of the following parameters: resistor R, capacitor C, and induction L.
Illustrative example. Consider the RC electrical circuit (Fig. 2) with R = 10Ω, C = 1000μF, and E = 15V for capacitor charging. And R = 1KΩ, C = 1000μF, E = 0V, R = 10Ω, C = 1000μF, and capacitor initial voltage 15v, for capacitor discharge.

Illustrative example. Consider the RL electrical circuit (Fig. 3) with R = 10Ω, L = 0.1H, and E = 15V for power establishment. And R = 10 Ω; L = 0.1H; E = 0V; and inductor initial voltage = 1.5 for interruption of power.

For this example, the RLC circuit is made up: the inductance L = 1H, resistor R and capacitor C=0.01F. In this electrical assembly we will study the effect of resistor on the RLC circuit response, with; R1=1Ω, R2 = 18Ω, and R3 = 21Ω.

After that click in Scope, the voltage as a function of time is displayed in Figs. 5, 6, 7, 8, and 9.
The simulations consisted of the following analysis of RC, RL, and RLC circuits: Figures 5.6.7.8.9 compare, for several simulation types, the responses of different circuits. These figures show the voltage form obtained from simulating in Matlab. The results show the charging and discharging of the capacitor (Fig. 5).

establishment and the breakage (cancellation) of current.

The experimental data and model predictions of RL and RC are shown in Figs. 5 and 6. The increase in time With the voltage and current increasing until reaching a maximum value of 15V at t = 4s for RC and 1.5A at 0.045s, this is due to the total charge of the capacitor for RC and the current establishment for RL. Then, the voltage and current remain constant, which shows both a transient and permanent regime. On the other hand, the decrease in voltage and current as a function of time is due to the capacitor discharge for RC and the current breakdown for RL. The response of RC and RL circuits is required for selecting the optimum operating conditions for further experiments, where the amplitude response of an RLC was measured (Figs. 7, 8, and 9). Shows the output from the voltage analysis. This is because the measurement voltages are made with Matlab, and we showed that the amplitude depends on R with: R1 = 1Ω, R2 = 18Ω, and R3 = 21Ω.

We repeat the same previous experiment, where each time we change the value of R so that: R1<R2<R3, so we get the following curves:


When the value of R increases, the obtained oscillations become damped and the semi-period Tgradually increaseses.
If the resistance value R is weak (case R=R1), the amplitude of the vibrations gradually decreases, and the resulting system is called a quasi-periodic system.
If the value of the resistance R is large (the case R=R3), the amplitude decreases without oscillation, and the resulting system is called an aperiodic system.
While there is a resistor that separates the quasi-periodic system from the aperiodic system, it is called
the critical resistor Rc.With RC
= 20Ω
Discharging a charged capacitor, in a series coil RLC, leads to the appearance of free and damped oscillations. We say that the series circuit RLC is a free electrical oscillator and a damped one.
According to the value of R as the circuit RLC, we distinguish oscillation systems: periodic system - quasi-periodic system - critical system - non-periodic system.
These results are in agreement with the results of the books of second-year scientific baccalaureate students [14]. For example, the response RC, RL, and RLC Ciruits, was Resistor dependent obtained in [15].
The following advantages are derived when using Matlab in teaching electric circuits courses:
a. It provides better visual operation of electrical circuits.
b. The use of software in the classroom saves time.
c. With its user-friendly interface, its simulation speed, and its capability of simulating any type of power converter and control circuit.
d. Students can use this software for their projects. This paper provides a basic approach to dealing with the software. The only limitation with this software approach is that knowledge of computers and in-depth knowledge of electrical circuits are necessary to identify the true results.

In this paper, we have presented an experiment based on simulation in Matlab to create electrical circuits, namely: RC, RL, and RLC. These experiments were equivalent to those conducted in a teaching laboratory setting. Through the simulation results, we can understand the behaviour or response of an electrical circuit. With the finality of exploring the validity of the obtained results, we compare our results with the results of a second-level baccalaureate textbook, physics and chemistry specialty. For this reason, in this article, it is found that the effectiveness and efficiency of using simulations in physical experiments, especially to study electrical circuits such as RC, RL, and RLC.