Documentation ¶
Overview ¶
Package lti implements a general state-space representation of a linear system. A state-space representation can be expressed in a matrix form as
x'(t) = A * x(t) + B * u(t) and y(t) = C * x(t) + D * u(t)
where x(t) represents the state and u(t) the control input vectors and the matrices are A: System matrix, B: Control matrix, C: Output matrix and D: Feedforward matrix
Index ¶
- func IdealDiscretization(A *mat.Dense, dt float64, M *mat.Dense) (*mat.Dense, error)
- func RealDiscretization(A *mat.Dense, dt float64, M *mat.Dense) (*mat.Dense, error)
- type Covariance
- type Discrete
- type DiscreteLTI
- type LTI
- type System
- func (s *System) Controllable() (bool, error)
- func (s *System) Derivative(x, u *mat.VecDense) *mat.VecDense
- func (s *System) Discretize(dt float64) (*Discrete, error)
- func (s *System) MustControllable() bool
- func (s *System) MustObservable() bool
- func (s *System) Observable() (bool, error)
- func (s *System) Response(x *mat.VecDense, u *mat.VecDense) *mat.VecDense
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdealDiscretization ¶
IdealDiscretization returns a discretized matrix Md = exp(A*t) * M. If M is nil, then it just returns exp(A*t).
Types ¶
type Covariance ¶
Covariance contains a discretized matrix to predict the next covariance matrix according to p(k+1) = Md * p(k) * Md^T
func NewCovariance ¶
func NewCovariance(md *mat.Dense) *Covariance
NewCovariance creates a new covariance struct which needs to be initialized with a discretizied matrix Md
type Discrete ¶
Discrete represents a discrete LTI system.
The parameters are:
A_d: Discretized Ssystem matrix B_d: Discretized Control matrix
func NewDiscrete ¶
NewDiscrete returns a Discrete struct
func (*Discrete) Controllable ¶
Controllable checks the controllability of the LTI system.
func (*Discrete) Observable ¶
Observable checks the observability of the LTI system.
type DiscreteLTI ¶
DiscreteLTI represents a discretized LTI system
type LTI ¶
type LTI interface { Observable() (bool, error) Controllable() (bool, error) Response(x, u *mat.VecDense) *mat.VecDense }
LTI represents a general time-continuous state-space LTI system
type System ¶
System represents the state equations of time-continuous, linear systems
The parameters are:
A: System matrix B: Control matrix C: Output matrix D: Feedforward matrix
func (*System) Controllable ¶
Controllable checks the controllability of the LTI system.
func (*System) Derivative ¶
Derivative returns the derivative vetor x'(t) = A * x(t) + B * u(t)
func (*System) Discretize ¶
Discretize discretizes the time-continuous LTI into an explicit time-discrete LTI system
func (*System) MustControllable ¶
MustControllable checks the controllability and panics when error occurs
func (*System) MustObservable ¶
MustObservable checks the observability of the LTI system. and panics when error occurs
func (*System) Observable ¶
Observable checks the observability of the LTI system.