pykoop.dynamic_models.DiscreteDynamicModel

class DiscreteDynamicModel

Bases: object

Discrete-time dynamic model.

__init__()

Methods

__init__()

f(t, x, u)

Implement next-state equation.

g(t, x)

Implement output equation.

simulate(t_range, t_step, x0, u)

Simulate the model.

abstract f(t, x, u)

Implement next-state equation.

Parameters:
  • t (float) – Time (s).

  • x (np.ndarray) – State.

  • u (np.ndarray) – Input.

Returns:

Next state.

Return type:

np.ndarray

g(t, x)

Implement output equation.

Parameters:
  • t (float) – Time (s).

  • x (np.ndarray) – State.

Returns:

Measurement of state.

Return type:

np.ndarray

simulate(t_range, t_step, x0, u)

Simulate the model.

Parameters:
  • t_range (Tuple[float, float]) – Start and stop times in a tuple.

  • t_step (float) – Timestep of output data.

  • x0 (np.ndarray) – Initial condition, shape (n, ).

  • u (np.ndarray) – Input array.

Returns:

Time and state at every timestep. Each timestep is one row.

Return type:

Tuple[np.ndarray, np.ndarray]