Dynamical systems¤
feedbax.dynamics.LTISystem
(AbstractDynamicalSystem[Array])
¤
Inspired by this Diffrax example.
A linear, continuous, time-invariant system.
Attributes:
Name | Type | Description |
---|---|---|
A |
Float[Array, 'state state']
|
The state evolution matrix. |
B |
Float[Array, 'state input']
|
The control matrix. |
C |
Float[Array, 'obs state']
|
The observation matrix. |
input_size: int
property
¤
Number of control variables.
state_size: int
property
¤
Number of state variables.
vector_field
(
t
: Scalar
,
state
: Array
,
input
: Array
)
->
Array
¤
vector_field
(
t
: Scalar
,
state
: Array
,
input
: Array
)
->
Array
Returns time derivatives of the system's states.
init
(
*,
key
: Optional[PRNGKeyArray] = None
)
->
Array
¤
init
(
*,
key
: Optional[PRNGKeyArray] = None
)
->
Array
Return a default state for the linear system.
Abstract base classes¤
feedbax.dynamics.AbstractDynamicalSystem
(AbstractModel[StateT])
¤
Base class for continuous dynamical systems.
Development note
The signature of vector_field
matches that expected by
diffrax.ODETerm
. However, the argument that is called
args
in the Diffrax documentation, we call input
, since
we use it for input signals (e.g. forces from the controller)
Vector fields for biomechanical models are generally not
time-dependent. That is, the argument t
to vector_field
is
typically unused. This is apparent in the way we alias vector_field
to __call__
, which is a method that AbstractModel
requires.
Perhaps it is unnecessary to inherit from AbstractModel
, though.
vector_field
(
t
: Scalar
,
state
: StateT
,
input
: PyTree[Array]
)
->
StateT
abstractmethod
¤
vector_field
(
t
: Scalar
,
state
: StateT
,
input
: PyTree[Array]
)
->
StateT
Returns scalar (e.g. time) derivatives of the system's states.
init
(
*,
key
: PRNGKeyArray
)
->
StateT
abstractmethod
¤
init
(
*,
key
: PRNGKeyArray
)
->
StateT
Returns the initial state of the system.
input_size
(
)
->
int
¤
input_size
(
)
->
int
Number of input variables.
__call__
(
input
: PyTree[Array]
,
state
: StateT
,
key
: PRNGKeyArray
)
->
StateT
¤
__call__
(
input
: PyTree[Array]
,
state
: StateT
,
key
: PRNGKeyArray
)
->
StateT
Alias for vector_field
, with a modified signature.