Previous section-----Next section

7.4.1 Stage and Time Switches

StageSwitch

The Mech StageSwitch function is used for loads in the same manner as it is used for constraints, with one important difference. Because loads are cumulative, StageSwitch can apply more than one of the switched loads at a time, or no loads at all.

The multistage mechanism load-switching function.

Unlike most built-in Mathematica switching functions, StageSwitch does evaluate its arguments immediately. This means that test functions such as SameQ cannot be used because SameQ evaluates to True or False immediately, without waiting for some future condition to change and make it True or False in the context of the mechanism model. StageSwitch will fail if any of the test expressions fail to return True or False at runtime.
Each of the loads supplied to the StageSwitch must be a Mech load object with the head SysLoad, or a nested list of load objects.

Example

This loads the Modeler2D package.

The following example shows how a StageSwitch might be used to model a force that is either a constant force in one direction or a function of T in another direction. Which force is applied is determined by the value of the user-defined symbol whichload.

Here is a valid StageSwitch load object.

TimeSwitch

The TimeSwitch function is also used to apply loads in much the same way it is used to apply constraints. The primary difference is that the load object TimeSwitch may have a leading time, before which no load is applied, and a trailing time, after which no load is applied.

The time-dependent, load switching function.

Each of the loads supplied to the TimeSwitch must be a Mech load object or a nested list of load objects.

Example

The following example shows how a TimeSwitch might be used to model a force applied to the slider that is to remain constraint in magnitude until the value of time reaches 2.0, at which time the force begins to increase linearly with time.

Here is a valid TimeSwitch load object.