*SetForce() - single component rotation for command sets

Sets the value for a single component rotational action-reaction force.

Syntax

*SetForce(force_name, expr)

Arguments

force_name
The variable name of an existing action-reaction force of type SC_ROT.
Type: Varname
expr
A number, MDL expression, or solver expression that determines the value of the force.
Type: real or string

Example

*BeginMDL(the_model, "Example model")
*Analysis(the_analysis, "The analysis", andef)
*DefineAnalysis(andef)
  *ActionReactionForce(f1,  "Rebound force", SC_ROT,
               b_frame, b_lca.l, p_reb_frame.l,
  *SetForce(f1, 20.0)
  *SetForce(f2, ds.real1.value + ds.real2.value)
  *SetForce(f3, ‘200.0*DM({f3.i.id, %d}, {f3.j.id, %d})‘)
  *CommandSet(the_commandset, "Simple command set", evdef, frc_0, tpl_begin, tpl_end)
  *Template(tpl_begin, "Begin template", USER, tpldef_commandset_begin)
  *Template(tpl_end, "End template", USER, tpldef_commandset_end)
  *Template(tpl_superfluous, "Should be ignored", ACF, tpldef_commandset_begin)
*EndDefine()
*DefineCommandSet(evdef, local_frc_0, local_tpl_begin, local_tpl_end)
  *Write(local_tpl_begin)
  *SetForce(f1, 30.0)
  *SetForce(f2, ds.real1.value + ds.real2.value)
  *SetForce(f3, ‘100.0*DM({f3.i.id, %d}, {f3.j.id, %d})‘)
  *Write(local_tpl_end)
*EndDefine()
*DefineTemplate(tpldef_commandset_begin)
{AbsToRelative(Solver_File_basename.path, Solver_File_basename.value + 
               ".adm")}
PREFERENCES/SIMFAIL=STOPCF
*EndDefine()
*DefineTemplate(tpldef_commandset_end)
STOP
*EndDefine()
*EndMDL()

Context

*BeginMdl()

*DefineAnalysis()

*DefineSystem()

Comments

Templex syntax is used in solver expressions. All variables are enclosed in braces {} and the rest of the expression is treated as literal. Solver expressions are enclosed in back quotes. Curve data can be used to define a force by specifying an existing curve, interpolation method, and an independent variable, for example,
crv_name.interp(CUBIC, `{DM}`) 

where crv_name is the variable name of an existing curve.