首页 > 其他 > 详细

Modelica学习

时间:2016-06-08 12:05:46      阅读:248      评论:0      收藏:0      [点我收藏+]

Annotation Choices for Suggested Redeclarations and Modifications

Replaceable model

sample(start,interval)

edge(b) Is expanded into “(b and not pre(b))” for Boolean variable b. 

 

A parameter variable is constant during simulation. This prefix gives the library designer the possibility to
express that the physical equations in a library are only valid if some of the used components are constant during
simulation. The same also holds for discrete-time and constant variables. Additionally, the parameter prefix
allows a convenient graphical user interface in an experiment environment, to support quick changes of the most
important constants of a compiled model. In combination with an if-clause, a parameter prefix allows to remove
parts of a model before the symbolic processing of a model takes place in order to avoid variable causalities in
the model (similar to #ifdef in C). Class parameters can be sometimes used as an alternative. Example:
model Inertia
parameter Boolean state = true;
...
equation
J*a = t1 – t2;
if state then // code which is removed during symbolic
der(v) = a; // processing, if state=false
der(r) = v;
end if;
end Inertia;

Modelica学习

原文:http://www.cnblogs.com/jufu/p/5569328.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!