export_time_variables¶
- export_time_variables(rotating_object: RotatingObject, file_path: str, time_array: list[Time], time_unit: str | None = 'sec', angular_position_unit: str | None = 'rad', angular_speed_unit: str | None = 'rad/s', angular_acceleration_unit: str | None = 'rad/s^2', torque_unit: str | None = 'Nm', driving_torque_unit: str | None = 'Nm', load_torque_unit: str | None = 'Nm', force_unit: str | None = 'N', stress_unit: str | None = 'MPa', current_unit: str | None = 'A') None¶
It xports the computed time variables of a rotating object to a file.
The exported file is a
.csvfile. The time variables are exported in a tabular form, in which each column is a time variable and each row is a simulated time step. The columns are separated by a comma. The first column reports the simulated time steps and the first row reports the column names.Parameters¶
rotating_objectRotatingObjectThe rotating object whose time variables are to be exported.
file_pathstrPath to the file in which to save the time variables. It must be a non-empty
str.time_arraylistSimulated time steps. It must be a non-empty
list.time_unitstr, optionalSymbol of the unit of measurement to which convert the time values in the exported file. It must be a
str. Default is'sec'. SeeTime.unitfor more details.angular_position_unitstr, optionalSymbol of the unit of measurement to which convert the angular position values in the exported file. It must be a
str. Default is'rad'. SeeAngularPosition.unitfor more details.angular_speed_unitstr, optionalSymbol of the unit of measurement to which convert the angular speed values in the exported file. It must be a
str. Default is'rad/s'. SeeAngularSpeed.unitfor more details.angular_acceleration_unitstr, optionalSymbol of the unit of measurement to which convert the angular acceleration values in the exported file. It must be a
str. Default is'rad/s^2'. SeeAngularAcceleration.unitfor more details.torque_unitstr, optionalSymbol of the unit of measurement to which convert the torque values in the exported file. It must be a
str. Default is'Nm'. SeeTorque.unitfor more details.driving_torque_unitstr, optionalSymbol of the unit of measurement to which convert the torque values in the exported file. It must be a
str. Default is'Nm'. SeeTorque.unitfor more details.load_torque_unitstr, optionalSymbol of the unit of measurement to which convert the torque values in the exported file. It must be a
str. Default is'Nm'. SeeTorque.unitfor more details.force_unitstr, optionalSymbol of the unit of measurement to which convert the force values in the exported file. It must be a
str. Default is'N'. SeeForce.unitfor more details.stress_unitstr, optionalSymbol of the unit of measurement to which convert the stress values in the exported file. It must be a
str. Default is'MPa'. SeeStress.unitfor more details.current_unitstr, optionalSymbol of the unit of measurement to which convert the electric current values in the exported file. It must be a
str. Default is'A'. SeeCurrent.unitfor more details.
Raises
TypeErrorIf
rotating_objectis not an instance ofRotatingObject,if
file_pathis not astr,if
time_arrayis not alist,if an element of
time_arrayis not an instance ofTimeor astr,if
time_unitis not astr,if
angular_position_unitis not astr,if
angular_speed_unitis not astr,if
angular_acceleration_unitis not astr,if
torque_unitis not astr,if
driving_torque_unitis not astr,if
load_torque_unitis not astr,if
force_unitis not astr,if
stress_unitis not astr,if
current_unitis not astr.
ValueError