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 .csv file. 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_objectRotatingObject

The rotating object whose time variables are to be exported.

file_pathstr

Path to the file in which to save the time variables. It must be a non-empty str.

time_arraylist

Simulated time steps. It must be a non-empty list.

time_unitstr, optional

Symbol of the unit of measurement to which convert the time values in the exported file. It must be a str. Default is 'sec'. See Time.unit for more details.

angular_position_unitstr, optional

Symbol of the unit of measurement to which convert the angular position values in the exported file. It must be a str. Default is 'rad'. See AngularPosition.unit for more details.

angular_speed_unitstr, optional

Symbol 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'. See AngularSpeed.unit for more details.

angular_acceleration_unitstr, optional

Symbol 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'. See AngularAcceleration.unit for more details.

torque_unitstr, optional

Symbol of the unit of measurement to which convert the torque values in the exported file. It must be a str. Default is 'Nm'. See Torque.unit for more details.

driving_torque_unitstr, optional

Symbol of the unit of measurement to which convert the torque values in the exported file. It must be a str. Default is 'Nm'. See Torque.unit for more details.

load_torque_unitstr, optional

Symbol of the unit of measurement to which convert the torque values in the exported file. It must be a str. Default is 'Nm'. See Torque.unit for more details.

force_unitstr, optional

Symbol of the unit of measurement to which convert the force values in the exported file. It must be a str. Default is 'N'. See Force.unit for more details.

stress_unitstr, optional

Symbol of the unit of measurement to which convert the stress values in the exported file. It must be a str. Default is 'MPa'. See Stress.unit for more details.

current_unitstr, optional

Symbol of the unit of measurement to which convert the electric current values in the exported file. It must be a str. Default is 'A'. See Current.unit for more details.

Raises

TypeError
  • If rotating_object is not an instance of RotatingObject,

  • if file_path is not a str,

  • if time_array is not a list,

  • if an element of time_array is not an instance of Time or a str,

  • if time_unit is not a str,

  • if angular_position_unit is not a str,

  • if angular_speed_unit is not a str,

  • if angular_acceleration_unit is not a str,

  • if torque_unit is not a str,

  • if driving_torque_unit is not a str,

  • if load_torque_unit is not a str,

  • if force_unit is not a str,

  • if stress_unit is not a str,

  • if current_unit is not a str.

ValueError
  • If file_path is an empty str,

  • if time_array is an empty list.