From: <par...@us...> - 2011-10-19 18:33:09
|
Revision: 8793 http://octave.svn.sourceforge.net/octave/?rev=8793&view=rev Author: paramaniac Date: 2011-10-19 18:33:03 +0000 (Wed, 19 Oct 2011) Log Message: ----------- control-devel: touch up fitfrd Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/fitfrd.m trunk/octave-forge/extra/control-devel/src/Makefile Modified: trunk/octave-forge/extra/control-devel/inst/fitfrd.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/fitfrd.m 2011-10-19 18:16:26 UTC (rev 8792) +++ trunk/octave-forge/extra/control-devel/inst/fitfrd.m 2011-10-19 18:33:03 UTC (rev 8793) @@ -17,45 +17,29 @@ ## -*- texinfo -*- ## @deftypefn{Function File} {[@var{sys}, @var{n}] =} fitfrd (@var{dat}, @var{n}) +## @deftypefnx{Function File} {[@var{sys}, @var{n}] =} fitfrd (@var{dat}, @var{n}, @var{flag}) ## Fit frequency response data with a stable, minimum-phase state-space system. ## ## @strong{Inputs} ## @table @var -## @item G -## LTI model of plant. -## @item W1 -## LTI model of precompensator. Model must be SISO or of appropriate size. -## An identity matrix is taken if @var{W1} is not specified or if an empty model -## @code{[]} is passed. -## @item W2 -## LTI model of postcompensator. Model must be SISO or of appropriate size. -## An identity matrix is taken if @var{W2} is not specified or if an empty model -## @code{[]} is passed. -## @item factor -## @code{factor = 1} implies that an optimal controller is required. -## @code{factor > 1} implies that a suboptimal controller is required, -## achieving a performance that is @var{factor} times less than optimal. -## Default value is 1. +## @item dat +## LTI model containing frequency response data of a SISO system. +## @item n +## The desired order of the system to be fitted. @code{n <= length(dat.w)}. +## @item flag = 0 +## The system zeros and poles are not constrained. Default value +## @item flag = 1 +## The system zeros and poles will have negative real parts in the +## continuous-time case, or moduli less than 1 in the discrete-time case. ## @end table ## ## @strong{Outputs} ## @table @var -## @item K +## @item sys ## State-space model of the H-infinity loop-shaping controller. -## @item N -## State-space model of the closed loop depicted below. -## @item gamma -## L-infinity norm of @var{N}. -## @item info -## Structure containing additional information. -## @item info.emax -## Nugap robustness. @code{emax = inv (gamma)}. -## @item info.Gs -## Shaped plant. @code{Gs = W2 * G * W1}. -## @item info.Ks -## Controller for shaped plant. @code{Ks = ncfsyn (Gs)}. -## @item info.rcond -## Estimates of the reciprocal condition numbers of the Riccati equations. +## @item n +## The order of the obtained system. The value of @var{n} +## could only be modified if inputs @code{n > 0} and @code{flag = 1}. ## @end table ## ## @strong{Algorithm}@* @@ -84,8 +68,12 @@ [H, w, tsam] = frdata (dat, "vector"); dt = isdt (dat); - [a, b, c, d, n] = slsb10yd (real (H), imag (H), w, n, dt, flag); + if (n > length (w)) + error ("fitfrd: require n <= length (dat.w)"); + endif + [a, b, c, d, n] = slsb10yd (real (H), imag (H), w, n, dt, logical (flag)); + sys = ss (a, b, c, d, tsam); endfunction \ No newline at end of file Modified: trunk/octave-forge/extra/control-devel/src/Makefile =================================================================== --- trunk/octave-forge/extra/control-devel/src/Makefile 2011-10-19 18:16:26 UTC (rev 8792) +++ trunk/octave-forge/extra/control-devel/src/Makefile 2011-10-19 18:33:03 UTC (rev 8793) @@ -1,4 +1,4 @@ -all: slab09jd.oct +all: slab09jd.oct slsb10yd.oct # TODO: leading and trailing underscores for sl* functions # (__sl*__.oct) would be nice, but this can be an issue @@ -16,5 +16,13 @@ MB04ND.f MB04OD.f SB03OR.f SB03OY.f MB04NY.f \ MB04OY.f SB03OV.f +# fit state-space model to frequency response data +slsb10yd.oct: slsb10yd.cc + mkoctfile slsb10yd.cc \ + SB10YD.f DG01MD.f AB04MD.f SB10ZP.f AB07ND.f \ + MC01PD.f TD04AD.f TD03AY.f TB01PD.f TB01XD.f \ + AB07MD.f TB01UD.f TB01ID.f MB01PD.f MB03OY.f \ + MB01QD.f + clean: rm *.o core octave-core *.oct *~ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |