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 in the simulation, an appropriate value is assigned to each command based on the law excitation formulas, and the configuration of the mechanism is recalculated.

See Also
Creating a Rule for Law Excitations
Creating a Velocity Law Excitation

From the action bar, click Law Excitation to write a formula for a law excitation. In the Formula Editor section of the dialog box, enter a value for the Angle Formula, or click to open the Knowledgeware Formula Editor.

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 formula already created 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, the simple linear relationship d=10+2t, where d is the distance, and t the time, must be written 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 be equal 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 0deg, but the current value of the controlled angle constraint is 5deg. There is an inconsistency between the current position of the constraint and the expression that controls it.

As a result, the dynamics simulation does not start and an error message is displayed.

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 Knowledge Basics User's Guide: Formulas.