conditional component declaration and a following if equation
问题 I am trying to build a model that will have slightly different equations based on whether or not certain components exist (in my case, fluid ports). A code like the following will not work: parameter Boolean use_component=false; Component component if use_component; equation if use_component then component.x = 0; end if; How can I work around this? 回答1: If you want to use condition components, there are some restrictions you need to be aware of. Section 4.4.5 of the Modelica 3.3 specification