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

Using the connector in Dymola

Using the connector in Dymola

I am currently trying to evaluate using Dymola to build the solar power plant model. I am following your book to learn Modelica. But at the start, I got a confusing question about using the connector in Modelica.  I am using Dymola 2020.

Here are the codes of a connector and a model that uses the connector:

Code:


connector Port
  flow Real Q;
  Real P;
  Real T;
end Port;

Code:


model Inlet
  parameter Real Q = 1;
  parameter Real P = 2;
  parameter Real T = 3;
  Port a;
equation
  a.Q = Q;
  a.P = P;
  a.T = T;
end Inlet;

I set 3 equations in the model, but there is an error showing there are 4 equations, I am not sure why there are 4 equations??

Code:


The problem is structurally singular.

It has 3 scalar unknowns and 4 scalar equations.
The Real part has 3 unknowns and 4 equations.
The Integer part has 0 unknowns and 0 equations.
The Boolean part has 0 unknowns and 0 equations.
The String part has 0 unknowns and 0 equations.

The number of scalar Real unknown elements are 3.
The number of scalar Real equation elements are 4.

Part of the problem for Real elements is overdetermined.
There are 1 scalar equations too many in the set:
a.T = T;
a.P = P;
a.Q = Q;

WARNINGS have been issued.

ERRORS have been issued.

https://imgchr.com/i/MlW4JO
https://imgchr.com/i/MlW5WD
https://imgchr.com/i/MlWhFK
https://imgchr.com/i/MlWWo6

There are 0 guests and 0 other users also viewing this topic
You are here: