From: <par...@us...> - 2012-05-19 22:16:03
|
Revision: 10465 http://octave.svn.sourceforge.net/octave/?rev=10465&view=rev Author: paramaniac Date: 2012-05-19 22:15:57 +0000 (Sat, 19 May 2012) Log Message: ----------- control: work on docstrings 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-05-19 08:39:04 UTC (rev 10464) +++ trunk/octave-forge/main/control/devel/dlqe.m 2012-05-19 22:15:57 UTC (rev 10465) @@ -1,3 +1,77 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{sys}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{sys}, @var{q}, @var{r}, @var{s}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{s}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{[]}, @var{e}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqr (@var{a}, @var{b}, @var{q}, @var{r}, @var{s}, @var{e}) +## Linear-quadratic regulator. +## +## @strong{Inputs} +## @table @var +## @item sys +## Continuous or discrete-time LTI model. +## @item a +## State transition matrix of continuous-time system. +## @item b +## Input matrix of continuous-time system. +## @item q +## State weighting matrix. +## @item r +## Input weighting matrix. +## @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. +## @end table +## +## @strong{Outputs} +## @table @var +## @item g +## State feedback matrix. +## @item x +## Unique stabilizing solution of the continuous-time Riccati equation. +## @item l +## Closed-loop poles. +## @end table +## +## @strong{Equations} +## @example +## @group +## . +## x = A x + B u, x(0) = x0 +## +## inf +## J(x0) = INT (x' Q x + u' R u + 2 x' S u) dt +## 0 +## +## L = eig (A - B*G) +## @end group +## @end example +## @seealso{care, dare, dlqr} +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: April 2012 +## Version: 0.1 + function [l, p, z, e] = dlqe (a, g, c, q, r, s = []) if (nargin < 5 || nargin > 6) @@ -19,4 +93,4 @@ ## z = p - p*c.' / (c*p*c.' + r) * c*p; z = p - l*c*p; -endfunction \ No newline at end of file +endfunction Modified: trunk/octave-forge/main/control/devel/lqe.m =================================================================== --- trunk/octave-forge/main/control/devel/lqe.m 2012-05-19 08:39:04 UTC (rev 10464) +++ trunk/octave-forge/main/control/devel/lqe.m 2012-05-19 22:15:57 UTC (rev 10465) @@ -1,3 +1,77 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {[@var{g}, @var{x}, @var{l}] =} lqe (@var{sys}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqe (@var{sys}, @var{q}, @var{r}, @var{s}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqe (@var{a}, @var{g}, @var{c}, @var{q}, @var{r}, @var{s}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}) +## @deftypefnx {Function File} {[@var{g}, @var{x}, @var{l}] =} lqe (@var{a}, @var{[]}, @var{c}, @var{q}, @var{r}, @var{s}) +## Linear-quadratic estimator. +## +## @strong{Inputs} +## @table @var +## @item sys +## Continuous or discrete-time LTI model. +## @item a +## State transition matrix of continuous-time system. +## @item b +## Input matrix of continuous-time system. +## @item q +## State weighting matrix. +## @item r +## Input weighting matrix. +## @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. +## @end table +## +## @strong{Outputs} +## @table @var +## @item l +## Observer gain matrix. +## @item p +## Unique stabilizing solution of the continuous-time Riccati equation. +## @item e +## Closed-loop poles. +## @end table +## +## @strong{Equations} +## @example +## @group +## . +## x = A x + B u, x(0) = x0 +## +## inf +## J(x0) = INT (x' Q x + u' R u + 2 x' S u) dt +## 0 +## +## L = eig (A - B*G) +## @end group +## @end example +## @seealso{care, dare, dlqr} +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: April 2012 +## Version: 0.1 + function [l, p, e] = lqe (a, g, c, q = [], r = [], s = []) if (nargin < 3 || nargin > 6) @@ -16,4 +90,4 @@ l = l.'; -endfunction \ No newline at end of file +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |