B = fitfrd(A,N,RD)
forces the relative degree of B to RD. The
relative degree of B is the difference between the number of poles and
the number of zeros of B.
B = fitfrd(A,N,RD,WT)
uses the magnitude of WT to weight the optimization fit criteria
A-B. Use WT to give greater weight to matching the
responses of B and A at certain frequencies.
You can try to fit the frequency response D-scale data sysg with a first-order system, b1. Similarly, you can fit the D-scale data with a third-order system, b3.
b1 = fitfrd(sysg,1);
b3 = fitfrd(sysg,3);
Compare the original D-scale data sysg with the frequency responses of the first and third-order models calculated by fitfrd.
b1g = frd(b1,omeg);
b3g = frd(b3,omeg);
bode(sysg,'r-',b1g,'k:',b3g,'b-.')
legend('5th order system','1st order fit','3rd order fit','Location','Southwest')
Frequency response data, specified as an frd model.
A must be SISO, have a single input with multiple outputs, or
have multiple outputs with a single input.
N — Order nonnegative integer
Order of output model B, specified as a nonnegative integer.
Numerical conditioning problems arise if the specified N is higher
than required by the dynamics of A.
Relative degree, specified as a nonnegative integer or vector. The default value for
RD is 0. If A has M inputs, then
RD can be a vector of the same size, specifying the relative degree
of each channel of B. If RD is a scalar, then it
specifies the relative degree for all entries of B. You can specify
the default value for RD by setting RD to an empty
matrix.
WT — Weight 1 (default) | double | ss model | frd model
Weight, specified as an array, ss model, orfrd
model. If WT is a scalar, then it is used to weight all entries of
the error criteria (A-B). If WT is a vector, it
must be the same size as A, and each individual entry of
WT acts as a weighting function on the corresponding entry of
(A-B).
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.