- #1
Lotos
- 2
- 1
- Homework Statement
- Convert one RLC graph to another using equations
- Relevant Equations
- dIL/dt=(Uin-R*IL-Uc)/L;
dUc/dt=IL-Iout/C
Good day.
I am studying Open Modelica and building RLC.
I was given the following task:
From the initial network
make one (sample graphics on Scilab but needs in Open Modelica)
As you can see in the graph that is presented in scilab, the graphs start from different points.
Here is a list of equations that I implement in the Open Model for the 1st figure(Working,the main example in Modelica)
And these are attempts to implement for my assignment(not working and buildin)
I know, that is this equations errors(a lot of variables, but not enought equations) and wrong scheme for solving equations.
What and how do I need to fix my equations?
I am studying Open Modelica and building RLC.
I was given the following task:
From the initial network
make one (sample graphics on Scilab but needs in Open Modelica)
As you can see in the graph that is presented in scilab, the graphs start from different points.
Here is a list of equations that I implement in the Open Model for the 1st figure(Working,the main example in Modelica)
Code:
model Lab5
extends Modelica.Icons.Example;
type Voltage=Real(unit="V");
type Current=Real(unit="A");
type Resistance=Real(unit="Ohm");
type Capacitance=Real(unit="F");
type Inductance =Real(unit="H");
parameter Modelica.SIunits.Resistance R=100 "Resistance";
parameter Modelica.SIunits.Inductance L=1 "Inductance";
parameter Modelica.SIunits.Voltage Vb=24 "Total DC Voltage";
parameter Modelica.SIunits.Capacitance C=1e-3 "Capacitance";
Voltage V;
Current i_L;
Current i_R;
Current i_C;
equation
V = i_R * R;
C * der(V) = i_C;
L * der(i_L) = Vb - V;
i_L = i_R + i_C;
Code:
extends Modelica.Icons.Example;
type Voltage=Real(unit="V");
type Current=Real(unit="A");
type Resistance=Real(unit="Ohm");
type Capacitance=Real(unit="F");
type Inductance =Real(unit="H");
parameter Modelica.SIunits.Resistance R=100 "Resistance";
parameter Modelica.SIunits.Inductance L=1 "Inductance";
parameter Modelica.SIunits.Voltage Vb=24 "Total DC Voltage";
parameter Modelica.SIunits.Capacitance C=1e-3 "Capacitance";
Current u_Vx;
Current u_L;
Current u_R;
Current u_C;
Current i_Vx;
Current i_L;
Current i_R;
Current i_C;
equation
i_L=i_C+i_Vx;
i_R=i_L;
u_L=u_R+u_C;
u_Vx=u_L;
C*der(u_C)=i_C;
L*der(i_L)=u_L;
der(i_L)=(u_Vx-R*i_L-u_C)/L;
der(u_C)=(i_L-i_Vx)/C;
I know, that is this equations errors(a lot of variables, but not enought equations) and wrong scheme for solving equations.
What and how do I need to fix my equations?