snapshot¶
- Powertrain.snapshot(target_time: Time, variables: list[str] | None = None, 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', print_data: bool | None = True) DataFrame
It computes a snapshot of the time variables of the elements in the powertrain at the specified
target_time.It returns a
pandas.DataFramewith the computed time variables. Each element in the powertrain’selementsis a row of the DataFrame, while the columns are the time variables'angular position','angular speed','angular acceleration','torque','driving torque'and'load torque'. The motor can have additional variables'electric current'and'pwm', while gears can have additional parameters'tangential force','bending stress'and'contact stress', depending on instantiation parameters.It is possible to select the variables to be printed with the
variablesparameter.Each time variable is converted to the relative unit passed as optional parameter.
If the
target_timeis not among simulated time steps in thetimeproperty, it computes a linear interpolation from the two closest simulated time steps.Parameters¶
target_timeTimeThe time to which compute the powertrain time variables’ snapshot. It must be an instance of
Time, whose value must be within minimum and maximum simulated time steps intimeproperty.variableslist, optionalTime variables to be printed. It must be a
list. Default is all available time variables.angular_position_unitstr, optionalSymbol of the unit of measurement to which convert the angular position values in the DataFrame. 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 DataFrame. 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 DataFrame. 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 DataFrame. 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 driving torque values in the DataFrame. 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 load torque values in the DataFrame. 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 DataFrame. 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 DataFrame. 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 DataFrame. It must be a
str. Default is'A'. SeeCurrent.unitfor more details.print_databool, optionalWhether to print the computed time variables DataFrame. Default is
True.
Returns¶
pandas.DataFrameThe DataFrame containing time variables values at the specified
target_timefor each element in the powertrain’selements.
Raises
TypeErrorIf an element of
timeis not an instance ofTime,if
target_timeis not an instance ofTime,if
variablesis not alist,if an element of
variablesis 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,if
print_datais not abool.
ValueError