comparison scripts/control/base/dre.m @ 5016:bdbee5282954

[project @ 2004-09-22 02:50:35 by jwe]
author jwe
date Wed, 22 Sep 2004 02:50:36 +0000
parents 02c748eb2ddc
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
5015:6d481b6e349e 5016:bdbee5282954
15 ## You should have received a copy of the GNU General Public License 15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, write to the Free 16 ## along with Octave; see the file COPYING. If not, write to the Free
17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. 17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
18 18
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {[@var{tvals}, @var{plist}] =} dre (@var{sys}, @var{q}, @var{r}, @var{qf}, @var{t0}, @var{tf}, @var{ptol}, @var{maxits}); 20 ## @deftypefn {Function File} {[@var{tvals}, @var{plist}] =} dre (@var{sys}, @var{q}, @var{r}, @var{qf}, @var{t0}, @var{tf}, @var{ptol}, @var{maxits})
21 ## Solve the differential Riccati equation 21 ## Solve the differential Riccati equation
22 ## @ifinfo 22 ## @ifinfo
23 ## @example 23 ## @example
24 ## -d P/dt = A'P + P A - P B inv(R) B' P + Q 24 ## -d P/dt = A'P + P A - P B inv(R) B' P + Q
25 ## P(tf) = Qf 25 ## P(tf) = Qf
26 ## @end example 26 ## @end example
27 ## @end ifinfo 27 ## @end ifinfo
28 ## @iftex 28 ## @iftex
29 ## @tex 29 ## @tex
30 ## $$ -{dP \over dt} = A^T P+PA-PBR^{-1}B^T P+Q $$ 30 ## $$ -{dP \over dt} = A^T P+PA-PBR^{-1}B^T P+Q $$
31 ## $$ P(t_f) = Qf $$ 31 ## $$ P(t_f) = Q_f $$
32 ## @end tex 32 ## @end tex
33 ## @end iftex 33 ## @end iftex
34 ## for the LTI system sys. Solution of standard LTI 34 ## for the @acronym{LTI} system sys. Solution of
35 ## state feedback optimization 35 ## standard @acronym{LTI} state feedback optimization
36 ## @ifinfo 36 ## @ifinfo
37 ## @example 37 ## @example
38 ## min \int_@{t_0@}^@{t_f@} x' Q x + u' R u dt + x(t_f)' Qf x(t_f) 38 ## min int(t0, tf) ( x' Q x + u' R u ) dt + x(tf)' Qf x(tf)
39 ## @end example 39 ## @end example
40 ## @end ifinfo 40 ## @end ifinfo
41 ## @iftex 41 ## @iftex
42 ## @tex 42 ## @tex
43 ## $$ \min \int_{t_0}^{t_f} x^T Q x + u^T R u dt + x(t_f)^T Qf x(t_f) $$ 43 ## $$ \min \int_{t_0}^{t_f} x^T Q x + u^T R u dt + x(t_f)^T Q_f x(t_f) $$
44 ## @end tex 44 ## @end tex
45 ## @end iftex 45 ## @end iftex
46 ## optimal input is 46 ## optimal input is
47 ## @ifinfo 47 ## @ifinfo
48 ## @example 48 ## @example
75 ## @strong{Outputs} 75 ## @strong{Outputs}
76 ## @table @var 76 ## @table @var
77 ## @item tvals 77 ## @item tvals
78 ## time values at which @var{p}(@var{t}) is computed 78 ## time values at which @var{p}(@var{t}) is computed
79 ## @item plist 79 ## @item plist
80 ## list values of @var{p}(@var{t}); @var{plist} @{ @var{ii} @} 80 ## list values of @var{p}(@var{t}); @var{plist} @{ @var{i} @}
81 ## is @var{p}(@var{tvals}(@var{ii})). 81 ## is @var{p}(@var{tvals}(@var{i}))
82 ## 82 ## @end table
83 ## @item tvals 83 ## @var{tvals} is selected so that:
84 ## @iftex
85 ## @tex
86 ## $$ \Vert plist_{i} - plist_{i-1} \Vert < ptol $$
87 ## @end tex
88 ## @end iftex
89 ## @ifinfo
84 ## @example 90 ## @example
85 ## is selected so that || Plist@{ii@} - Plist@{ii-1@} || < Ptol 91 ## || Plist@{i@} - Plist@{i-1@} || < Ptol
86 ## for ii=2:length(tvals)
87 ## @end example 92 ## @end example
88 ## @end table 93 ## @end ifinfo
94 ## for every @var{i} between 2 and length(@var{tvals}).
89 ## @end deftypefn 95 ## @end deftypefn
90 96
91 function [tvals, Plist] = dre (sys, Q, R, Qf, t0, tf, Ptol, maxits) 97 function [tvals, Plist] = dre (sys, Q, R, Qf, t0, tf, Ptol, maxits)
92 98
93 if(nargin < 6 | nargin > 8 | nargout != 2) 99 if(nargin < 6 | nargin > 8 | nargout != 2)