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.
In this article/tutorial we are going to:
- 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 difference) uBA [V] between two points B and A, is defined 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 field in the region of the path must be either zero or negligible.
This requirement fits into the framework of the quasi-static field theory which implies that the rate of change of magnetic field 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 defined as the rate of flow 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 flow 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 flows. 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 first 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)
Resistor
All ordinary materials exhibit some resistance to the flow of electric charge. Resistors are encountered in many shapes and forms, often designed to provide a needed resistance effect in an electric system, but sometimes as an unwanted (parasitic) effect. A pure electrical resistor is defined by a single-valued functional relationship between voltage difference 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 field can be established without allowing a significant flow of charge through it. If two pieces of conducting material are separated by a dielectric material, an electric field is established between the conductors when charge flows into one conductor and out of the other. This electric field results in a potential difference 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 effect to be separated from other electrical phenomena, we shall define 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 flows through a conductor, a magnetic field 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 field will also vary with time. According to Lenz’s law, this changing field will induce voltage differences 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:
GUEYE
Bonjour,
Dans le cadre de mon stage chez ASSYSTEM, je travaille avec votre logiciel Scilab/Xcos. Cependant, je rencontre quelques difficultés avec le compilateur C Mingw et le module SIMM qui ne fonctionnent pas du tout. Cela m’empêche de progresser dans mes travaux.
Je sollicite votre aide pour résoudre ce problème.
Merci d’avance.
Bien cordialement,
Hoang
Bonjour,
Je ne sais pas si votre travail à present a été fini et si vos difficultés ont été bien résolues. J’ai vu par hasard votre message sur cette page web et je vous ai écrit quand même. Au début, j’ai rencontré aussi des problèmes concernant le compilateur C et le module MinGW (Scilab n’a pas détecté le compilateur C et le module MinGW malgré qu’ils ont bien été installé sur mon ordinateur). Ma simulation dans Xcos n’a pas marché.
J’ai trouvé il y a quelques jour la page web https://atoms.scilab.org/toolboxes/mingw/10.3.0 et J’ai suivi ses instructions. Maintenant, ca marche très bien, aucun problème pour moi dans l’exécution des simulations avec Xcos.
J’espère qu’elle puisse aussi vous aider à surmonter vos difficultés.
Bonne chance,
Priyadarshan
Hi Team,
I was going through the “RRCC circuit modelling and simulation in Scilab/Xcos” and I came across an equation (eq. 8).
Can you explain me the substitution made in that equation as the line says “Replacing (6) in (4) and the result in (2)”, but such a substitution was not made and that the equation (8) differs from the mentioned equation relations as eq. (6) and (4) were considered.
Can you explain me on that part if my understanding was wrong.
Thanks and Regards
Priyadarshan
Priyadarshan
Hi team,
I was going through the RRCC circuit modelling and simulation in Scilab/Xcos post.
Can you clarify me on the equation (8) as I was not able to understand the substitution that was made using equation (6) and (4).
The line says “Replacing (6) in (4) and the result in (2)”, but such a replacement did not seem to be a possible one as far as I have understood.
Looking forward to hear from you to clarify my doubt on this matter.
Thanks and Regards
Priyadarshan