Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
162 views
in Technique[技术] by (71.8m points)

Why the parameters can't be recognized between the models connected by the Controlbus component in Dymola/Modelica?

I'm making the interface package which can input the parameters of the models in the simulation loop. To connect between the interface package and the simulation model, I used the Controlbus from the Standard Modelica Library Ver. 3.2.2.

Checking model was Okay, but if i simulate the model, the error like the picture below popped up.

Error message

And here's the equation related to this model

Omega_e = Omega_d * N_t[N]; Alpha_d = der(Omega_d);

To solve the differential equation, i think the solver need a specific parameter of N_t. So i put the parameters from the interface model and sent the parameters using the Controlbus component in the Standard Modelica Library.

enter image description here

enter image description here

As in the picture above, i definitely put the parameters. (Specific values of the parameters are deleted because it's a confidential)

I can't find what is the problem of this error. Please help me guys.

Thank you very much.

question from:https://stackoverflow.com/questions/65949107/why-the-parameters-cant-be-recognized-between-the-models-connected-by-the-contr

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Based on the incomplete model it's a bit tricky to say what happened, but:

Sending parameters through the control-bus (or a connector in general) is a bit complicated and not that encouraged.

It should be possible by declaring the "computed parameter" as parameter Integer N(fixed=false); initial equation N=myBus.N;, and don't have it as parameter in the connector.

If you don't declare it as parameter Dymola will try (and fail) to differentiate it. If you declare it as parameter in the connector it will not be propagated (as connecting two parameters lead to an assertion).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...