User Tools

Site Tools


bok:eng:mbse:sysml:para

This is an old revision of the document!


Parametric Modeling and Simulations with Modelica

Keywords

Constraints have certain reserved keywords. They are

  • diff - ? e.g. diff(x)
  • der - Derivative, e.g. der(x)
  • minimum - minimum(1,2,3,4) = 1
  • maximum - maximum(1,2,3,4) = 4
  • sum - sum(1,2) = 3

Common Built-in Variables can be modified in the 'Edit Constraint Block'. Click the 'Edit Built-in Variable' button. If you have more than one then separate them with a ','. Recommend to add: time

Organizing Parametric Modeling

  1. Create a package labelled 'model of x'
  2. Create a block diagram for this package
  3. Inside BDD insert <block> labelled 'modeling_x'. It can not contain any special characters including a space
  4. Add relevant Constraint Blocks. Add aggregation relationships between constraint blocks (source) to the Modeling X block (target).
  5. Add equations to your Constrain Blocks. If you will use an equation more than once add another aggregation relationship between the Constrain Block and the Modeling X block. In such case be sure to assign a name to the source of each relationship to avoid confusion later
  6. You can't just have equations, you need inputs and outputs. Add to the BDD relevant Blocks that holds these inputs and outputs. Add a reference link between these blocks and the Modeling X block
  7. NOTE if you are linking blocks that reside in a different namespace then you will need to add a Package Import relationship between the Model of X package to the package that contains your blocks

Troubleshooting

  • If you are getting a 'parameter x of constrain y does not have an input or output relationship' when it appears to be then check the model tree. It has been known that parameters are replicated (so it looks like you have 2 parameter x where only one should be)
  • Are your blocks in a different namespace to the package that contains your simulation artifact? If so then add a package import relationship to the namespace that contains these blocks
  • Always use Binding Connector to connect parameters
  • Models, parameters, constraints and blocks name can not have any special characters, including space
bok/eng/mbse/sysml/para.1595739117.txt.gz · Last modified: 2020/07/26 04:51 by anwlur