*SetForce() - asymmetric force pair with user subroutine for command sets

Sets the value for a translational, rotational, line of action, and single component rotational asymmetric force pair when a user-defined subroutine is used to model the force expression.

Syntax

*SetForce(force_name, , USER, expr_l, expr_r)

Arguments

force_name
The variable name of an existing force pair.
Type: Varname
USER
This argument indicates the user-written subroutine is used to model the force value.
expr_l
A solver expression that sets the arguments for the user-defined left force.
Type: string
expr_r
A solver expression that sets the arguments for the user-defined right force.
Type: string

Example

*BeginMDL(the_model, "Example model")
*Analysis(the_analysis, "The analysis", andef)
*DefineAnalysis(andef)
  *ActionReactionForcePair( frc_bmp, "Rebound bumper", 
                                     LOA, 
                                     b_bmp_contact, 
                                     b_bmp_attach, 
                                     p_contact,
                                     p_tip)
  *SetForce(frc_bmp,  ,  USER, `USER( { frc_bmp.l.id, %d },
                                    { frc_bmp.l.i.id, %d } ,
                                    { cr() },`
                                    { frc_bmp.l.j.id, %d }, 
                                    { frc_bmp.l.rm.id, %d }, -10)`,
                                    `USER( { frc_bmp.r.id, %d }, 
                                    { frc_bmp.r.i.id, %d } , 
                                    { cr() },`
                                   `{ frc_bmp.r.j.id, %d }, 
                                    { frc_bmp.r.rm.id, %d }, -10)`)
  *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(frc_bmp,  ,  USER, `USER( { frc_bmp.l.id, %d },
                                    { frc_bmp.l.i.id, %d } ,
                                    { cr() },`
                                    { frc_bmp.l.j.id, %d }, 
                                    { frc_bmp.l.rm.id, %d }, -10)`,
                                    `USER( { frc_bmp.r.id, %d }, 
                                    { frc_bmp.r.i.id, %d } , 
                                    { cr() },`
                                   `{ frc_bmp.r.j.id, %d }, 
                                    { frc_bmp.r.rm.id, %d }, -20)`)
  *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

The solver force entity type is dependent on the force type referred to by the *SetForce() statement.

The symmetry argument is empty when using a force with asymmetric line of action.

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.