Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page
Ask Your Question
0

Modelica: Over-determined system does not make sense

asked 2019-06-18 13:12:43 -0500

first1 gravatar image

updated 2019-06-21 12:54:27 -0500

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).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-06-19 11:28:07 -0500

updated 2019-06-23 15:11:04 -0500

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.

edit flag offensive delete link more

Comments

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

first1 gravatar image first1  ( 2019-06-19 12:01:22 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2019-06-18 13:12:43 -0500

Seen: 296 times

Last updated: Jun 23 '19