5.8.3.3. Defining Joint Loads Dependent on one or more Measures

To define a joint load that depends on one or more measures:

  1. Click the Insert Measure Varying Joint Load icon  .

    The properties of this load can then be edited in the Details panel.

  2. Select the joint on which to apply the load in the Joint Selection field.

  3. Select the joint degree of freedom on which the load is applied in the Joint Dof field.

  4. Define the Output Type from the dropdown list.

    • Python User Table

      When you select Python User Table, a text editor will open, allowing you to define the evolution of the joint load with respect to the input variable defined in the Measure Selections field.

      The text editor will contain a pre-defined IronPython function.

      class UserTable_33(CS_UserTable):
         def __init__(self, sizeIn, sizeOut):
             CS_UserTable.__init__(self, sizeIn, sizeOut)
      
         def Evaluate(self, In, Out):
             ## define Out[] as a function of In[] here 
             Stiffness = 43.0 
             Damping = 0.1 
             Preload = 100.0
             Displacement = In[0]
             Velocity = In[1]
             Out[0] = -Stiffness*Displacement -Damping*Velocity + Preload
      
             return 0
      
      #define input size and output size here
      SizeIn=1
      SizeOut=1
      table_33 = UserTable_33(SizeIn,SizeOut)
      
      print "    *** CS_UserTable UserTable_33 created ***"
      

      Note:
      • The string _33 is given here as example. Actual value will vary.

      • The text editor that will be used is that associated with the .txt add-on in your user preferences.

      • This feature relies on the CS_UserTable class of the scripting manual.


      In general, you would only modify the Evaluate function. Its role is to compute Out[0]. The input measures come into this function in the In[] array. In the example above, the load has two input measures: one is the joint displacement and the other is the joint velocity, for a joint that has only one degree of freedom. The force is computed as if a preloaded spring and damper were acting together.

    • Table

      This option will allow you to define tabular data defining output as a function of input. This option requires that you have only one input variable. The table will have two columns, the first one corresponding to the input values and the second one corresponding to the output values.

    • Excel

      You can also use Excel to define tabular output, and the data will be read from an Excel comma separated value file (.csv). Click the field next to Excel to browse to your Excel file.

      The Excel table must have two columns, the first one corresponding to the input values and the second one corresponding to the output values.

      • By default, the first row of the table is assumed to contain labels that describe the columns.

        If this first row contains data (it is not a header), you should set the Skip Header option to No.

      • Values from the spreadsheet can be scaled by the Output Scale Factor. This can be useful, for example, if the .csv file hasn’t been created in the same unit system as the solution.

      • By default, the Comma Separated Values file format uses "," as a separator. However, depending on the language of your operating system, or of the machine that has generated the .csv file, Excel can use a different character to delimit the fields. You can specify this character using the Column Separator field.

  5. Define one or more Input Measures using the Measure Selection field.

    If Output Type is set to Table only one measure can be defined. If Output Type is Excel or Table, the Input Measure(s) must be scalar. Use a derived measure to extract one particular component of a multi-dimensional base measure.

    The measure Time is always available. While time-varying loads can be defined on all transient Mechanical loads, the use of IronPython can be very powerful for complex loads.


    Note:
    • You cannot specify a Force measure or a measure derived from a Force measure as an input used to compute loads.

    • You should not use accelerations as inputs because it could lead to very small time steps or lack of convergence. If the intent is to link the accelerations of two joints, it is more efficient to use a constraint equation that links the two accelerations.


  6. Joint loads can be applied conditionally, based on the value of any derived measure.

    • Use Selection to define the scalar measure that the condition is based on.

    • Select the Operator from the list.

    • Select the right-hand side of the condition in the Value field.

    You can, for example, define a "breakable" spring that will act only if the joint displacement is less than a maximum displacement.

  7. The load has a default name. This name can be overwritten using the Load Name field in order to increase the readability of the created script.

  8. Use the Debug option to print the value of the input values and calculated output values of the table. This option should be used only for short simulations as it will slow down the evaluation of the load.


Important:  The read-only property Unit System is shown for information, as the Measure Varying Joint Load object does not change if you change the unit system in the Mechanical Application. It is strongly recommended that you use one single unit system to define all the measure varying loads and to solve using this same unit system.