Documentation ¶
Index ¶
- func New2DPlot(model, measure, filter *mat.Dense) (*plot.Plot, error)
- type BaseModel
- func (b *BaseModel) ControlMatrix() mat.Matrix
- func (b *BaseModel) FeedForwardMatrix() mat.Matrix
- func (b *BaseModel) Observe(x, u, wn mat.Vector) (mat.Vector, error)
- func (b *BaseModel) OutputMatrix() mat.Matrix
- func (b *BaseModel) Propagate(x, u, wd mat.Vector) (mat.Vector, error)
- func (b *BaseModel) SystemDims() (nx, nu, ny, nz int)
- func (b *BaseModel) SystemMatrix() mat.Matrix
- type InitCond
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New2DPlot ¶
New2DPlot creates new plot of the simulation from the three data sources: model: idealised model values measure: measurement values filter: filter values It returns error if the plot fails to be created. This can be due to either of the following conditions: * either of the supplied data matrices is nil * either of the supplied data matrices does not have at least 2 columns * gonum plot fails to be created
Types ¶
type BaseModel ¶
type BaseModel struct { // A is internal state matrix A *mat.Dense // B is control matrix B *mat.Dense // C is output state matrix C *mat.Dense // D is output control matrix D *mat.Dense // E is Disturbance matrix E *mat.Dense // Dt is the time step advanced on each Propagate() call Dt float64 }
BaseModel is a basic model of a linear, dynamical system
func NewBaseModel ¶
NewBaseModel creates a linear model based on the control theory equations which is advanced by timestep dt.
dx/dt = A*x + B*u + E*z (disturbances E not implemented yet) y = C*x + D*u
func (*BaseModel) ControlMatrix ¶ added in v0.1.0
ControlMatrix returns state propagation control matrix `B`.
func (*BaseModel) FeedForwardMatrix ¶ added in v0.1.0
FeedForwardMatrix returns observation control matrix `D`.
func (*BaseModel) Observe ¶
Observe returns external/observable state given internal state x and input u. wn is added to the output as a noise vector.
func (*BaseModel) OutputMatrix ¶
OutputMatrix returns observation matrix `C`.
func (*BaseModel) Propagate ¶
Propagate propagates returns the next internal state x of a linear system given an input vector u and a disturbance input z. (wd is process noise, z not implemented yet)
func (*BaseModel) SystemDims ¶ added in v0.1.0
SystemDims returns internal state length (nx), input vector length (nu), external/observable/output state length (ny) and disturbance vector length (nz).
func (*BaseModel) SystemMatrix ¶ added in v0.1.0
SystemMatrix returns state propagation matrix `A`.
type InitCond ¶
type InitCond struct {
// contains filtered or unexported fields
}
InitCond implements filter.InitCond
func NewInitCond ¶
NewInitCond creates new InitCond and returns it