Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Control Design   

frest.simCompare - Package: frest

Plot time-domain simulation of nonlinear and linear models

Syntax

frest.simCompare(simout,sys,input)
frest.simCompare(simout,sys,input,x0)

Description

frest.simCompare(simout,sys,input) plots both

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.

Examples

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 magball model
[sysest,simout] = frestimate('watertank',op,io,input)
sys = linearize('watertank',op,io)
frest.simCompare(simout,sys,input)

The software returns the following plot.

See Also

frest.simView | frestimate

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS