Context
Following up on https://github.com/orgs/pathsim/discussions/195, this is
where the python-control integration for pathsim lives, split into two
phases.
Phase 1 — linear bridge (in progress)
The linearization design landed differently than originally scoped here.
pathsim/pathsim#237 (trim() + linearize_system()) was closed without
merging; the maintainer implemented linearization as a pure query instead
in pathsim/pathsim#239 — see
https://github.com/orgs/pathsim/discussions/195#discussioncomment-17779351
for the design rationale.
Simulation.to_statespace(inputs, outputs, t=None) (merged into
pathsim master, not yet in a PyPI release) returns a StateSpace
block whose A/B/C/D and state_labels/input_labels/output_labels
already match control.StateSpace's states=/inputs=/outputs=
kwargs. to_control_statespace(sim, inputs, outputs, t=None) here is a
thin wrapper around it, no adapter code needed. Unlocks control.margin,
control.root_locus, control.bode_plot, etc. on any pathsim
Simulation immediately.
trim() wasn't part of that merge and doesn't exist yet — planned as an
extension of Simulation.steadystate().
Phase 2 — nonlinear bridge (later)
Wrap an entire pathsim Simulation as a control.NonlinearIOSystem
(updfcn/outfcn), enabling full nonlinear simulation/operating-point
analysis through python-control's own tooling. Harder: needs adapting the
DAG-order algebraic-loop-resolution logic in pathsim core's
utils/linearization.py (assemble_linear_system) to work with nonlinear
per-block functions instead of Jacobians.
Context
Following up on https://github.com/orgs/pathsim/discussions/195, this is
where the python-control integration for pathsim lives, split into two
phases.
Phase 1 — linear bridge (in progress)
The linearization design landed differently than originally scoped here.
pathsim/pathsim#237 (
trim()+linearize_system()) was closed withoutmerging; the maintainer implemented linearization as a pure query instead
in pathsim/pathsim#239 — see
https://github.com/orgs/pathsim/discussions/195#discussioncomment-17779351
for the design rationale.
Simulation.to_statespace(inputs, outputs, t=None)(merged intopathsimmaster, not yet in a PyPI release) returns aStateSpaceblock whose
A/B/C/Dandstate_labels/input_labels/output_labelsalready match
control.StateSpace'sstates=/inputs=/outputs=kwargs.
to_control_statespace(sim, inputs, outputs, t=None)here is athin wrapper around it, no adapter code needed. Unlocks
control.margin,control.root_locus,control.bode_plot, etc. on any pathsimSimulationimmediately.trim()wasn't part of that merge and doesn't exist yet — planned as anextension of
Simulation.steadystate().Phase 2 — nonlinear bridge (later)
Wrap an entire pathsim
Simulationas acontrol.NonlinearIOSystem(
updfcn/outfcn), enabling full nonlinear simulation/operating-pointanalysis through python-control's own tooling. Harder: needs adapting the
DAG-order algebraic-loop-resolution logic in pathsim core's
utils/linearization.py(assemble_linear_system) to work with nonlinearper-block functions instead of Jacobians.