| Contents | Index |
compare(data,sys)
compare(data,sys,prediction_horizon)
compare(data,sys,style,prediction_horizon)
compare(data,sys1,...,sysN,style,prediction_horizon)
compare(data,sys1,style1,...,sysN,styleN,prediction_horizon)
compare(data,sys1,...,___,opt)
[y,fit,x0]
= compare(data,___)
compare(data,sys) plots the simulated response of a dynamic system model, sys, superimposed over validation data, data, for comparison. The plot also displays the normalized root mean square (NRMSE) measure of the goodness of the fit.
compare(data,sys,prediction_horizon) compares the predicted response of sys to the measured response in data. Measured output values in data up to time t-prediction_horizon are used to predict the output of sys at time t.
The matching of the input/output channels in data and sys is based on the channel names. So, it is possible to evaluate models that do not use all the input channels that are available in data.
compare(data,sys,style,prediction_horizon) allows specification of the line style, color, or marker for the plot.
compare(data,sys1,...,sysN,style,prediction_horizon) compares multiple dynamic systems responses in a single figure.
compare(data,sys1,style1,...,sysN,styleN,prediction_horizon) compares systems responses using the color, linestyle, and markers specified by the style strings.
compare(data,sys1,...,___,opt) configures the comparison using an option set, opt.
[y,fit,x0] = compare(data,___) returns the model response, y, goodness of fit value, fit, and the initial states, x0. No plot is generated.
data |
Validation data. Specify data as either an iddata or idfrd object. If sys is an iddata object, then data must be an iddata object with matching domain, number of experiments and time or frequency vectors. If sys is a frequency response model (idfrd or frd), then data must be a frequency response model too. data can represent either time- or frequency domain data when comparing with linear models. data must be time-domain data when comparing with a nonlinear model. For frequency domain data, the real and imaginary parts of the corresponding frequency functions are shown in separate axes. When data is an FRD model, the frequency responses of data and sys are plotted. |
sys |
Dynamic system model or data object. Specify sys as either a dynamic system model or an iddata object. When the time or frequency units of data do not match those of sys, sys is rescaled to match the units of data. |
prediction_horizon |
Prediction horizon. Specify prediction_horizon as Inf to obtain a pure simulation of the system. prediction_horizon is ignored when sys is an iddata object, an FRD model or a dynamic system with no noise component. prediction_horizon is also ignored when using frequency response validation data. For time-series models, use a finite value for prediction_horizon. Default: Inf |
style |
Line style, marker, and color of both the linear and marker, specified as a one-, two-, or three-part string enclosed in single quotes (' '). The elements of the string can appear in any order. The string can specify only the line style, the marker, or the color. For more information about configuring the style string, see Colors, Line Styles, and Markers in the MATLAB documentation. |
opt |
Comparison option set. opt is an option set that specifies, among other options, the following:
Use compareOptions to create the option set. |
Compare the output of an estimated state-space model to measured data.
Estimate a state-space model for measured data.
load iddata1 z1; sys = ssest(z1,3)
sys, an idss model, is a continuous-time state-space model.
Compare the 10 step ahead predicted output to the measured output.
prediction_horizon = 10; compare(z1,sys,prediction_horizon);

Compare the outputs of an estimated process model, and an estimated Output-Error polynomial model to measured data.
Estimate a process model and an Output-Error polynomial for frequency response data.
load demofr % frequency response data zfr = AMP.*exp(1i*PHA*pi/180); Ts = 0.1; data = idfrd(zfr,W,Ts); sys1 = procest(data,'P2UDZ'); sys2 = oe(data,[2 2 1]);
sys1, an idproc model, is a continuous-time process model. sys2, an idpoly model, is a discrete-time Output-Error model.
Compare the frequency response of the estimated models to data.
compare(data,sys1,'g',sys2,'r');

Compare an estimated model to measured data and specify that the initial conditions be estimated such that the prediction error of the observed output is minimized.
Estimate a transfer function for measured data.
load iddata1 z1; sys = tfest(z1,3)
sys, an idtf model, is a continuous-time transfer function model.
Create an option set to specify the initial condition handling.
opt = compareOptions('InitialCondition','e');
Compare the estimated transfer function model's output to the measured data using the comparison option set.
compare(z1,sys,opt);

bode | chgFreqUnit | chgTimeUnit | compareOptions | forecast | goodnessOfFit | interp | predict | resid | sim

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |