engine.solvers.plant
engine.solvers.plant
Physical-plant solvers: the stopping, actuation, heat, and power budgets of an embodied machine (added 2026-10-20).
Domain implementations behind mlsysim.solvers (the public import path, derived from engine.solvers.__init__). Each model takes stated inputs and returns every intermediate a budget quotes, so a chapter, a slide deck, and a lab read the same arithmetic. The equations themselves live in physics/ (robotics/stopping.py, drivetrain.py, motors.py); these models only compose them into the budgets of one machine.
Classes
| Name | Description |
|---|---|
| BrakingCeilingsModel | The three ceilings on a credible deceleration (traction, tip-over, drive torque) and back-EMF headroom. |
| ContinuousDeratingModel | Installed continuous torque relative to the catalog rating. |
| DiagnosticCoverageModel | Diagnostic coverage that leaves at most target of a raw fault rate |
| DriveBusModel | A shared drive bus: sustained sag under a coincident load step, and the regenerative surge of a stop. |
| ExponentialRareEventModel | One rare exponential tail estimated by plain Monte Carlo, a zero-failure |
| FreshnessProfileModel | A moving target’s freshness deadline against a capture-to-onset age profile. |
| GearRatioCostModel | Holding heat and reflected inertia of one motor holding one joint torque, per gear ratio. |
| GearedRotorModel | Reflected rotor inertia N^2 J_rotor, sized as a solid flywheel, and the inertia match. |
| HubDriveElectricalModel | Electrical time constant, voltage-limited current ramp, and phase-short braking peak of a hub drive. |
| SpeedStepModel | Braking travel added by raising the speed setpoint, and the delay that costs the same distance. |
| StallDeratingModel | Steady stall temperature with copper’s resistance feedback, and the hold the winding can sustain. |
| ThermalBurstModel | Burst horizons from a cold and a heat-soaked start, the average-power duty screen, and the periodic peak. |
| ThrottledStageModel | A compute-bound stage at a fraction of full clock: its time scales by the inverse clock ratio, |
| ZeroFailureModel | Upper bound on the per-trial failure rate after a failure-free campaign. |
BrakingCeilingsModel
engine.solvers.plant.BrakingCeilingsModel()The three ceilings on a credible deceleration (traction, tip-over, drive torque) and back-EMF headroom.
Composes calc_braking_limits for a wheeled base driven by direct-drive hub motors at a configured current limit, adds the rated-current torque ceiling and the inspected-floor traction ceiling (all weight on the driven wheels), and checks the terminal voltage braking and driving need at speed.
Methods
| Name | Description |
|---|---|
| solve | The three ceilings on a credible deceleration (traction, tip-over, drive torque) and back-EMF headroom. |
solve
engine.solvers.plant.BrakingCeilingsModel.solve(
mass,
deceleration,
speed,
hub,
n_wheels,
current_limit,
drive_load_share,
mu_dry,
mu_inspected,
bus_low,
cg_height=None,
tip_arm=None,
)The three ceilings on a credible deceleration (traction, tip-over, drive torque) and back-EMF headroom.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| mass | Quantity | Positive translated mass (kg). | required |
| deceleration | Quantity | Requested positive deceleration (m/s^2). | required |
| speed | Quantity | Forward speed (m/s). | required |
| hub | object | Motor specification with wheel radius, torque constant, rotating mass bound, rated torque, back-EMF constant, and line resistance. | required |
| n_wheels | int | Positive driven wheel count. | required |
| current_limit | Quantity | Per-wheel current limit (A). | required |
| drive_load_share | float | Fraction of normal load carried by driven wheels, in (0, 1]. | required |
| mu_dry | float | Positive dry-floor friction coefficient. | required |
| mu_inspected | float | Positive inspected-floor friction coefficient. | required |
| bus_low | Quantity | Available bus voltage (V). | required |
| cg_height | Optional[Quantity] | Optional positive center-of-gravity height (m). | None |
| tip_arm | Optional[Quantity] | Optional positive support-polygon tipping arm (m). | None |
Returns
| Name | Type | Description |
|---|---|---|
| BrakingCeilingsResult | Forces in N, deceleration ceilings in m/s^2, wheel torque in N*m, voltage headroom in V. |
Notes
Equation: Per-wheel torque is Kt*current_limit. Effective mass is mass+n_wheels*rotating_mass_bound; torque-limited deceleration is n_wheels*torque/(radius*effective_mass). Traction limits are mu*g*drive_load_share. Tip-over and voltage checks compose calc_braking_limits and calc_drive_voltage_headroom.
Assumptions: Quasistatic traction and rigid-body torque limits; identical wheel drives.
Excludes: Dynamic load transfer, tire dynamics, and safety certification.
References
Derivation: Wheel torque divided by radius gives longitudinal force; dividing by effective mass gives deceleration. Friction bounds that force by normal load times friction coefficient. See mlsysim.physics.drivetrain.calc_braking_limits for the tipping constraint and mlsysim.physics.drivetrain.calc_drive_voltage_headroom for the electrical convention.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> from types import SimpleNamespace
>>> hub = SimpleNamespace(wheel_radius=Q("0.1 m"), torque_constant=Q("1 N*m/A"), rotating_mass_bound=Q("1 kg"), rated_torque=Q("1 N*m"), peak_torque=Q("2 N*m"), back_emf_constant=Q("1 V*s/rad"), line_resistance=Q("1 ohm"), line_inductance=Q("0.001 H"), peak_current=Q("20 A"), pole_pairs=10)
>>> BrakingCeilingsModel().solve(Q("100 kg"), Q("1 m/s^2"), Q("1 m/s"), hub, 2, Q("10 A"), 1.0, 0.8, 0.6, Q("48 V")).force.magnitude > 0
TrueContinuousDeratingModel
engine.solvers.plant.ContinuousDeratingModel()Installed continuous torque relative to the catalog rating.
Continuous torque scales as sqrt((T_max - T_amb) / theta): a hotter ambient and a larger installed thermal resistance each cut it.
Methods
| Name | Description |
|---|---|
| solve | Installed continuous torque relative to the catalog rating. |
solve
engine.solvers.plant.ContinuousDeratingModel.solve(
ceiling,
catalog_ambient,
installed_ambient,
thermal_resistance_factor,
)Installed continuous torque relative to the catalog rating.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ceiling | Quantity | Absolute winding temperature ceiling (K). | required |
| catalog_ambient | Quantity | Catalog ambient below ceiling (K). | required |
| installed_ambient | Quantity | Installed ambient below ceiling (K). | required |
| thermal_resistance_factor | float | Positive installed/catalog thermal resistance ratio. | required |
Returns
| Name | Type | Description |
|---|---|---|
| ContinuousDeratingResult | Dimensionless installed/catalog torque shares for ambient alone and combined thermal effects. |
Notes
Equation: Ambient-only torque share is sqrt((ceiling-installed_ambient)/(ceiling-catalog_ambient)); combined share divides this by sqrt(thermal_resistance_factor).
Assumptions: Torque proportional to current and copper loss proportional to current squared.
Excludes: Temperature-dependent electrical resistance and transient bursts.
References
Derivation: At equilibrium, allowable copper power is temperature headroom divided by thermal resistance. Fixed resistance makes allowable current proportional to the square root of this power, and fixed torque constant makes torque proportional to current.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> ContinuousDeratingModel().solve(Q("350 K"), Q("300 K"), Q("320 K"), 2).combined_share < 1
TrueDiagnosticCoverageModel
engine.solvers.plant.DiagnosticCoverageModel()Diagnostic coverage that leaves at most target of a raw fault rate unmitigated, and the zero-miss injection campaign that demonstrates it (added 2026-10-20).
Rates are in FIT (faults per 10^9 hours). The raw rate is the sum of the strata; coverage C_diag = 1 - target / raw. Each injection misses with probability 1 - C_diag, so n zero-miss injections bound it at confidence C when n >= ln(1 - C) / ln(C_diag); the rule of three approximates n by 3 / (1 - C_diag). Drawn in proportion to the rates, each stratum receives its share of the n injections.
Methods
| Name | Description |
|---|---|
| solve | Diagnostic coverage that leaves at most target of a raw fault rate unmitigated, and the zero-miss injection campaign that demonstrates it (added 2026-10-20). |
solve
engine.solvers.plant.DiagnosticCoverageModel.solve(strata, target, confidence)Diagnostic coverage that leaves at most target of a raw fault rate unmitigated, and the zero-miss injection campaign that demonstrates it (added 2026-10-20).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| strata | Dict[str, float] | Mapping from stratum names to nonnegative fault rates (FIT), positive total. | required |
| target | float | Positive residual rate below the total, in FIT. | required |
| confidence | float | One-sided confidence level in (0, 1). | required |
Returns
| Name | Type | Description |
|---|---|---|
| DiagnosticCoverageResult | Fault-rate total in FIT, dimensionless coverage and shares, and injection counts. |
Notes
Equation: Raw rate is sum(strata.values()); required coverage = 1-target/raw_rate. The exact real-valued trial threshold is ln(1-confidence)/ln(coverage), rounded upward for injections. Stratum share = stratum_rate/raw_rate; allocation = injections*share.
Assumptions: Independent representative injection trials and proportional stratum allocation.
Excludes: Unequal detection probability by stratum, common-cause dependencies, and certification.
References
Derivation: Residual faults are the raw rate times the missed fraction. For independent representative injections, observing no misses has probability coverage^n. Inverting that probability gives the trial threshold. Proportional allocations are expected counts, not a rounded stratified test design.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> DiagnosticCoverageModel().solve({"sensor": 100.0}, 1.0, 0.95).injections > 0
TrueDriveBusModel
engine.solvers.plant.DriveBusModel()A shared drive bus: sustained sag under a coincident load step, and the regenerative surge of a stop.
Sag Delta V = Delta I R_bus against the converter lockout; the step current that would spend the depleted pack’s headroom is (V_low - V_uvlo) / R_bus. A stop from speed v returns a share of (1/2) m v^2; into the bus capacitance alone, V_final = sqrt(V_full^2 + 2 E / C). Speed falls linearly at constant deceleration, so regenerated power falls linearly from 2 E / t_stop, and a chopper resistor at the clamp must satisfy R <= V_clamp^2 / P_peak.
Methods
| Name | Description |
|---|---|
| solve | A shared drive bus: sustained sag under a coincident load step, and the regenerative surge of a stop. |
solve
engine.solvers.plant.DriveBusModel.solve(
mass,
speed,
deceleration,
step_current,
bus_resistance,
full,
nominal,
depleted,
lockout,
compute_power,
converter_efficiency,
capacitance,
clamp,
regen_fraction,
)A shared drive bus: sustained sag under a coincident load step, and the regenerative surge of a stop.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| mass | Quantity | Positive moving mass (kg). | required |
| speed | Quantity | Positive entry speed (m/s). | required |
| deceleration | Quantity | Positive constant deceleration (m/s^2). | required |
| step_current | Quantity | Positive coincident current increase (A). | required |
| bus_resistance | Quantity | Positive supply-path resistance (ohm). | required |
| full | Quantity | Full-pack voltage (V). | required |
| nominal | Quantity | Nominal voltage (V). | required |
| depleted | Quantity | Depleted-pack voltage (V). | required |
| lockout | Quantity | Converter undervoltage lockout (V). | required |
| compute_power | Quantity | Compute load power (W). | required |
| converter_efficiency | float | Converter efficiency in (0, 1]. | required |
| capacitance | Quantity | Positive bus capacitance (F). | required |
| clamp | Quantity | Regeneration clamp voltage (V). | required |
| regen_fraction | float | Fraction of kinetic energy recovered, in (0, 1]. | required |
Returns
| Name | Type | Description |
|---|---|---|
| DriveBusResult | Bus voltages in V, currents in A, energies in J, stop time in ms, peak power in W, and resistor bound in ohm. |
Notes
Equation: Compute current = compute_power/(converter_efficiency*nominal); sag = step_current*bus_resistance. Recovered energy E = regen_fraction*mass*speed^2/2 gives capacitor-only endpoint sqrt(full^2+2*E/capacitance). Stop duration = speed/deceleration, peak regenerative power = 2*E/stop_duration, and resistor ceiling = clamp^2/peak_power.
Assumptions: Constant deceleration, resistive sustained sag, and stated energy-recovery fraction.
Excludes: Inductive transients, battery absorption, and chopper switching dynamics.
References
Derivation: Ohm’s law gives sustained sag. Equating recovered kinetic energy to the increase in capacitor energy gives the endpoint voltage. Constant deceleration makes recovery power triangular in time, so its peak is twice its mean. This treats the capacitor-only case separately from battery absorption.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> DriveBusModel().solve(Q("100 kg"), Q("1 m/s"), Q("1 m/s^2"), Q("10 A"), Q("0.1 ohm"), Q("48 V"), Q("44 V"), Q("40 V"), Q("36 V"), Q("100 W"), 0.9, Q("1 F"), Q("50 V"), 0.5).regenerated.magnitude > 0
TrueExponentialRareEventModel
engine.solvers.plant.ExponentialRareEventModel()One rare exponential tail estimated by plain Monte Carlo, a zero-failure campaign, and cross-entropy importance sampling (added 2026-10-20).
The operational variable is exponential with mean; failure is a draw past threshold, so p = exp(-threshold / mean). Plain Monte Carlo needs (1 - p) / (p r^2) runs for relative error r; a zero-failure campaign needs ceil(ln(1 - C) / ln(1 - p)) clean runs to bound p. The cross-entropy method with elite_share reaches the threshold in a few levels; its exponential proposal gives the per-draw relative variance, the weighted runs for r, the share of proposal draws that fail, and the effective sample size.
Methods
| Name | Description |
|---|---|
| solve | One rare exponential tail estimated by plain Monte Carlo, a zero-failure campaign, and cross-entropy importance sampling (added 2026-10-20). |
solve
engine.solvers.plant.ExponentialRareEventModel.solve(
threshold,
mean,
elite_share,
relative_error,
confidence,
)One rare exponential tail estimated by plain Monte Carlo, a zero-failure campaign, and cross-entropy importance sampling (added 2026-10-20).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| threshold | Quantity | Positive failure threshold, in the same units as mean. | required |
| mean | Quantity | Positive operational exponential mean. | required |
| elite_share | float | Cross-entropy elite fraction in (0, 1). | required |
| relative_error | float | Positive target relative standard error. | required |
| confidence | float | One-sided confidence level in (0, 1). | required |
Returns
| Name | Type | Description |
|---|---|---|
| ExponentialRareEventResult | Analytic failure probabilities, dimensionless variances, effective counts, and proposal mean in the input units. |
Notes
Equation: Failure probability p = exp(-threshold/mean). Plain Monte Carlo requires (1-p)/(p*relative_error^2) draws; importance sampling requires relative_variance/relative_error^2. Proposal means and variances come from the analytic exponential cross-entropy and importance-sampling helpers.
Assumptions: Exponential operational and proposal families with analytic importance weights.
Excludes: Empirical sampling, distribution misspecification, and device measurements.
References
Derivation: The exponential survival function gives p. Bernoulli variance divided by squared target absolute error gives the ordinary sample budget. Applying the same variance-to-error calculation to likelihood-weighted draws yields the importance budget; see mlsysim.physics.statistics.calc_importance_sampling_exponential and calc_cross_entropy_exponential_proposal.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> ExponentialRareEventModel().solve(Q("5 s"), Q("1 s"), 0.1, 0.1, 0.95).failure_probability < 1
TrueFreshnessProfileModel
engine.solvers.plant.FreshnessProfileModel()A moving target’s freshness deadline against a capture-to-onset age profile.
The deadline is the tolerance left after the initial error, divided by the target speed: Delta t_fresh = (r_tol - e_0) / v. Stage percentiles are summed per percentile; the target’s travel at the median chain and at the system tail age is compared with the allowed error.
Methods
| Name | Description |
|---|---|
| solve | A moving target’s freshness deadline against a capture-to-onset age profile. |
solve
engine.solvers.plant.FreshnessProfileModel.solve(
target_speed,
tolerance,
initial_error,
stages,
focus_stage,
tail_age,
)A moving target’s freshness deadline against a capture-to-onset age profile.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| target_speed | Quantity | Positive target speed (m/s). | required |
| tolerance | Quantity | Allowed position error (m). | required |
| initial_error | Quantity | Position error before motion (m). | required |
| stages | Sequence[Tuple[str, Quantity, Quantity, Quantity]] | Sequence of (name, median, p99, maximum), with times in seconds. | required |
| focus_stage | str | Name present in stages whose median is inspected. | required |
| tail_age | Quantity | Separately supplied end-to-end tail age (s). | required |
Returns
| Name | Type | Description |
|---|---|---|
| FreshnessProfileResult | Allowed error and travel in mm, age/deadline in ms, and focus rate in Hz. |
Notes
Equation: Remaining position allowance r = tolerance-initial_error gives deadline r/target_speed. Each stage column is summed separately. Travel at age t is target_speed*t; slack is r-travel.
Assumptions: Constant target speed; stage quantiles are added as a budgeting convention, not as a probabilistic convolution.
Excludes: Correlation modeling and a guarantee that summed p99 values equal end-to-end p99.
References
Derivation: A constant-speed target consumes position allowance linearly with age. Stage-quantile sums are a declared budget construction, while tail_age is a separate end-to-end input; summing marginal quantiles does not derive a joint quantile.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> FreshnessProfileModel().solve(Q("1 m/s"), Q("1 m"), Q("0.1 m"), [("sensor", Q("0.01 s"), Q("0.02 s"), Q("0.03 s"))], "sensor", Q("0.04 s")).deadline.magnitude > 0
TrueGearRatioCostModel
engine.solvers.plant.GearRatioCostModel()Holding heat and reflected inertia of one motor holding one joint torque, per gear ratio.
Motor torque tau_m = tau_out / (eta N); copper loss (tau_m / K_m)^2 with K_m = K_t / sqrt(R_loss); reflected inertia N^2 J_in. Their product is tau_out^2 J_in / (eta^2 K_m^2), independent of N.
Methods
| Name | Description |
|---|---|
| solve | Holding heat and reflected inertia of one motor holding one joint torque, per gear ratio. |
solve
engine.solvers.plant.GearRatioCostModel.solve(
motor,
loss_resistance,
input_inertia,
output_torque,
gear_efficiency,
ratios,
)Holding heat and reflected inertia of one motor holding one joint torque, per gear ratio.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| motor | object | Motor specification with torque constant, peak torque, and rated torque. | required |
| loss_resistance | Quantity | Positive equivalent copper-loss resistance (ohm). | required |
| input_inertia | Quantity | Positive input-side inertia (kg*m^2). | required |
| output_torque | Quantity | Required joint holding torque (N*m). | required |
| gear_efficiency | float | Transmission efficiency in (0, 1]. | required |
| ratios | Iterable[int] | Iterable of positive integer reduction ratios. | required |
Returns
| Name | Type | Description |
|---|---|---|
| GearRatioCostResult | Per-ratio dictionaries of torque (Nm), copper loss (W), and reflected inertia (kgm^2). |
Notes
Equation: For reduction N, motor torque is output_torque/(gear_efficiency*N), motor constant Km = torque_constant/sqrt(loss_resistance), copper loss = (motor_torque/Km)^2, and reflected inertia = N^2*input_inertia.
Assumptions: Constant torque constant, loss resistance, and efficiency across ratios.
Excludes: Motion losses, gear mass, and temperature feedback.
References
Derivation: Combining torque = Kt*current with Joule loss current^2*R gives the torque-squared loss expression. Reflection increases inertia quadratically while required motor torque decreases inversely with reduction; their loss-inertia product therefore cancels N under fixed efficiency.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> from types import SimpleNamespace
>>> hub = SimpleNamespace(wheel_radius=Q("0.1 m"), torque_constant=Q("1 N*m/A"), rotating_mass_bound=Q("1 kg"), rated_torque=Q("1 N*m"), peak_torque=Q("2 N*m"), back_emf_constant=Q("1 V*s/rad"), line_resistance=Q("1 ohm"), line_inductance=Q("0.001 H"), peak_current=Q("20 A"), pole_pairs=10)
>>> GearRatioCostModel().solve(hub, Q("1 ohm"), Q("0.01 kg*m^2"), Q("10 N*m"), 0.9, [10, 20]).copper_loss[10].magnitude > 0
TrueGearedRotorModel
engine.solvers.plant.GearedRotorModel()Reflected rotor inertia N^2 J_rotor, sized as a solid flywheel, and the inertia match.
A solid disk of radius r has J = m r^2 / 2, so m = 2 J / r^2. Joint acceleration for a fixed motor torque peaks at N* = sqrt(J_load / J_rotor); at N it is 2x / (1 + x^2) of that peak, x = N / N*.
Methods
| Name | Description |
|---|---|
| solve | Reflected rotor inertia N^2 J_rotor, sized as a solid flywheel, and the inertia match. |
solve
engine.solvers.plant.GearedRotorModel.solve(
gear_ratio,
rotor_mass,
rotor_inertia,
flywheel_radius,
load_inertia,
)Reflected rotor inertia N^2 J_rotor, sized as a solid flywheel, and the inertia match.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| gear_ratio | float | Positive output reduction ratio. | required |
| rotor_mass | Quantity | Positive rotor mass (kg). | required |
| rotor_inertia | Quantity | Positive rotor inertia (kg*m^2). | required |
| flywheel_radius | Quantity | Positive equivalent solid-disk radius (m). | required |
| load_inertia | Quantity | Positive output load inertia (kg*m^2). | required |
Returns
| Name | Type | Description |
|---|---|---|
| GearedRotorResult | Reflected inertia in kg*m^2, equivalent mass in kg, radius in mm, and dimensionless response share. |
Notes
Equation: Reflected inertia is gear_ratio^2*rotor_inertia. Equivalent disk mass is 2*reflected_inertia/flywheel_radius^2. Matched ratio Nstar = sqrt(load_inertia/rotor_inertia); normalized acceleration is 2*x/(1+x^2), x = gear_ratio/Nstar.
Assumptions: Ideal rigid transmission and solid-disk equivalent flywheel.
Excludes: Gear compliance, friction, and efficiency losses.
References
Derivation: Conservation of rotational kinetic energy reflects inertia through the square of the speed ratio. The disk equivalent uses J = m*r^2/2. Maximizing acceleration at fixed motor torque over reduction ratio gives the inertia match; see mlsysim.physics.motors.calc_inertia_matched_ratio.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> GearedRotorModel().solve(10, Q("1 kg"), Q("0.01 kg*m^2"), Q("0.1 m"), Q("1 kg*m^2")).reflected_inertia.magnitude > 0
TrueHubDriveElectricalModel
engine.solvers.plant.HubDriveElectricalModel()Electrical time constant, voltage-limited current ramp, and phase-short braking peak of a hub drive.
tau_e = L / R (line quantities, the same ratio as per phase for a star winding); at stall the back-EMF is zero, so the full bus voltage ramps the current at V / L: t = L I / V. Shorted windings brake hardest where the winding reactance equals its resistance: omega_e = R / L, which is omega_e / p at the wheel for p pole pairs. The same R / L, divided by 2 pi, is the winding’s current pole in hertz.
Methods
| Name | Description |
|---|---|
| solve | Electrical time constant, voltage-limited current ramp, and phase-short braking peak of a hub drive. |
solve
engine.solvers.plant.HubDriveElectricalModel.solve(
hub,
current_limit,
bus_voltage,
brake_onset,
)Electrical time constant, voltage-limited current ramp, and phase-short braking peak of a hub drive.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| hub | object | Motor specification with line inductance/resistance, peak current, and pole pairs. | required |
| current_limit | Quantity | Positive target current (A). | required |
| bus_voltage | Quantity | Positive applied voltage (V). | required |
| brake_onset | Quantity | Positive allotted electrical onset time (s). | required |
Returns
| Name | Type | Description |
|---|---|---|
| HubDriveElectricalResult | Electrical times in ms, currents in A, electrical speed in rad/s, wheel speed in rpm, and pole frequency in Hz. |
Notes
Equation: Electrical time constant is L/R; initial ramp time is L*current_limit/bus_voltage. Full-step current is bus_voltage/R. The short-braking peak electrical speed is R/L, wheel speed is (R/L)/pole_pairs, and pole frequency is R/(2*pi*L).
Assumptions: Linear winding inductance/resistance; zero back-EMF during current-ramp calculation.
Excludes: PWM switching, magnetic saturation, and inverter dynamics.
References
Derivation: The series RL circuit equation at zero back-EMF gives the initial current slope V/L and steady current V/R. The short-braking speed estimate equates winding reactance and resistance; it assumes the linear sinusoidal electrical model.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> from types import SimpleNamespace
>>> hub = SimpleNamespace(wheel_radius=Q("0.1 m"), torque_constant=Q("1 N*m/A"), rotating_mass_bound=Q("1 kg"), rated_torque=Q("1 N*m"), peak_torque=Q("2 N*m"), back_emf_constant=Q("1 V*s/rad"), line_resistance=Q("1 ohm"), line_inductance=Q("0.001 H"), peak_current=Q("20 A"), pole_pairs=10)
>>> HubDriveElectricalModel().solve(hub, Q("10 A"), Q("48 V"), Q("0.01 s")).time_constant.magnitude > 0
TrueSpeedStepModel
engine.solvers.plant.SpeedStepModel()Braking travel added by raising the speed setpoint, and the delay that costs the same distance.
Braking travel grows as v^2; the added travel divided by the base speed is the pre-brake delay that would cost the same distance at the base speed.
Methods
| Name | Description |
|---|---|
| solve | Braking travel added by raising the speed setpoint, and the delay that costs the same distance. |
solve
engine.solvers.plant.SpeedStepModel.solve(
base_speed,
raised_speed,
deceleration,
)Braking travel added by raising the speed setpoint, and the delay that costs the same distance.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| base_speed | Quantity | Positive initial speed (m/s). | required |
| raised_speed | Quantity | Comparison speed (m/s). | required |
| deceleration | Quantity | Positive constant braking magnitude (m/s^2). | required |
Returns
| Name | Type | Description |
|---|---|---|
| SpeedStepResult | Added braking distance in mm and equivalent delay in ms; fractional growth is dimensionless. |
Notes
Equation: For speeds v0 and v1 and positive deceleration a, d0 = v0^2/(2a), d1 = v1^2/(2a), added = d1-d0, growth = d1/d0-1, and equivalent delay = added/v0.
Assumptions: Fixed deceleration at both speeds.
Excludes: Brake ramps, tire slip, and controller delay.
References
Derivation: Integrating constant deceleration gives stopping time v/a and mean speed v/2. Their product is the stopping distance; divide the difference of two distances by the original speed to express it as delay.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> SpeedStepModel().solve(Q("1 m/s"), Q("2 m/s"), Q("1 m/s^2")).braking_added.magnitude > 0
TrueStallDeratingModel
engine.solvers.plant.StallDeratingModel()Steady stall temperature with copper’s resistance feedback, and the hold the winding can sustain.
Steady state: dT = I^2 R_0 [1 + alpha (T_amb - T_0 + dT)] theta, linear in dT, so dT = c / (1 - g) with loop gain g = I^2 R_0 theta alpha (runaway if g >= 1). The sustainable loss at the limit is (T_limit - T_amb) / theta at the hot resistance R(T_limit).
Methods
| Name | Description |
|---|---|
| solve | Steady stall temperature with copper’s resistance feedback, and the hold the winding can sustain. |
solve
engine.solvers.plant.StallDeratingModel.solve(
hold_torque,
gear_ratio,
gear_efficiency,
torque_constant,
loss_resistance,
thermal_resistance,
ambient,
limit,
)Steady stall temperature with copper’s resistance feedback, and the hold the winding can sustain.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| hold_torque | Quantity | Required output holding torque (N*m). | required |
| gear_ratio | float | Positive reduction ratio. | required |
| gear_efficiency | float | Transmission efficiency in (0, 1]. | required |
| torque_constant | Quantity | Positive motor torque constant (N*m/A). | required |
| loss_resistance | Quantity | Positive resistance at the copper reference temperature (ohm). | required |
| thermal_resistance | Quantity | Positive winding-to-ambient resistance (K/W). | required |
| ambient | Quantity | Absolute ambient temperature (K). | required |
| limit | Quantity | Absolute winding limit above ambient (K). | required |
Returns
| Name | Type | Description |
|---|---|---|
| StallDeratingResult | Steady thermal rise in K, current in A, resistance in ohm, loss in W, and sustainable torque in N*m. |
Notes
Equation: Motor current I = hold_torque/(gear_efficiency*gear_ratio*torque_constant). With copper coefficient alpha, cold resistance R0, and thermal resistance theta, feedback gain g = I^2*R0*theta*alpha. Steady rise is I^2*R0*theta*(1+alpha*(ambient-T0))/(1-g). Sustainable current is sqrt((limit-ambient)/(theta*R(limit))).
Assumptions: Linear copper resistance feedback; finite stable equilibrium requires feedback_gain < 1.
Excludes: Nonlinear heat transfer and runaway transient dynamics; algebraic output above unit gain is not a stable equilibrium.
References
Derivation: Substitute the linear copper resistance-temperature relation into steady Joule heating and collect terms in temperature rise. The resulting denominator exposes the unit-gain instability. See mlsysim.physics.motors.calc_copper_resistance_factor for the reference-temperature convention.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> StallDeratingModel().solve(Q("1 N*m"), 10, 0.9, Q("1 N*m/A"), Q("1 ohm"), Q("1 K/W"), Q("300 K"), Q("350 K")).sustainable_current.magnitude > 0
TrueThermalBurstModel
engine.solvers.plant.ThermalBurstModel()Burst horizons from a cold and a heat-soaked start, the average-power duty screen, and the periodic peak.
First-order lumped winding at fixed resistance: tau = theta C; the burst drives the winding toward T_amb + P theta; the duty screen holds the average loss to (T_ceiling - T_amb) / theta; the off-time is rounded up to 0.1 s and the resulting schedule’s periodic peak is checked against the ceiling.
Methods
| Name | Description |
|---|---|
| solve | Burst horizons from a cold and a heat-soaked start, the average-power duty screen, and the periodic peak. |
solve
engine.solvers.plant.ThermalBurstModel.solve(
rated_current,
loss_resistance,
thermal_capacitance,
thermal_resistance,
ambient,
limit,
ceiling,
burst_factor,
burst_on,
)Burst horizons from a cold and a heat-soaked start, the average-power duty screen, and the periodic peak.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| rated_current | Quantity | Positive rated current (A). | required |
| loss_resistance | Quantity | Fixed copper-loss resistance (ohm). | required |
| thermal_capacitance | Quantity | Positive lumped winding heat capacity (J/K). | required |
| thermal_resistance | Quantity | Positive winding-to-ambient resistance (K/W). | required |
| ambient | Quantity | Absolute ambient temperature (K). | required |
| limit | Quantity | Absolute burst temperature limit (K). | required |
| ceiling | Quantity | Absolute average-operation temperature ceiling (K). | required |
| burst_factor | float | Positive multiplier on rated current. | required |
| burst_on | Quantity | Positive burst duration (s). | required |
Returns
| Name | Type | Description |
|---|---|---|
| ThermalBurstResult | Thermal horizons in s, temperatures in K, losses in W, burst current in A, and dimensionless duty. |
Notes
Equation: Thermal time constant is thermal_resistance*thermal_capacitance. Burst loss is (burst_factor*rated_current)^2*loss_resistance; asymptotic temperature is ambient+burst_loss*thermal_resistance. Duty = (ceiling-ambient)/(thermal_resistance*burst_loss); off-time is burst_on*(1-duty)/duty, rounded upward to tenths of a second for the periodic check.
Assumptions: Single thermal pole and fixed resistance; choose limits below the burst asymptote for finite heating horizons.
Excludes: Temperature-dependent resistance, spatial hot spots, and thermal protection certification.
References
Derivation: The lumped thermal energy balance gives exponential heating toward ambient+power*thermal_resistance. Inverting this exponential yields cold and hot horizons. See mlsysim.physics.motors.calc_first_order_time_to_temperature and calc_periodic_burst_peak_rise; average-power screening alone does not bound the periodic peak.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> ThermalBurstModel().solve(Q("1 A"), Q("1 ohm"), Q("10 J/K"), Q("1 K/W"), Q("300 K"), Q("303 K"), Q("302 K"), 2, Q("1 s")).burst_loss.magnitude > 0
TrueThrottledStageModel
engine.solvers.plant.ThrottledStageModel()A compute-bound stage at a fraction of full clock: its time scales by the inverse clock ratio, and the added age is paid as travel at the stated speed.
Methods
| Name | Description |
|---|---|
| solve | A compute-bound stage at a fraction of full clock: its time scales by the inverse clock ratio, and the added age is paid as travel at the stated speed. |
solve
engine.solvers.plant.ThrottledStageModel.solve(stage_time, clock_ratio, speed)A compute-bound stage at a fraction of full clock: its time scales by the inverse clock ratio, and the added age is paid as travel at the stated speed.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| stage_time | Quantity | Positive stage latency at full clock (s). | required |
| clock_ratio | float | Positive throttled/full clock ratio. | required |
| speed | Quantity | Motion speed during execution (m/s). | required |
Returns
| Name | Type | Description |
|---|---|---|
| ThrottledStageResult | Throttled time and added age in ms, and added travel in mm. |
Notes
Equation: Throttled duration = stage_time/clock_ratio; added age = throttled duration-stage_time; added travel = speed*added age.
Assumptions: Entire stage is compute bound and scales inversely with clock.
Excludes: Memory stalls, DVFS transition time, and nonlinear frequency effects.
References
Derivation: Fixed instruction work takes inversely proportional time as clock frequency changes when every relevant cycle scales with that clock. Constant-speed kinematics then converts the additional time into distance.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> ThrottledStageModel().solve(Q("1 ms"), 0.5, Q("1 m/s")).added_age.magnitude > 0
TrueZeroFailureModel
engine.solvers.plant.ZeroFailureModel()Upper bound on the per-trial failure rate after a failure-free campaign.
Poisson (rule of three): p_upper = -ln(1 - C) / n
exact binomial: p_upper = 1 - (1 - C)^(1/n)
With target_rate, also the clean trials that bound the rate at the target: ceil(ln(1 - C) / ln(1 - target)), and its rule-of-three estimate -ln(1 - C) / target (exact form and target added 2026-10-20).
Methods
| Name | Description |
|---|---|
| solve | Upper bound on the per-trial failure rate after a failure-free campaign. |
solve
engine.solvers.plant.ZeroFailureModel.solve(
trials,
confidence,
target_rate=None,
)Upper bound on the per-trial failure rate after a failure-free campaign.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| trials | int | Positive number of independent failure-free trials. | required |
| confidence | float | One-sided confidence level in (0, 1). | required |
| target_rate | Optional[float] | Optional target per-trial failure probability in (0, 1). | None |
Returns
| Name | Type | Description |
|---|---|---|
| ZeroFailureResult | Dimensionless approximate/exact failure bounds and trial counts; optional target counts are None when no target is supplied. |
Notes
Equation: For n trials and confidence C, approximate upper failure probability is -ln(1-C)/n; exact upper probability is 1-(1-C)^(1/n). A target p requires ceil(ln(1-C)/ln(1-p)) failure-free trials.
Assumptions: Independent identically distributed Bernoulli trials; approximate rate uses the zero-event Poisson bound.
Excludes: Nonstationarity, correlated failures, and proof of absence of failures.
References
Derivation: For independent Bernoulli trials, the probability of zero failures is (1-p)^n. Invert this probability at tail mass 1-C to obtain the exact one-sided bound. Replacing ln(1-p) by -p yields the Poisson approximation; see mlsysim.physics.robotics.assurance.calc_zero_failure_sample_size.
Examples
>>> from mlsysim.core.units import Q_ as Q
>>> ZeroFailureModel().solve(100, 0.95).rate_upper_exact < 1
True