plot¶
- Powertrain.plot(elements: list[RotatingObject | str] | None = None, 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', force_unit: str | None = 'N', stress_unit: str | None = 'MPa', current_unit: str | None = 'A', time_unit: str | None = 'sec', figsize: tuple | None = None) None
It plots time variables for selected
elementsin the powertrain’selements.It generates a grid of subplots, one column for each selected element of the powertrain’s
elementsand one row for each selected time variable.The available elements are listed in
elementsand the available variables are:'angular position','angular speed','angular acceleration','torque','driving torque'and'load torque'. The motor can have additional variableselectric currentandpwmwhile gears can have additional variablestangential force,bending stressandcontact stress, depending on instantiation parameters.The time variables are plotted in the described order, from the top row to the bottom one; torques are grouped together in a single row as well as stresses are grouped together. Plotted values’ units are managed with optional parameters.
Elements to be plotted can be passed as instances or names (
str) in alist.Parameters¶
elementslist, optionalElements of the powertrain’s
elementswhich time variables have to be plotted. Each single element can be passed as instance or name (str). Default is all elements in the powertrain’selements.variableslist, optionalTime variables to be plotted. Default is all available time variables.
angular_position_unitstr, optionalSymbol of the unit of measurement to which convert the angular position values in the plot. 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 plot. 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 plot. 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 plot. 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 plot. 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 plot. 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 plot. It must be a
str. Default is'A'. SeeCurrent.unitfor more details.time_unitstr, optionalSymbol of the unit of measurement to which convert the time values in the plot. It must be a
str. Default is'sec'. SeeTime.unitfor more details.figsizetuple, optionalWidth and height of the window size, in inches. If not provided defaults to
[6.4, 4.8].
Raises
TypeErrorIf
elementsis not alist,if an element of
elementsis not an instance ofRotatingObjector astr,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
force_unitis not astr,if
stress_unitis not astr,if
current_unitis not astr,if
time_unitis not astr,if
figsizeis not atuple,
ValueError