From: <par...@us...> - 2012-04-24 06:58:37
|
Revision: 10318 http://octave.svn.sourceforge.net/octave/?rev=10318&view=rev Author: paramaniac Date: 2012-04-24 06:58:30 +0000 (Tue, 24 Apr 2012) Log Message: ----------- control: draft code for James B. Rawlings Modified Paths: -------------- trunk/octave-forge/main/control/devel/lqe.m Added Paths: ----------- trunk/octave-forge/main/control/devel/dlqe.m Added: trunk/octave-forge/main/control/devel/dlqe.m =================================================================== --- trunk/octave-forge/main/control/devel/dlqe.m (rev 0) +++ trunk/octave-forge/main/control/devel/dlqe.m 2012-04-24 06:58:30 UTC (rev 10318) @@ -0,0 +1,22 @@ +function [l, p, z, e] = dlqe (a, g, c, q, r, s = []) + + if (nargin < 5 || nargin > 6) + print_usage (); + endif + + if (isempty (s)) + [~, p, e] = dlqr (a.', c.', g*q*g.', r); + 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 \ No newline at end of file Modified: trunk/octave-forge/main/control/devel/lqe.m =================================================================== --- trunk/octave-forge/main/control/devel/lqe.m 2012-04-23 20:22:00 UTC (rev 10317) +++ trunk/octave-forge/main/control/devel/lqe.m 2012-04-24 06:58:30 UTC (rev 10318) @@ -1,15 +1,19 @@ -function [g, x, l] = lqe (a, c, q, r = [], s = [], e = []) +function [l, p, e] = lqe (a, g, c, q = [], r = [], s = []) if (nargin < 3 || nargin > 6) print_usage (); endif if (isa (a, "lti")) - [g, x, l] = lqr (a.', c, q, r); # lqr (sys.', q, r, s) + [l, p, e] = lqr (a.', g, c, q); # lqe (sys.', q, r, s), g=I, works like lqr (sys.', q, r, s).' + elseif (isempty (g)) + [l, p, e] = lqr (a.', c.', q, r, s); # lqe (a, [], c, q, r, s), g=I, works like lqr (a.', c.', q, r, s).' + elseif (isempty (s)) + [l, p, e] = lqr (a.', c.', g*q*g.', r); else - [g, x, l] = lqr (a.', c.', q, r, s, e.'); + [l, p, e] = lqr (a.', c.', g*q*g.', r, g*s); endif - - g = g.' + l = l.'; + endfunction \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |