Main Content
Estimate Frequency Response Models with Noise Using System Identification Toolbox
Open the Simulink® model, and specify which portion of the model to linearize:
load_system('magball'); io(1) = linio('magball/Desired Height',1); io(2) = linio('magball/Magnetic Ball Plant',1,'output');
Compute the steady-state operating point, and linearize the model:
op = findop('magball',operspec('magball'),... findopOptions('DisplayReport','off')); sys = linearize('magball',io,op);
Create a chirp signal, and use it to estimate the frequency response:
in = frest.Chirp('FreqRange',[1 1000],... 'Ts',0.001,... 'NumSamples',1e4); [~,simout] = frestimate('magball',io,op,in);
Use System Identification Toolbox™ software to estimate a fifth-order, state-space model. Compare the results of analytical linearization and the state-space model:
input = generateTimeseries(in); output = simout{1}.Data; data = iddata(output,input.Data(:),in.Ts); sys_id = n4sid(detrend(data),5,'cov','none'); bodemag(sys,ss(sys_id('measured')),'r') legend('Linear model obtained using LINEARIZE',... 'State-space model using System Identification Toolbox',... 'Location','SouthWest')