sim

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New2DPlot

func New2DPlot(model, measure, filter *mat.Dense) (*plot.Plot, error)

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
}

BaseModel is a basic model of a dynamical system

func NewBaseModel

func NewBaseModel(A, B, C, D, E *mat.Dense) (*BaseModel, error)

NewBaseModel creates a model of falling ball and returns it

func (*BaseModel) ControlMatrix added in v0.1.0

func (b *BaseModel) ControlMatrix() mat.Matrix

ControlMatrix returns state propagation control matrix

func (*BaseModel) FeedForwardMatrix added in v0.1.0

func (b *BaseModel) FeedForwardMatrix() mat.Matrix

FeedForwardMatrix returns observation control matrix

func (*BaseModel) Observe

func (b *BaseModel) Observe(x, u, wn mat.Vector) (mat.Vector, error)

Observe observes external state of falling ball given internal state x and input u. wn is added to the output as a noise vector.

func (*BaseModel) OutputMatrix

func (b *BaseModel) OutputMatrix() mat.Matrix

OutputMatrix returns observation matrix

func (*BaseModel) Propagate

func (b *BaseModel) Propagate(x, u, wd mat.Vector) (mat.Vector, error)

Propagate propagates internal state x of a falling ball to the next step 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

func (b *BaseModel) SystemDims() (nx, nu, ny, nz int)

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

func (b *BaseModel) SystemMatrix() mat.Matrix

SystemMatrix returns state propagation matrix

type InitCond

type InitCond struct {
	// contains filtered or unexported fields
}

InitCond implements filter.InitCond

func NewInitCond

func NewInitCond(state mat.Vector, cov mat.Symmetric) *InitCond

NewInitCond creates new InitCond and returns it

func (*InitCond) Cov

func (c *InitCond) Cov() mat.Symmetric

Cov returns initial covariance

func (*InitCond) State

func (c *InitCond) State() mat.Vector

State returns initial state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL