System representation

LTI system

Consider a continuous linear time invariant system described by:

(1)\dot{x} = Ax + Bu \\
y = Cx + Du

where x\in\mathbb{R}^n is the state, u\in\mathbb{R}^m is the control input, A\in\mathbb{R}^{nn} is the state matrix, B\in\mathbb{R}^{nm} is the control matrix

To create a LTI system use OpenControl.ADP_control.LTI

import numpy as np
from ADP_control import LTI

A = np.eye(3); B = np.ones((3,1))
sys = LTI(A, B) # or sys = LTI(A, B, C, D)

then setup a simulation section, use OpenControl.ADP_control.LTI.setSimulationParam()

t_start = 0; t_stop = 10
x0 = np.array([1,2,3])
sample_time = 0.01

sys.setupSimulationParam(t_sim=(t_start, t_stop), x0=x0, sample_time=sample_time)

Non-linear System

Consider a continuous-time affine nonlinear dynamical system described by:

(2)\dot{x} = f(x) + g(x)u

where x\in\mathbb{R}^n is the state, u\in\mathbb{R}^m is the control input, f:\mathbb{R}^n \to \mathbb{R}^n and g:\mathbb{R}^n \to \mathbb{R}^{nm} are locally Lipschitz mappings with f(0)=0

To create a nonlinear system use OpenControl.ADP_control.NonLin

from ADP_control import nonLin

dot_x = lambda t,x,u: 3x + np.array([0 0 1]).dot(u)
dimension = (3,1)
sys = NonLin(dot_x, dimension)

then setup a simulation section, see setup a simulation section