gov.sandia.cognition.math.signals
Class LinearDynamicalSystem

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.evaluator.AbstractStatefulEvaluator<Vector,Vector,Vector>
          extended by gov.sandia.cognition.math.signals.LinearDynamicalSystem
All Implemented Interfaces:
Evaluator<Vector,Vector>, StatefulEvaluator<Vector,Vector,Vector>, VectorFunction, VectorInputEvaluator<Vector,Vector>, Vectorizable, VectorizableVectorFunction, VectorOutputEvaluator<Vector,Vector>, CloneableSerializable, Serializable, Cloneable

@PublicationReferences(references={@PublicationReference(author="Norman S. Nise",title="Control Systems Engineering, Second Edition",type=Book,year=1995,pages={648,702},notes="Chapter 12"),@PublicationReference(author="Wikipedia",title="Linear dynamical system",type=WebPage,year=2008,url="http://en.wikipedia.org/wiki/Linear_dynamical_system",notes="This Wikipedia page is simply horrible...")})
public class LinearDynamicalSystem
extends AbstractStatefulEvaluator<Vector,Vector,Vector>
implements VectorizableVectorFunction, VectorInputEvaluator<Vector,Vector>, VectorOutputEvaluator<Vector,Vector>

A generic Linear Dynamical System of the form
x_n = A*x_(n-1) + B*u_n
y_n = C*x_n,
where x_(n-1) is the previous state, x_n is the current state, u_n is the current input, y_n is the current output, A is the system matrix, B is the input-gain matrix, and C is the output-selector matrix

Since:
1.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
LinearDynamicalSystem()
          Default constructor.
LinearDynamicalSystem(int inputDimensionality, int stateDimensionality)
          Creates a new instance of LinearDynamicalSystem.
LinearDynamicalSystem(int inputDimensionality, int stateDimensionality, int outputDimensionality)
          Creates a new instance of LinearDynamicalSystem.
LinearDynamicalSystem(Matrix A, Matrix B)
          Creates a new instance of LinearDynamicalSystem
LinearDynamicalSystem(Matrix A, Matrix B, Matrix C)
          Creates a new instance of LinearDynamicalSystem
 
Method Summary
 LinearDynamicalSystem clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 void convertFromVector(Vector parameters)
          Converts the object from a Vector of parameters.
 Vector convertToVector()
          Converts the object to a vector.
 Vector createDefaultState()
          Creates a new default state object.
 Vector evaluate(Vector input)
          Evaluates the function on the given input and returns the output.
 Matrix getA()
          Getter for A.
 Matrix getB()
          Getter for B.
 Matrix getC()
          Getter for C.
 int getInputDimensionality()
          Gets the expected dimensionality of the input vector to the evaluator, if it is known.
 int getOutputDimensionality()
          Gets the expected dimensionality of the output vector of the evaluator, if it is known.
 int getStateDimensionality()
          Gets the dimensionality of the state.
 void setA(Matrix A)
          Setter for A.
 void setB(Matrix B)
          Setter for B.
 void setC(Matrix C)
          Setter for C.
 String toString()
           
 
Methods inherited from class gov.sandia.cognition.evaluator.AbstractStatefulEvaluator
evaluate, getState, resetState, setState
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearDynamicalSystem

public LinearDynamicalSystem()
Default constructor.


LinearDynamicalSystem

public LinearDynamicalSystem(int inputDimensionality,
                             int stateDimensionality)
Creates a new instance of LinearDynamicalSystem.

Parameters:
inputDimensionality - Dimensionality of the input Vectors.
stateDimensionality - Dimensionality of the state Vectors.

LinearDynamicalSystem

public LinearDynamicalSystem(int inputDimensionality,
                             int stateDimensionality,
                             int outputDimensionality)
Creates a new instance of LinearDynamicalSystem.

Parameters:
inputDimensionality - Dimensionality of the input Vectors.
stateDimensionality - Dimensionality of the state Vectors.
outputDimensionality - Dimensionality of the output Vectors.

LinearDynamicalSystem

public LinearDynamicalSystem(Matrix A,
                             Matrix B)
Creates a new instance of LinearDynamicalSystem

Parameters:
A - System (Jacobian) matrix. Must be square.
B - Input-gain matrix. Columns must equal A's rows.

LinearDynamicalSystem

public LinearDynamicalSystem(Matrix A,
                             Matrix B,
                             Matrix C)
Creates a new instance of LinearDynamicalSystem

Parameters:
A - System (Jacobian) matrix. Must be square.
B - Input-gain matrix. Columns must equal A's rows.
C - Output-selector matrix. Columns must equal A's rows.
Method Detail

clone

public LinearDynamicalSystem clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface Vectorizable
Specified by:
clone in interface VectorizableVectorFunction
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractStatefulEvaluator<Vector,Vector,Vector>
Returns:
A clone of this object.

createDefaultState

public Vector createDefaultState()
Description copied from interface: StatefulEvaluator
Creates a new default state object.

Specified by:
createDefaultState in interface StatefulEvaluator<Vector,Vector,Vector>
Returns:
A new default state object.

evaluate

public Vector evaluate(Vector input)
Description copied from interface: Evaluator
Evaluates the function on the given input and returns the output.

Specified by:
evaluate in interface Evaluator<Vector,Vector>
Specified by:
evaluate in interface StatefulEvaluator<Vector,Vector,Vector>
Parameters:
input - The input to evaluate.
Returns:
The output produced by evaluating the input.

convertToVector

public Vector convertToVector()
Description copied from interface: Vectorizable
Converts the object to a vector.

Specified by:
convertToVector in interface Vectorizable
Returns:
The Vector form of the object.

convertFromVector

public void convertFromVector(Vector parameters)
Description copied from interface: Vectorizable
Converts the object from a Vector of parameters.

Specified by:
convertFromVector in interface Vectorizable
Parameters:
parameters - The parameters to incorporate.

getInputDimensionality

public int getInputDimensionality()
Description copied from interface: VectorInputEvaluator
Gets the expected dimensionality of the input vector to the evaluator, if it is known. If it is not known, -1 is returned.

Specified by:
getInputDimensionality in interface VectorInputEvaluator<Vector,Vector>
Returns:
The expected dimensionality of the input vector to the evaluator, or -1 if it is not known.

getOutputDimensionality

public int getOutputDimensionality()
Description copied from interface: VectorOutputEvaluator
Gets the expected dimensionality of the output vector of the evaluator, if it is known. If it is not known, -1 is returned.

Specified by:
getOutputDimensionality in interface VectorOutputEvaluator<Vector,Vector>
Returns:
The expected dimensionality of the output vector of the evaluator, or -1 if it is not known.

getStateDimensionality

public int getStateDimensionality()
Gets the dimensionality of the state.

Returns:
Dimensionality of the state.

toString

public String toString()
Overrides:
toString in class Object

getA

public Matrix getA()
Getter for A.

Returns:
System (Jacobian) matrix. Must be square.

setA

public void setA(Matrix A)
Setter for A.

Parameters:
A - System (Jacobian) matrix. Must be square.

getB

public Matrix getB()
Getter for B.

Returns:
Input-gain matrix. Columns must equal A's rows.

setB

public void setB(Matrix B)
Setter for B.

Parameters:
B - Input-gain matrix. Columns must equal A's rows.

getC

public Matrix getC()
Getter for C.

Returns:
Output-selector matrix. Columns must equal A's rows.

setC

public void setC(Matrix C)
Setter for C.

Parameters:
C - Output-selector matrix. Columns must equal A's rows.