Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » lb23
  • » Profile

Posts

Posts

Hello, I am new to both Modelica and OpenModelica. I am attempting to produce an error by using a unphysical equation, however when I run it it simulates fine and produces a result. The code I am using is shown below, adapted from Modelica by Example:

model RLC
  parameter Modelica.SIunits.Voltage Vb = 24 "Battery voltage";
  parameter Modelica.SIunits.Inductance L = 1;
  parameter Modelica.SIunits.Resistance R = 100;
  parameter Modelica.SIunits.Capacitance C = 0.001;
  Modelica.SIunits.Voltage V;
  Modelica.SIunits.Current i_L;
  Modelica.SIunits.Current i_R;
  Modelica.SIunits.Current i_C;
equation
  i_R = V * R;
  i_C = C * der(V);
  i_L = i_R + i_C;
  L * der(i_L) = Vb - V;
end RLC;

I have intentionally entered i_R = V * R rather than i_R = V / R, and no errors are produced. I am running OpenModelica 1.9.1+dev (r17983) (Bootstrapping version).
Thanks in advance.


  • Index
  • » Users
  • » lb23
  • » Profile
You are here: