cpsim.models.nonlinear package

Submodules

cpsim.models.nonlinear.compute_analytical_model module

cpsim.models.nonlinear.compute_analytical_model_quad module

cpsim.models.nonlinear.continuous_stirred_tank_reactor module

class cpsim.models.nonlinear.continuous_stirred_tank_reactor.CSTR(name, dt, max_index, noise=None)[source]

Bases: Simulator

States: (2,)

x[0]: Concentration of A in CSTR (mol/m^3) x[1]: Temperature in CSTR (K)

Control Input: (1,)

u[0]: Temperature of cooling jacket (K)

Output: (2,)

State Feedback

Controller: PID

class cpsim.models.nonlinear.continuous_stirred_tank_reactor.Controller(dt)[source]

Bases: object

clear()[source]
set_control_limit(control_lo, control_up)[source]
update(ref: ndarray, feedback_value: ndarray, current_time) ndarray[source]
cpsim.models.nonlinear.continuous_stirred_tank_reactor.cstr(t, x, u, Tf=350, Caf=1, use_imath=False)[source]
cpsim.models.nonlinear.continuous_stirred_tank_reactor.cstr_imath(t, x, u, Tf=350, Caf=1)[source]
cpsim.models.nonlinear.continuous_stirred_tank_reactor.f(x, u, dt)[source]
cpsim.models.nonlinear.continuous_stirred_tank_reactor.jfu(x, u, dt)[source]
cpsim.models.nonlinear.continuous_stirred_tank_reactor.jfx(x, u, dt)[source]

cpsim.models.nonlinear.inverted_pendulum module

class cpsim.models.nonlinear.inverted_pendulum.Controller(dt, control_limit=None)[source]

Bases: object

clear()[source]
set_control_limit(control_lo, control_up)[source]
update(ref: ndarray, feedback_value: ndarray, current_time) ndarray[source]
class cpsim.models.nonlinear.inverted_pendulum.InvertedPendulum(name, dt, max_index, noise=None)[source]

Bases: Simulator

States: (4,)

x[0]: location of cart x[1]: dx[0] x[2]: pendulum angle (down:0, up:pi) x[3]: dx[1]

Control Input: (1,) [control_limit]

u[0]: force on the cart

Output: (4,)

State Feedback

Controller: LQR

cpsim.models.nonlinear.inverted_pendulum.inverted_pendulum(t, x, u, use_imath=False)[source]
cpsim.models.nonlinear.inverted_pendulum.inverted_pendulum_imath(t, x, u)[source]

cpsim.models.nonlinear.quad module

class cpsim.models.nonlinear.quad.Controller(dt)[source]

Bases: object

clear()[source]
set_control_limit(control_lo, control_up)[source]
update(ref: ndarray, feedback_value: ndarray, current_time) ndarray[source]
cpsim.models.nonlinear.quad.quad(t, x, u, use_imath=False)[source]
cpsim.models.nonlinear.quad.quad_imath(t, x, u)[source]
cpsim.models.nonlinear.quad.quad_jfx(x, u, dt)[source]
class cpsim.models.nonlinear.quad.quadrotor(name, dt, max_index, noise=None)[source]

Bases: Simulator

States: (4,)

x[0]: location of cart x[1]: dx[0] x[2]: pendulum angle (down:0, up:pi) x[3]: dx[1]

Control Input: (1,) [control_limit]

u[0]: force on the cart

Output: (4,)

State Feedback

Controller: LQR

cpsim.models.nonlinear.vessel module

class cpsim.models.nonlinear.vessel.Controller(dt)[source]

Bases: object

clear()[source]
set_control_limit(control_lo, control_up)[source]
update(ref: ndarray, feedback_value: ndarray, current_time) ndarray[source]
class cpsim.models.nonlinear.vessel.VESSEL(name, dt, max_index, noise=None)[source]

Bases: Simulator

States: (2,)

x[0]: Concentration of A in CSTR (mol/m^3) x[1]: Temperature in CSTR (K)

Control Input: (1,)

u[0]: Temperature of cooling jacket (K)

Output: (2,)

State Feedback

Controller: PID

cpsim.models.nonlinear.vessel.battery(signal)[source]
cpsim.models.nonlinear.vessel.copysign_custom(a, b, use_imath=False)[source]
cpsim.models.nonlinear.vessel.dcmotor(power, current, omega, use_imath=False)[source]
cpsim.models.nonlinear.vessel.deg2rad(x)[source]
cpsim.models.nonlinear.vessel.heading_circle(x)[source]
cpsim.models.nonlinear.vessel.kn2ms(x)[source]
cpsim.models.nonlinear.vessel.m2nmi(x)[source]
cpsim.models.nonlinear.vessel.ms2kn(x)[source]
cpsim.models.nonlinear.vessel.nmi2m(x)[source]
cpsim.models.nonlinear.vessel.propulsion(torque, shaft_speed, use_imath=False)[source]
cpsim.models.nonlinear.vessel.rad2deg(x)[source]
cpsim.models.nonlinear.vessel.rudder(command, surge_v, use_imath=False)[source]
cpsim.models.nonlinear.vessel.saturate(x, a, b, use_imath=False)[source]
cpsim.models.nonlinear.vessel.vessel(x, u, use_imath=False)[source]
cpsim.models.nonlinear.vessel.whole_model(t, x, u, use_imath=False)[source]
cpsim.models.nonlinear.vessel.whole_model_imath(t, x, u)[source]

Module contents