0

Modelica: Over-determined system does not make sense

I had a model running successfully until I tried to implement proportional control. The only changes I made were as follows:

Added below model, above equations:

parameter SI.MassFlowRate desiredFlow = 2;

parameter SI.MassFlowRate errorInFlow;

parameter Real kp = 0.1;

Added under equations:

errorInFlow = desiredFlow - sink.ports[1].m_flow;

valveLinear1.opening = errorInFlow * kp;

Deleted under equations

valveLinear1.opening = 0.5;

...So altogether I have 4 variables (valveLinear1.opening, errorInFlow, desiredFlow, kp). I define kp and desiredFlow (2 equations) plus the other 2 under equations = 4. I don't see why I am still getting this error of an over-constrained system (one to many equations).

first1's avatar
71
first1
asked 2019-06-18 13:12:43 -0500
shorowit's avatar
11.8k
shorowit
updated 2019-06-21 12:54:27 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

I think you are confusing "variables" and "parameters" here. I suggest to check any Modelica book which explains the difference between those two types of "variables". I will recommend to check the book of Michael Tiller as well https://mbe.modelica.university/behav....

In short a parameter is a "variable" which is supposed to be known a prio-ri. It is similar to a constant and can't be changed in an equation section. This is the reason why the compiler is saying that your system is overdetermined.

You should remove the parameter attribute in front of parameter SI.MassFlowRate errorInFlow

to turn errorInFlow into a variable and make your system work.

Thierry Nouidui's avatar
1.5k
Thierry Nouidui
answered 2019-06-19 11:28:07 -0500
Michael Wetter's avatar
1.7k
Michael Wetter
updated 2019-06-23 15:11:04 -0500
edit flag offensive 0 remove flag delete link

Comments

Thierry I deleted parameter in front of errorInFlow and it worked perfectly. Thank you!

first1's avatar first1 (2019-06-19 12:01:22 -0500) edit
add a comment see more comments