Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.4K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

Number of equations is more than expected in SystemModeler

Posted 4 years ago
Attachments:
POSTED BY: Roger Backhus
2 Replies

The extra variables come from the declaration extends Modelica.Electrical.Analog.Interfaces.TwoPort;.

The TwoPort model adds four pins but also the corresponding voltages and variables (v1, i1, v2, i2). In your case, you are defining the behavior using components, so you don't need the extra variables and equations that TwoPort provides.

Just replace the extends by a declaration of four independent pins.

Modelica.Electrical.Analog.Interfaces.Pin p1;
Modelica.Electrical.Analog.Interfaces.Pin p2;
Modelica.Electrical.Analog.Interfaces.NegativePin n1;
Modelica.Electrical.Analog.Interfaces.NegativePin n2;

If you want to have an icon and the pins located in the correct position, you can create your own component based on TwoPort and remove the variables that are not needed. For example (notice that I removed the annotations to make it more readable here):

partial model FourPin
  Modelica.Electrical.Analog.Interfaces.PositivePin p1;
  Modelica.Electrical.Analog.Interfaces.NegativePin n1;
  Modelica.Electrical.Analog.Interfaces.PositivePin p2;
  Modelica.Electrical.Analog.Interfaces.NegativePin n2;
end FourPin;
Posted 4 years ago

Oh. Ok. Thank you very much! That saved a lot of time!

Roger

POSTED BY: Roger Backhus
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard