# Mathematical models and simulation of electrical systems

Many important engineering problems may be solved and the behaviour of many electrical systems may be understood by using mathematical modeling. Thus the electrical systems may often be described, with sufficient accuracy for engineering purposes, by a set of ideal lumped elements which represent essential electrical phenomena.

• define and explain basic electrical parameters (page 1)
• explain basic passive elements of electrical systems (page 1)
• do mathematical modeling and simulation (with Scilab and Xcos) for a RL circuit (page 2)
• do mathematical modeling and simulation (with Scilab and Xcos) for a RC circuit (page 3)
• do mathematical modeling and simulation (with Scilab and Xcos) for a RLC circuit (page 4)
• do mathematical modeling and simulation (with Scilab and Xcos) for a RRCC circuit (page 5)
• do mathematical modeling and simulation (with Scilab and Xcos) for a RRLC circuit (page 6)

### Electrical voltage and current

The electrical voltage (or potential diﬀerence) uBA [V] between two points B and A, is deﬁned as the work which would be done (or the energy required) in carrying a unit positive charge from one point to the other. For the concept of voltage to be applicable, it is necessary that the work determined in this way be independent of the path along which the charge is moved. This requirement implies that the rate of change of the magnetic ﬁeld in the region of the path must be either zero or negligible.

This requirement ﬁts into the framework of the quasi-static ﬁeld theory which implies that the rate of change of magnetic ﬁeld normal to the region of the path on the subsystem energy boundary must be negligible. If it is necessary to do work on a positive charge (i.e., to apply a force in the direction of motion) as it moves from point A to point B, then point B is said to be at a higher potential than point A and the voltage uBA is considered positive.

Since it is often not known a priori which of two points will be at the higher potential or voltage, it is necessary to establish an algebraic reference convention for voltage. Usually, the assumed positive orientation of voltage is denoted by an empty-head arrow pointing in the direction of the from the point of a lower to the point of a higher potential.

Electrical current i [A] is deﬁned as the rate of ﬂow of charge across a given area, often the cross-sectional area of a wire. As the current may be changing with time, it is:

$i(t)=\frac{dq}{dt}$

where dq is the net charge of the particles crossing the entry, q+ and q are charges of the particles charged positively and negatively, respectively.

$dq = q_{+} – q_{-}$

The physical unit of electrical charge – coulomb [C] – is equal in magnitude but opposite in sign to the charge of 6.22·1018 electrons. Current has a direction as well as a magnitude. The direction convention commonly chosen is that direction in which a net ﬂow of positive charge has occurred. To establish in a reference for the direction of a current we will use full-head arrows indicating the direction of the assumed positive current.

### Electrical power and energy

The electrical power P [W] delivered to a two-terminal electrical element can be computed as the product between voltage and current.

$P = u_{BA} \cdot i$

In the MKS system of units, power is measured in watts. One watt is equal to one joule/sec or one N·m/sec.

The electrical energy E [J] supplied to an element is the time integral of the power:

$E = \int_{t_{a}}^{t_{b}}P d \tau$

where ta and tb are the beginning and end of the time interval during which power ﬂows. If energy is delivered to an electrical system through more than one pair of terminals, the total energy supplied is the sum of the energies supplied at all the terminals.The law of conservation of energy, or the ﬁrst law of thermodynamics, states that the energy (of all forms) which is delivered to a system must either be stored in the system or transferred out of the system.

### Basic electrical components

The basic passive elements of electrical systems are:

• resistor, with an equivalent resistance R (which dissipates energy)
• inductor, with an equivalent inductance L (which stores energy in a magnetic field)
• capacitor, with an equivalent capacitance C (which stores energy in an electric field)

Image: Passive elements of electrical systems

#### Resistor

All ordinary materials exhibit some resistance to the ﬂow of electric charge. Resistors are encountered in many shapes and forms, often designed to provide a needed resistance eﬀect in an electric system, but sometimes as an unwanted (parasitic) effect. A pure electrical resistor is deﬁned by a single-valued functional relationship between voltage diﬀerence across the resistor uR [V] and its current iR [A], such that u = 0 when i = 0, and the signs of u and i are the same.

An ideal electrical resistor is characterized by the linear relation, known as the Ohm’s law:

$u_{R}(t) = R \cdot i_{R}(t) \tag{1}$

where the constituency parameter R [Ω] is called resistance.

#### Capacitor

In a dielectric material an electric ﬁeld can be established without allowing a signiﬁcant ﬂow of charge through it. If two pieces of conducting material are separated by a dielectric material, an electric ﬁeld is established between the conductors when charge ﬂows into one conductor and out of the other. This electric ﬁeld results in a potential diﬀerence between the two conductors which depends on the amount of charge placed on the conductors. Physical devices which exhibit this type of relation between charge and voltage are said to have capacitance.

To permit this capacitive eﬀect to be separated from other electrical phenomena, we shall deﬁne a pure capacitor. The elemental equation for an ideal capacitor is:

$i_{C}(t) = C \cdot \frac{du_{C}}{dt} \tag{2}$

where C [F] is the capacitance of the element, having units of farads (1 F = A·s/V).

#### Inductor

When current ﬂows through a conductor, a magnetic ﬁeld is established in the space or the material around the conductor. If this current is changed as a function of time, the intensity of the magnetic ﬁeld will also vary with time. According to Lenz’s law, this changing ﬁeld will induce voltage diﬀerences in the conductor which will tend to oppose the changing current.

An inductor, also called a coil, choke, or reactor, is a passive two-terminal electrical component that stores energy in a magnetic field when electric current flows through it. The elemental equation for an ideal inductor is:

$u_{L}(t) = L \cdot \frac{di_{L}}{dt} \tag{3}$

where L [H] is the inductance, measured in henries (1 H = 1 V·s/A).

With these definition in mind and Kirchhoff’s Current and Voltage Law (KCL and KVL), we can now extract the mathematical model of given circuits and perform numerical simulations.

Before going through the examples, you might want to recall: