码迷,mamicode.com
首页 > 其他好文 > 详细

Modelica学习

时间:2016-06-08 12:06:39      阅读:184      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!