Open Modelica, work with an RLC-circuit

In summary, the student is trying to solve equations for a model with Open Modelica, but is having trouble. He has errors in his equations and in his code. He needs to fix both of these in order to finish the project.
  • #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
120453-b86d623096e67e1cf90e3aae372c1b0e.png


make one (sample graphics on Scilab but needs in Open Modelica)
120455-c21360bb619a636c1c586e4178e5bf08.jpg


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;
And these are attempts to implement for my assignment(not working and buildin)

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?
 
Physics news on Phys.org
  • #2
Modified the code a little to match the calculations and variables.

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";
  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 = 5;
  u_C =3;
  i_R=i_L+i_Vx+i_C;
  u_Vx=u_L+u_R+u_C;
 
  C*der(u_C)=u_C; 
  L*der(i_L)=i_L; 
  der(i_L)=(u_Vx-R*i_L-u_C)/L;
  der(u_C)=(i_L-i_Vx)/C;  annotation(
    uses(Modelica(version = "3.2.3")));
end Lab5;

But the following errors appeared

Code:
Internal error IndexReduction.pantelidesIndexReduction failed! Found empty set of continuous equations. Use -d=bltdump to get more information.
Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!
 

1. What is Open Modelica?

Open Modelica is an open-source modeling and simulation environment for complex physical systems. It allows users to create, simulate, and analyze models of various systems, including electrical circuits, mechanical systems, and more.

2. How does Open Modelica work?

Open Modelica uses a graphical interface to build models using drag-and-drop components and connect them together to form a system. It also has a powerful scripting language for more advanced modeling and simulation tasks. The models can then be simulated and analyzed using various algorithms and solvers.

3. What is an RLC-circuit?

An RLC-circuit is an electrical circuit that contains a resistor (R), an inductor (L), and a capacitor (C). These three components are connected in series or parallel and form a closed loop. RLC-circuits are commonly used in electronics and telecommunications for filtering and signal processing.

4. How can I work with an RLC-circuit in Open Modelica?

To work with an RLC-circuit in Open Modelica, you can use the built-in components for resistors, inductors, and capacitors. You can also create custom components or import models from external libraries. Then, you can use the simulation tools in Open Modelica to analyze the behavior of the circuit under different conditions.

5. What are the benefits of using Open Modelica for RLC-circuit modeling?

Open Modelica offers a user-friendly interface for building and simulating complex RLC-circuit models. It also provides a wide range of solvers and algorithms for accurate and efficient simulations. Additionally, being an open-source software, it is constantly updated and improved by a community of users and developers, making it a reliable and versatile tool for RLC-circuit modeling.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
28
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
736
  • Engineering and Comp Sci Homework Help
Replies
2
Views
973
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
Replies
44
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
17
Views
5K
Back
Top