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
  • » sat_2251
  • » Profile

Posts

Posts

Feb-05-17 15:10:22
Category: Programming

Thank you so much for quick reply.

Please let me know "Extra equation" sample , if it is possible...

Feb-05-17 14:32:24
Category: Programming

I descripted the model what I defined the connect() by myself as below.
This is very simple sample.
When I simulate this model,  I get some errors from OM simulator.
Where should I modify this model ?
----------------------------------------------------------
  model aaa
    Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 10);
    Modelica.Electrical.Analog.Basic.Ground ground1;
    Modelica.Electrical.Analog.Sources.SineVoltage sineVoltage1;

  equation
    //<connection definition 1>
    sineVoltage1.n.v =  ground1.p.v;
    sineVoltage1.p.v = resistor1.p.v;
    resistor1.n.v = ground1.p.v;
 
    resistor1.p.i + sineVoltage1.p.i = 0;
    resistor1.n.i + sineVoltage1.n.i + ground1.p.i = 0;
 
  end aaa;
----------------------------------------------------------
If I change the equations as below, I have no errors.
  equation
    //<connection definition 2>
   connect( sineVoltage1.p, resistor1.p );
   connect( resistor1.n, ground1.p );
   connect( sineVoltage1.n, ground1.p );
I think  <connection definition 1> and <connection definition 2> are same....
My understanding is wrong ?

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