neuromancer.psl.nonautonomous module
Non-autonomous dynamic systems. Reference for Chaotic nonlinear ODEs
- class neuromancer.psl.nonautonomous.Actuator(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
These are the actuator dynamics from the IVER systems. Since the equations are linear they are a good sanity check for your modeling implementations.
- equations(t, x, u)[source]
States (8): [delta_u, delta_q, delta_r]
Inputs (3): [delta_uc, delta_qc, delta_rc] (thrust speed/deflections, normalized)
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.CSTR(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Continuous Stirred Tank Reactor model Original code obtained from APMonitor
- equations(t, x, u)[source]
- Inputs (1):
Temperature of cooling jacket (K)
- Disturbances (2):
Tf = Feed Temperature (K)
Caf = Feed Concentration (mol/m^3)
- States (2):
Concentration of A in CSTR (mol/m^3)
Temperature in CSTR (K)
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- get_x0(rand=False)[source]
Randomly sample an initial condition
- Parameters:
box – Dictionary with keys ‘min’ and ‘max’ and values np.arrays with shape=(nx,)
- property params
- class neuromancer.psl.nonautonomous.DuffingControl(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Duffing equation with driving force as a function of control inputs not time Source
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.HindmarshRose(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Hindmarsh–Rose model of neuronal activity
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.InvPendulum(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Inverted Pendulum dynamics * states: \(x = [ heta \dot{ heta}]\);
:math:` heta` is angle from upright equilibrium
input: u = input torque
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.IverSimple(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Dynamic model of Unmanned Underwater Vehicle (modified from Stankiewicz et al) – Excludes rolling, sway, currents, Includes: hydrostate/dynamic terms, control surface deflections/propeller thrust, and actuator dynamics with non-kinematic output
- equations(t, x, u)[source]
States (8): [theta, psi, uu, q, r, delta_u, delta_q, delta_r]
Inputs (3): [delta_uc, delta_qc, delta_rc] (thrust speed/deflections, normalized)
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.LorenzControl(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.SEIR_population(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Susceptible, Exposed, Infected, and Recovered (SEIR) population population model. Used to model COVID-19 spread. Source of the model
states:
Susceptible (s): population fraction that is susceptible to the virus
Exposed (e): population fraction is infected with the virus but does not transmit to others
Infectious (i): population fraction that is infected and can infect others
Recovered (r): population fraction recovered from infection and is immune from further infection
- equations(t, x, u)[source]
Inputs (1): social distancing (u=0 (none), u=1 (total isolation))
- States (4):
Susceptible (s): population fraction that is susceptible to the virus
Exposed (e): population fraction is infected with the virus but does not transmit to others
Infectious (i): population fraction that is infected and can infect others
Recovered (r): population fraction recovered from infection and is immune from further infection
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.SwingEquation(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Power Grid Swing Equation. The second-order swing equation is converted to two first-order ODEs
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.Tank(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Single Tank model Original code obtained from APMonitor
- equations(t, x, u)[source]
States (1): level in the tanks
Inputs u(1): c - valve coefficient (kg/s / %open)
Inputs u(2): valve in % [0-100]
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- get_x0()[source]
Randomly sample an initial condition
- Parameters:
box – Dictionary with keys ‘min’ and ‘max’ and values np.arrays with shape=(nx,)
- property params
- class neuromancer.psl.nonautonomous.ThomasAttractorControl(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Thomas’ cyclically symmetric attractor control input: dissipativity parameter b Source
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params
- class neuromancer.psl.nonautonomous.TwoTank(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Two Tank model. Original code obtained from APMonitor
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- get_x0()[source]
Randomly sample an initial condition
- Parameters:
box – Dictionary with keys ‘min’ and ‘max’ and values np.arrays with shape=(nx,)
- property params
- property umax
Note that although the theoretical upper bound is 1.0, this results in numerical instability in the integration.
- property umin
- class neuromancer.psl.nonautonomous.VanDerPolControl(exclude_norms=['Time'], backend='numpy', requires_grad=False, seed: int | Generator = 59, set_stats=True)[source]
Bases:
ODE_NonAutonomous
Van der Pol oscillator
http://kitchingroup.cheme.cmu.edu/blog/2013/02/02/Solving-a-second-order-ode/
section V.A in: https://arxiv.org/abs/2203.14114
- get_U(nsim, signal=None, **signal_kwargs)[source]
For sampling a sequence of control actions :param nsim: length of sequence :return: Matrix nsim X nU
- property params