update_kalman
— Read an update file of a Kalman filter.
update_kalman
is obsolete and is only provided for
reasons of backward compatibility.
update_kalman( : : FileName, DimensionIn, ModelIn, MeasurementIn : DimensionOut, ModelOut, MeasurementOut)
The operator update_kalman
reads the update file
FileName
of a Kalman filter. Kalman filters return an
estimate of the current state (or even the prediction of a future state)
of a discrete, stochastically disturbed, linear system.
A Kalman filtering is based on a mathematical model of the system to be examined which at any point in time has the following characteristics:
transition matrix A, control matrix G including the controller output u and the measurement matrix C
system-error covariance matrix Q, system-error - measurement-error covariance matrix L and measurement-error covariance matrix R
y
extrapolation vector and extrapolation-error covariance matrix
Many systems do not need entries “from outside” and therefore G
and u can be dropped. Further, system errors and measurement
errors are normally not correlated (L is dropped). Some of the
characteristics mentioned above may change dynamically (from one iteration
to the next). The operator update_kalman
serves to modify
parts of the system according to an update file (ASCII) with the following
structure (see also read_kalman
):
Dimension row
+ content row
+ matrix A
+ matrix C
+ matrix Q
+ matrix G + vector u
+ matrix L
+ matrix R
The dimension row thereby has the following form:
n = <integer> m = <integer> p = <integer>
whereby n indicates the number of the state variables, m the number
of the measurement values and p the number of the controller members
(see also DimensionIn
/ DimensionOut
).
The maximal dimension will hereby be limited by a system constant
(= 30 for the time being). As in this case changes should take
effect at a valid model, the dimensions n and m are invariant
(and will only be indicated for purposes of control).
The content row has the following form:
A*C*Q*G*u*L*R*
and describes the further content of the file. Instead of
'*', '+' (= parameter is available) respectively
'-' (= parameter is missing) has to be set. In contrast to
description files for read_kalman
, the system
description needs not be complete in this case. Only those parts
of the system which are changed must be indicated. The indication
of estimated values is unnecessary, as these values must stem
from the latest filtering according to the structure of the filter.
(r x s) matrices will be stored in row-major order in the following form: (the spaces/line feed characters can be chosen at will),
vectors will be stored correspondingly in the following form:
The following parameter values of the operator read_kalman
will be changed:
DimensionIn
/ DimensionOut
:These parameters include the dimensions of the state vector, measurement vector and controller vector and therefore are vectors [n,m,p], whereby n indicates the number of the state variables, m the number of the measurement values and p the number of the controller members. n and m are invariant for a given system, i.e. they must not differ from corresponding input values of the update file. For a system without without influence “from outside” 'p' = 0.
ModelIn
/ ModelOut
:
These parameters include the lined up matrices (vectors)
A, C, Q, G, u and if necessary
L which have been stored in row-major order.
ModelIn
/ ModelOut
therefore are vectors of the
length n*n + n*m + n*n + n*p + p [+ n*m].
The last summand is dropped if system errors and measurement errors
are not correlated, i.e. no value has been set for L.
MeasurementIn
/ MeasurementOut
:These parameters include the matrix R stored in row-major order, and therefore are vectors of the dimension m*m.
FileName
(input_control) filename.read →
(string)
Update file for a Kalman filter.
Default value: 'kalman.updt'
DimensionIn
(input_control) integer-array →
(integer)
The dimensions of the state vector, measurement vector and controller vector.
Default value: [3,1,0]
Typical range of values: 0
≤
DimensionIn
≤
30
ModelIn
(input_control) real-array →
(real)
The lined up matrices A,C,Q, possibly G and u, and if necessary L which all have been stored in row-major order.
Default value: [1.0,1.0,0.5,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,54.3,37.9,48.0,37.9,34.3,42.5,48.0,42.5,43.7]
Typical range of values: 0.0
≤
ModelIn
≤
10000.0
MeasurementIn
(input_control) real-array →
(real)
The matrix R stored in row-major order.
Default value: [1,2]
Typical range of values: 0.0
≤
MeasurementIn
≤
10000.0
DimensionOut
(output_control) integer-array →
(integer)
The dimensions of the state vector, measurement vector and controller vector.
ModelOut
(output_control) real-array →
(real)
The lined up matrices A,C,Q, possibly G and u, and if necessary L which all have been stored in row-major order.
MeasurementOut
(output_control) real-array →
(real)
The matrix R stored in row-major order.
* The following values are describing the system * * DimensionIn = [3,1,0] * ModelIn = [1.0,1.0,0.5,0.0,1.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0, * 54.3,37.9,48.0,37.9,34.3,42.5,48.0,42.5,43.7] * MeasurementIn = [1,2] * * An example of the Updatefile: * * n=3 m=1 p=0 * A+C-Q-G-u-L-R- * transitions at time t=15: * 2 1 1 * 0 2 2 * 0 0 2 * * the results of update_kalman: * * DimensionOut = [3,1,0] * ModelOut = [2.0,1.0,1.0,0.0,2.0,2.0,0.0,0.0,2.0,1.0,0.0,0.0, * 54.3,37.9,48.0,37.9,34.3,42.5,48.0,42.5,43.7] * MeasurementOut = [1.2]
If the update file is readable and correct, the operator
update_kalman
returns the value TRUE.
Otherwise an exception is raised.
Foundation