Documentation ¶
Index ¶
- func Abs(dst State)
- func Add(dst, s State)
- func AddConst(c float64, dst State)
- func AddScaled(dst State, alpha float64, s State)
- func Div(dst, s State)
- func Jacobian(dst *mat.Dense, d Diffs, s State, settings *fd.JacobianSettings) *mat.Dense
- func Max(s State) float64
- func Min(s State) float64
- func Mul(dst, s State)
- func Norm(s State, L float64) float64
- func Scale(c float64, dst State)
- func Sub(dst, s State)
- type Diff
- type Diffs
- type Input
- type State
- func AddScaledTo(dst, y State, alpha float64, s State) State
- func AddTo(dst, s, t State) State
- func DivTo(dst, s, t State) State
- func MulTo(dst, s, t State) State
- func New() State
- func NewFromXMap(xm map[Symbol]float64) State
- func ScaleTo(dst State, c float64, s State) State
- func SubTo(dst, s, t State) State
- func (s State) Clone() State
- func (s State) CloneBlank(t float64) State
- func (s State) ConsistencyU(question []Symbol) []float64
- func (s State) ConsistencyX(question []Symbol) []float64
- func (s State) Len() int
- func (s *State) SetAllX(new []float64)
- func (s *State) SetTime(t float64)
- func (s State) Time() float64
- func (s State) U(sym Symbol) float64
- func (s *State) UEqual(sym Symbol, val float64)
- func (s *State) USet(sym Symbol, val float64)
- func (s State) USymbols() []Symbol
- func (s State) UVector() []float64
- func (s State) X(sym Symbol) float64
- func (s *State) XEqual(sym Symbol, val float64)
- func (s *State) XSet(sym Symbol, val float64)
- func (s State) XSymbols() []Symbol
- func (s State) XVector() []float64
- type Symbol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs(dst State)
Abs takes absolute value of elements in X variables and stores the result in dst.
func Add ¶
func Add(dst, s State)
Add adds, element-wise the X variables of state s and dst and stores result in dst. It panics if the slice argument lengths do not match.
func AddScaled ¶
AddScaled performs dst = dst + alpha * s. It panics if the slice argument lengths do not match.
func Div ¶
func Div(dst, s State)
Div performs element-wise division dst / s and stores the value in dst. It panics if the argument lengths do not match.
func Mul ¶
func Mul(dst, s State)
Mul performs element-wise multiplication between dst and s and stores the value in dst. It panics if the argument lengths do not match.
func Norm ¶
Norm returns the L norm of state s, defined as (sum_{i=1}^N s[i]^L)^{1/L}
Special cases: L = math.Inf(1) gives the maximum absolute value. Does not correctly compute the zero norm (use Count)
Types ¶
type Diff ¶
Diff represents a single non-linear differential equation of the Simulation's system of differential equation. Specifically, it represents an X variable change.
type Input ¶
Input represents a time-varying or table look-up variable/coefficient of the Simulation's system of differential equations. Inputs can be used to model non-autonomous system of differential equations. Input functions are called after solver algorithm finishes on the resulting state.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State describes a discrete simulation configuration.
Contains X and U vectors for a step instance (i.e. point in time) Can access step variable with Time() method.
func AddScaledTo ¶
AddScaledTo performs elementwise dst = y + alpha * s, where alpha is a scalar, and dst, y and s are all slices. It panics if the slice argument lengths do not match.
func AddTo ¶
AddTo adds, element-wise, the elements of s and t and stores the result in dst. Returns dst. It panics if the slice argument lengths do not match.
func DivTo ¶
DivTo performs element-wise division s / t and stores the value in dst. Returns modified dst. It panics if the argument lengths do not match.
func MulTo ¶
MulTo performs element-wise multiplication between s and t and stores the value in dst. It panics if the argument lengths do not match.
func NewFromXMap ¶
NewFromXMap Creates state from a X var symbol to value map
func ScaleTo ¶
ScaleTo multiplies the elements in s by c and stores the result in dst. It panics if the slice argument lengths do not match.
func SubTo ¶
SubTo subtracts, element-wise, the elements of t from s and stores the result in dst. It panics if the argument lengths do not match.
func (State) CloneBlank ¶
CloneBlank creates a duplicate of state at time `t` with all X vector set to zero value
func (State) ConsistencyU ¶
ConsistencyU can be used to determine if Symbols are present in U and if a symbol is missing.
It takes a vector of Symbols and returns a vector of zero floats
If a symbol is not present in U then an IEEE 754 “not-a-number” value will correspond to it.
func (State) ConsistencyX ¶
ConsistencyX can be used to determine if Symbols are present in X and if a symbol is missing.
It takes a vector of Symbols and returns a vector of zero floats
If a symbol is not present in X then an IEEE 754 “not-a-number” value will correspond to it.
func (*State) UEqual ¶
UEqual Set a State Input (U) Symbol to a value.
If Symbol does not exist then it is created
func (*State) USet ¶
USet sets an existing State Symbol to a value.
If Symbol does not exist then USet panics
func (*State) XEqual ¶
XEqual Set a State Symbol to a value.
If Symbol does not exist then it is created
func (*State) XSet ¶
XSet set an existing State Symbol to a value
If Symbol does not exist then XSet panics