Modelica: model in a model and Instantiation

247 views Asked by At

Is there any difference between instantiating model where other models are inside that same model

model A    
model B
end B;
model C
end C;
B b;
C c;
end A;

and instantiating models which are not in the same model

model A
B b;
C c;
end A;

model B
end B;

model C
end C;
1

There are 1 answers

0
Michael Tiller On

Generally no. In fact, nesting model definitions inside other models is generally frowned upon and there are some restrictions in the lookup rules regarding this (I think you need to make the inner models encapsulated or something). So the second approach you show is really the preferred approach. Even better if they are organized inside a package hierarchy.