OpenControl.classiccontrol.linearsystem
¶
Module Contents¶
Classes¶
main object |
- class OpenControl.classiccontrol.linearsystem.LTI(**kwargs)¶
- main object
#dimension: ndim of state,input and output vector
- Raises
assert – [description]
ValueError – [description]
ValueError – [description]
- Returns
[description]
- Return type
[type]
- bibo_result¶
- property states_shape(self) → int¶
- property inputs_shape(self) → int¶
- property outputs_shape(self) → int¶
- property max_step(self)¶
- property A(self)¶
- property B(self)¶
- property C(self)¶
- property D(self)¶
- property dimension(self) → list¶
An attributes of system
- Returns
got the length 3, dimention of
- Return type
list
- eigvals(self)¶
Compute the eigen values of system matrix (matrix A)
- Returns
[1D array of eigvalues]
- Return type
[np.ndarray]
- is_stable(self, algorimth='hurwitz', **kwagrs) → int¶
[Compute the stability of system]
- Parameters
algorimth (str, optional) – [select the algorithms to determine stability of system ]. Defaults to ‘hurwitz’.
- Returns
- 1 - if system is stable
0 - if selected algorithms can’t conclude about stability of system
-1 - if system is unstable
- Return type
int
- is_controlable(self, algorimth='kalman', **kwagrs) → bool¶
Determine the controllability of system.
- Parameters
algorimth (str, optional) – select the algorithms to determine controllability of system. Defaults to ‘kalman’.
- Raises
ValueError – if the input matrix (matrix B) not found
- Returns
True if system is controlalbe
- Return type
bool
- is_observable(self, algorimth='kalman') → bool¶
Determine the observability of system.
- Parameters
algorimth (str, optional) – select the algorithms to determine observability of system. Defaults to ‘kalman’.
- Raises
ValueError – if the output matrix (matrix C) not found
- Returns
True is system is observable
- Return type
bool
- setup_simulink(self, max_step=0.001, algo='RK45', t_sim=(0, 10), x0=None, sample_time=0.01, z0=None)¶
Run this function before any simulations. This method set the necessary params for running simulation.
- Parameters
max_step (float, optional) – define max step for ODEs solver algorithms. Defaults to 1e-3.
algo (str, optional) – RK45, RK23 or DOP853 . Defaults to ‘RK45’.
t_sim (tuple, optional) – time for simualtion (start, stop). Defaults to (0,10).
x0 (1xn array, optional) – the initial state. Defaults to np.ones((n,)).
sample_time (float, optional) – the sample time. Defaults to 1e-2.
- step_response(self, input_function=None, logs_file=None)¶
- simulate behavior of Opne-Loop system
Run self.setup_simulink() before running this this method
- Parameters
input_function ([function], optional) – address of input funtions, this funtion take a prams - t, and return the values of input in time t. Defaults to None.
logs_file ([string], optional) – [path to logs folder,]. Defaults to None.
- Returns
- 2D-np.ndarray
time series to simulate
- x_out: 2D-np.ndarray
state of system in time series ,between self.t_sim
- y_out: 2D-np.ndarray
output of system in time series,
- Return type
time_array
- apply_state_feedback(self, R, input_function=None, logs_file=None)¶
- simulate the behavior of close-loop system (feedback_system)
Run self.setup_simulink() before running this this method
- Parameters
R – (2D-np.ndarray) state_feedback_matrix
input_function – function
- Returns
- 2D-np.ndarray
time series to simulate
- x_out: 2D-np.ndarray
state of system in time series ,between self.t_sim
- y_out: 2D-np.ndarray
output of system in time series,
- Return type
time_array
- apply_observer(self, L, input_function=None, logs_file=None)¶
- apply_output_feedback(self, L, R, input_function=None, logs_file=None)¶