# System representation¶

## LTI system¶

Consider a continuous linear time invariant system described by:

(1) where is the state, is the control input, is the state matrix, is the control matrix

To create a LTI system use OpenControl.ADP_control.LTI

import numpy as np

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) where is the state, is the control input, and are locally Lipschitz mappings with 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