From: <par...@us...> - 2012-06-21 07:08:39
|
Revision: 10648 http://octave.svn.sourceforge.net/octave/?rev=10648&view=rev Author: paramaniac Date: 2012-06-21 07:08:29 +0000 (Thu, 21 Jun 2012) Log Message: ----------- control: apply changes by Megan Zagrobelny Modified Paths: -------------- trunk/octave-forge/main/control/devel/dlqe.m trunk/octave-forge/main/control/devel/lqe.m Modified: trunk/octave-forge/main/control/devel/dlqe.m =================================================================== --- trunk/octave-forge/main/control/devel/dlqe.m 2012-06-20 21:48:29 UTC (rev 10647) +++ trunk/octave-forge/main/control/devel/dlqe.m 2012-06-21 07:08:29 UTC (rev 10648) @@ -23,6 +23,14 @@ ## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{z}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}, @var{s}) ## Kalman filter for discrete-time systems. ## +## @example +## @group +## x[k] = Ax[k] + Bu[k] + Gw[k] (State equation) +## y[k] = Cx[k] + Du[k] + v[k] (Measurement Equation) +## E(w) = 0, E(v) = 0, cov(w) = Q, cov(v) = R, cov(w,v) = S +## @end group +## @end example +## ## @strong{Inputs} ## @table @var ## @item sys @@ -30,15 +38,15 @@ ## @item a ## State transition matrix of discrete-time system (n-by-n). ## @item g -## Process noise matrix of discrete-time system (n-by-.). +## Process noise matrix of discrete-time system (n-by-g). ## @item c ## Measurement matrix of discrete-time system (p-by-n). ## @item q -## Process noise covariance matrix (.-by-.). +## Process noise covariance matrix (g-by-g). ## @item r ## Measurement noise covariance matrix (p-by-p). ## @item s -## Optional cross term covariance matrix (n-by-p), s = cov(w,v) If @var{s} is not specified, a zero matrix is assumed. +## Optional cross term covariance matrix (g-by-p), s = cov(w,v) If @var{s} is not specified, a zero matrix is assumed. ## @end table ## ## @strong{Outputs} @@ -89,14 +97,9 @@ else [~, p, e] = dlqr (a.', c.', g*q*g.', r, g*s); endif - - ## k computed by dlqr would be - ## k = (r + c*p*c.') \ (c*p*a.' + s.') - ## such that l = a \ k.' - ## what about the s term? l = p*c.' / (c*p*c.' + r); - ## z = p - p*c.' / (c*p*c.' + r) * c*p; + z = p - l*c*p; endfunction Modified: trunk/octave-forge/main/control/devel/lqe.m =================================================================== --- trunk/octave-forge/main/control/devel/lqe.m 2012-06-20 21:48:29 UTC (rev 10647) +++ trunk/octave-forge/main/control/devel/lqe.m 2012-06-21 07:08:29 UTC (rev 10648) @@ -1,4 +1,5 @@ ## Copyright (C) 2012 Lukas F. Reichlin +## Copyright (C) 2012 Megan Zagrobelny ## ## This file is part of LTI Syncope. ## @@ -22,50 +23,56 @@ ## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}, @var{s}) ## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}) ## @deftypefnx {Function File} {[@var{l}, @var{p}, @var{e}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}, @var{s}) -## Linear-quadratic estimator. +## Kalman filter for continuous-time systems. ## +## @example +## @group +## . +## x = Ax + Bu + Gw (State equation) +## y = Cx + Du + v (Measurement Equation) +## E(w) = 0, E(v) = 0, cov(w) = Q, cov(v) = R, cov(w,v) = S +## @end group +## @end example +## ## @strong{Inputs} ## @table @var ## @item sys -## Continuous or discrete-time LTI model. +## Continuous or discrete-time LTI model (p-by-m, n states). ## @item a -## State transition matrix of continuous-time system. -## @item b -## Input matrix of continuous-time system. +## State transition matrix of continuous-time system (n-by-n). +## @item g +## Process noise matrix of continuous-time system (n-by-g). +## @item c +## Measurement matrix of continuous-time system (p-by-n). ## @item q -## State weighting matrix. +## Process noise covariance matrix (g-by-g). ## @item r -## Input weighting matrix. +## Measurement noise covariance matrix (p-by-p). ## @item s -## Optional cross term matrix. If @var{s} is not specified, a zero matrix is assumed. -## @item e -## Optional descriptor matrix. If @var{e} is not specified, an identity matrix is assumed. +## Optional cross term covariance matrix (g-by-p), s = cov(w,v) If @var{s} is not specified, a zero matrix is assumed. ## @end table ## ## @strong{Outputs} ## @table @var ## @item l -## Observer gain matrix. +## Kalman filter gain matrix (n-by-p). ## @item p -## Unique stabilizing solution of the continuous-time Riccati equation. +## Unique stabilizing solution of the continuous-time Riccati equation (n-by-n). ## @item e -## Closed-loop poles. +## Closed-loop poles (n-by-1). ## @end table ## ## @strong{Equations} ## @example ## @group ## . -## x = A x + B u, x(0) = x0 +## x = Ax + Bu + L(y - Cx -Du) ## -## inf -## J(x0) = INT (x' Q x + u' R u + 2 x' S u) dt -## 0 -## -## L = eig (A - B*G) +## E = eig(A - L*C) +## ## @end group ## @end example -## @seealso{lqr, care, dare, dlqe} +## @seealso{dare, care, dlqr, lqr, dlqe} ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |