| Contents | Index |
Plot time-domain simulation of nonlinear and linear models
frest.simCompare(simout,sys,input)
frest.simCompare(simout,sys,input,x0)
[y,t] = frest.simCompare(simout,sys,input)
[y,t,x] = frest.simCompare(simout,sys,input,x0)
frest.simCompare(simout,sys,input) plots both
Simulation output, simout, of the nonlinear Simulink model
You obtain the output from the frestimate command.
Simulation output of the linear model sys for the input signal input
The linear simulation results are offset by the initial output values in the simout data.
frest.simCompare(simout,sys,input,x0) plots the frequency response simulation output and the simulation output of the linear model with initial state x0. Because you specify the initial state, the linear simulation result is not offset by the initial output values in the simout data.
[y,t] = frest.simCompare(simout,sys,input) returns the linear simulation output response y and the time vector t for the linear model sys with the input signal input. This syntax does not display a plot. The matrix y has as many rows as time samples (length(t)) and as many columns as system outputs.
[y,t,x] = frest.simCompare(simout,sys,input,x0) also returns the state trajectory x for the linear state space model sys with initial state x0.
Compare a time-domain simulation of the Simulink watertank model and its linear model representation:
% Create input signal for simulation
input = frest.createStep('FinalTime',100);
% Open the Simulink model
watertank
% Specify the operating point for the estimation
watertank_spec = operspec('watertank');
op = findop('watertank',watertank_spec)
% Specify portion of model to estimate
io(1)=linio('watertank/PID Controller',1,'in');
io(2)=linio('watertank/Water-Tank System',1,'out');
% Estimate the frequency response of the watertank model
[sysest,simout] = frestimate('watertank',op,io,input)
sys = linearize('watertank',op,io);
frest.simCompare(simout,sys,input);The software returns the following plot.


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 |