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

Posts

Posts

Dec-10-13 12:06:12
Instantiation creates new equations when using connector in OMEdit

I could make it work. Thank you
It was a bad understanding of connectors. You can't have connection inside a model. The working model below:


Code:

model Motor_simple

  Rotor1 Rot;
  Stator1 Stat;
  Friction1 F1;
  Friction1 F2;
  Speed w;
  Angle theta;
initial equation
  der(w) = 0;
  //steadystate
equation
  Rot.c.theta - Stat.c.theta = theta;
  w = der(theta);
  connect(Rot.c,F1.c);
  connect(Stat.c,F2.c);
end Motor_simple;

Dec-06-13 17:09:05
Instantiation creates new equations when using connector in OMEdit

I did others model and I have always the same issue using connector type Flange, flattening of the model add an equation  xxx.tau=0.0 even if I try to impose another equation.
I am stuck on this problem and I would really appreciate some help

Dec-04-13 17:28:00
Instantiation creates new equations when using connector in OMEdit

Hi,

Can somebody of the community help me with an issue I have with a simple motor model.
When I instantiate the model with OMEdit, it forces torque equation to zero. This issue rise only when I use connectors.
Many thanks.
David

Rotor.tau = 0.0;//?
Stator.tau = 0.0;//?

The resulting failure is that I end with too much equations. Below is the full model and the instantiated model.

Model as written:

 Spoiler Show Spoiler Hide Spoiler
 model Motor_simple
  Flange Rotor;
  Flange Stator;
  Flange Friction1;
  Flange Friction2;
  //Torque tau;
  Speed w;
  Angle theta;
  Current i;
  //parameter Real Mf = 0;
  parameter Real V = 10;
  parameter Real K = 0.014;
  parameter Real J = 0.0000001;
  parameter Real R = 10;
initial equation
  der(w) = 0;
  //steadystate
equation
  Rotor.theta - Stator.theta = theta;
  w = der(theta);
  K * i + J * der(w) = Rotor.tau;
  V = R * i + K * w;
  Friction1.tau = 0;
  Friction2.tau = 0;
  connect(Rotor,Friction1);
  connect(Stator,Friction2);
  Stator.theta = 0;
end Motor_simple;
Instantiated model:

 Spoiler Show Spoiler Hide Spoiler
 class mypackage.Motor_simple
  Real Rotor.theta(unit = "rad");
  Real Rotor.tau(unit = "Nm");
  Real Stator.theta(unit = "rad");
  Real Stator.tau(unit = "Nm");
  Real Friction1.theta(unit = "rad");
  Real Friction1.tau(unit = "Nm");
  Real Friction2.theta(unit = "rad");
  Real Friction2.tau(unit = "Nm");
  Real w(unit = "rad/s");
  Real theta(unit = "rad");
  Real i(unit = "A");
  parameter Real V = 10.0;
  parameter Real K = 0.014;
  parameter Real J = 0.0000001;
  parameter Real R = 10.0;
initial equation
  der(w) = 0.0; //steady state
equation
  Rotor.theta - Stator.theta = theta;
  w = der(theta);
  K * i + J * der(w) = Rotor.tau;
  V = R * i + K * w;
  Friction1.tau = 0.0;//?
  Friction2.tau = 0.0;//?
  Stator.theta = 0.0;
  Rotor.tau = 0.0;//?
  Stator.tau = 0.0;//?
  Friction1.tau = 0.0;
  Friction2.tau = 0.0;
  (-Rotor.tau) + (-Friction1.tau) = 0.0;
  Friction1.theta = Rotor.theta;
  (-Stator.tau) + (-Friction2.tau) = 0.0;
  Friction2.theta = Stator.theta;
end mypackage.Motor_simple;

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