Print Contact Force to .csv File

Chayan
Chayan
Altair Employee
edited April 2022 in Altair Exchange

Overview

This script uses a MotionSolve "Sensor_Evaluate" statement to write to a .csv file the time, x, y, z, and magnitude components of a contact force whenever the force is active at every solver time step.

Note: This is probably not a good script for sliding contact because it will create very large .csv files when the time step is small.

Usage/Installation Instructions

1) Create a sensor in MotionView

2) Check the box next to "Evaluate Expression" in the "Response" tab of the Sensor panel

3) Set the type of expression to "USER"

4) In the USER() field between the parenthesis send the function the id of the contact, the jflag of the contact, and the reference marker ID -- See "contact function for more details.

5) Go to the "Respons Dll" panel.

6) Check "Use local file and function name"

7) Find the python scrip in you directory

8) Set the function name to "write_cnct_fnc"

9) Set the "function type" to Python.

 

Functionality: API, Multi-Body Dynamics

Subfunctionality: XML format 

Interface: XML format