About Writing Formulas for Law Excitations

You can write formulas to define law excitations. The formula associates distance or angle values to a time parameter used to drive the simulation. For each time step of the simulation, the app assigns a value to each command based on the law excitation formulas, and recalculates the configuration of the mechanism.

See Also
Creating Rules for Law Excitations
Creating Velocity Law Excitations

You can specify a value for an angle formula, or use the Knowledgeware Formula Editor to write law excitation formulas.

Note: You can also create a knowledge law to write a law excitation. For more information, see Creating and Using a Law.
Note: Every existing formula is available in the Members of all column.
For every new formula, make sure that:
  • The formula includes a time parameter.
  • The coefficients and variables units cancel each other out to correspond to the distance or angle unit.

For example, for the following simple linear relationship d=10+2t, where d is the distance, and t the time, write the formula as follows: 'LawExcitation.1\Length'=10m+'LawExcitation.1\Time'*2m_s

At the beginning of the simulation (time = 0), the evaluation of the excitation must correspond to the current value of the controlled constraint. For example, for a law excitation command to control an angle with a current value of 5 degrees, the formula must be Angle = time*10deg/s.

In this example, the evaluation of the formula at the beginning of the simulation (time = 0) is 0 deg, but the current value of the controlled angle constraint is 5 deg. There is an inconsistency between the current position of the constraint and the expression that controls it.

In that case, the dynamics simulation does not start, and the app displays an error message.

To avoid that, make sure that the expression is consistent with the position of the constraint at the beginning of the simulation. For example, you can change the formula to Angle = 5deg + time*10deg/s.

For more information about the Formula Editor, see Formulas.