User Tools

Site Tools


bok:eng:mbse:sysml:para

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bok:eng:mbse:sysml:para [2020/07/28 04:28]
116.236.117.198
bok:eng:mbse:sysml:para [2020/08/01 02:25] (current)
anwlur [Customized Functions]
Line 9: Line 9:
   * cos - Cosine of radian   * cos - Cosine of radian
   * tan - Tangent of radian   * tan - Tangent of radian
 +  * min - Minimum, e.g. min(1,2,4) = 1
 +  * max - Maximum, e.g. max(1,2,4) = 4
  
 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: 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:
Line 23: Line 25:
 {{ :​bok:​eng:​mbse:​sysml:​parametric:​modeling3.png?​400 |}} {{ :​bok:​eng:​mbse:​sysml:​parametric:​modeling3.png?​400 |}}
 <WRAP center round tip 60%> <WRAP center round tip 60%>
-When you want to run the simulation Modelica is relatively harsh when it comes to parsing your model. Make sure to remove spaces and any special characters from your element names.+When you want to run the simulation Modelica is relatively harsh when it comes to parsing your model. Make sure to remove spaces and any special characters from your element names. ​Legal special characters include the underscore (_). Illegal special characters include the hyphen (-)
 </​WRAP>​ </​WRAP>​
  
Line 30: Line 32:
  
 <WRAP center round tip 60%> <WRAP center round tip 60%>
-Modelica will assign classes to your Constraint Blocks. If the usage of the block is not assigned a name Sparx EA assigns it '​unnamed element'​. Because Modelica doesn'​t like spaces within ​name it throws an error therefore you need to assign a name to each Constraint Block instance. Double click the part association relationship to open the Properties editor. In Source tab assign a name without spaces or special characters.+Modelica will assign classes to your Constraint Blocks. If the usage of the block is not assigned a name Sparx EA assigns it '​unnamed element'​. Because Modelica doesn'​t like spaces within ​names it throws an error therefore you need to assign a name to each Constraint Block instance. Double click the part association relationship to open the Properties editor. In Source tab assign a name without spaces or special characters.
 </​WRAP>​ </​WRAP>​
  
Line 50: Line 52:
  
 The below is largely based on Creating a Parametric Model: Simulation Functions by Sparx Enterprise Architect which can be found [[https://​www.sparxsystems.com/​enterprise_architect_user_guide/​15.1/​model_simulation/​create_paramet_model.html|here]]. The below is largely based on Creating a Parametric Model: Simulation Functions by Sparx Enterprise Architect which can be found [[https://​www.sparxsystems.com/​enterprise_architect_user_guide/​15.1/​model_simulation/​create_paramet_model.html|here]].
-  * Unfortunately SysML or Sparx EA doesn'​t have any mathematical functions, like '​min()'​ to return minimum value of a set, out of the box. That's where you come in.+  * Modelica supports a limited number of mathematical functions, like '​min()'​ to return minimum value of a set, out of the box. If you want to create a function, say range() then that's where you come in. Note the below created function is obsolete as min() already exists (at the time of writing this function I didn't know that...)
   * Insert a Constraint Block, call it '​Minimum'​ (it doesn'​t have to be the same name of your function).   * Insert a Constraint Block, call it '​Minimum'​ (it doesn'​t have to be the same name of your function).
   * Add an Operation (right click -> Features -> Operations...). Click 'New Operation...'​   * Add an Operation (right click -> Features -> Operations...). Click 'New Operation...'​
   * Give it the same name as your intended function (here I've given it '​min'​).   * Give it the same name as your intended function (here I've given it '​min'​).
   * In Parameters give each parameter a name, type and direction.   * In Parameters give each parameter a name, type and direction.
 +{{ :​bok:​eng:​mbse:​sysml:​parametric:​modeling4.png?​400 |}}
 <WRAP center round tip 60%> <WRAP center round tip 60%>
 Need at least one input and one output. Need at least one input and one output.
Line 86: Line 89:
  
   * 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)   * 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)
 +  * Likewise if you are getting 'Too many equations, over-determined system'​ you have unwittingly binded the replicated parameters to form more equations then you actually need.
 +  * As of the time of writing parameters are replicated if you removed a property from the parametric diagram and reintroduced the same property
   * 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   * 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   * Always use Binding Connector to connect parameters
   * Models, parameters, constraints and blocks name can not have any special characters, including space   * Models, parameters, constraints and blocks name can not have any special characters, including space
  
bok/eng/mbse/sysml/para.1595910523.txt.gz · Last modified: 2020/07/28 04:28 by 116.236.117.198