Electrical System modeling

We here consider the following electrical system, with an input voltage image001 and an output voltage image002

image004

Mathematical modeling

In order to model the system in a mathematical way, we need to use Kirchhoff’s laws:

(1) image005

 (2)  image006

In addition, we need to express the mathematical function of each component:

Resistanceimage007    

Capacityimage008

Inductorimage009

Using the 2 mathematical expressions, we come to the following second order differential
equation:

image010

Causal modeling

image011

State-space system modeling 

The equations for an RLC circuit are the following. They result from
Kirchhoff’s voltage law and Newton’s law.

image013

The R, L and C are the system’s resistance, inductance
and capacitor.

We define the capacitor voltage Vc and the inductance current iL as the state variables X1 and X2.

image015     

thus

image017

Rearranging these equations
we get:

image019

These equations can be put into
matrix form as follows,

image021

The required
output equation is

image023

The following
diagram shows these equations modeled in Xcos.

To obtain
the output Vc(t) we use CLSS block from Continuous time systems Palette.

 image025 

https://help.scilab.org/docs/5.5.2/en_US/CLSS.html

Acausal with Modelica

image027