User Spline Subroutine
The USER_SPLINE_READ subroutine supports CSV, RPC/RSP, and DAC files. It is implemented as
a SPLINE_READ user-subroutine and is used to create a Reference_Spline element in the
XML/Python solver deck. The subroutine performs two main steps:
- Parse the data from the input file.
- Utilizes the PUT_SPLINE utility subroutine to correctly configure the spline in MotionSolve.
Input
The inputs for the subroutine are file_name and block_name.
- The file_name specifies the path to the data file (CSV, RPC/RSP, or DAC).
- The block_name references the header(s) of the spline.
Note: Headers can be accessed by opening the data files in HyperGraph or similar software.
Functionality
Once the spline is created, it can be used with any supported interpolation function, such as AKISPL, LINSPL, and so on.
Spline Types
Splines, or Reference_Spline elements, can be instantiated as 2D or 3D entities.
- 2D Splines
-
- The required channels must be specified in the block_name to correctly instantiate the spline element.
- An optional prefix, 2D::, can be included in the block name, followed by the headers of the independent and dependent variables (for example, 2D::Time,Fy). If the prefix is not included, it is assumed to indicate a 2D spline.
- If the independent variable is omitted and only one header is provided (for example, Fy), the independent variable defaults to the first channel of the data file (the first column in the CSV).
- The values of the independent variable must be monotonically increasing. If not, the spline ignores the remaining values, and a warning is printed in the solver log file.
- For DAC files, the block_name attribute is not used as a single channel is always utilized for spline creation.
- 3D Splines
-
- Only CSV files are supported for 3D splines, and a single CSV file can contain only one 3D curve data.
- The 3D spline CSV file follows the same convention as MotionView (MV):
- The first column corresponds to the x-independent variable.
- The first row corresponds to the z-independent variable.
- The remaining values represent the mapped y-dependent variable.
- The block_name for a 3D spline must always be 3D.
Example
<Reference_Spline
id = "301001"
label = "CSV Curve - Forces"
full_label = "Model-CSV Curve - Forces"
usrsub_dll_name = "msautoutils"
usrsub_fnc_name = "USER_SPLINE_READ"
file_name = "FL_forces.csv"
block_name = "Fx"
linear_extrap = "FALSE"
/>
<Reference_Spline
id = "301012"
label = "Spline3D CSV - user"
full_label = "Model-Spline3D CSV - user"
usrsub_dll_name = "msautoutils"
usrsub_fnc_name = "USER_SPLINE_READ"
file_name = "FTheta 1.csv"
block_name = "3D"
linear_extrap = "FALSE"
/>