Function: PLOT_RESPurpose. Computes and plots (bar diagrams) residuals. Synopsis. [pol,res] = plot_res(sys,iu,iy[,time[,npol[,fsize[,color]]]]) Description. The residuals are considered between the iuth input(s) and the iyth output(s) (note that iu and iy can be vectors). If the input argument time is equal to 0, standard residuals are considered. If time > 0, residuals are replaced by the unit step response value at the given time (which can be time = inf). Note that iu and iy can be vectors. For computing the global residuals of a system with m inputs and p outputs set iu = [1:m] and iy = [1:p]. (Note that in order to use this function for sub-plots the figure is not initialized.) If this function is invoked with output arguments, the bars are not plotted. Input arguments
Output arguments
Example. Comparison of information obtained by using lsim_mod and plot_res. Computation of the true residuals (the 8 most significant ones) and comparison to impulse response obtained by modal simulation.
randn('seed',0); rand('seed',0);
sys = rss(20,3,3);
figure
plot_res(sys,2,3,0,8);
The true residuals are given in the following figure ![]() Modal simulation u = zeros(100,3); t = 0.01*[0:1:99]'; x0 = zeros(20,1); u(1,2)=100; lsim_mod(sys,u,t,x0,'y3',8,[1,2,1],[1,2,2]);The magnitude of the bars corresponds to initial values of modal simulations. Note that the measure of pole ``dominance'' is not exactly the same using plot_res and lsim_mod which explains the different ordering in both figures. ![]() Now, let us consider a similar comparison concerning steady state values of a step response. figure plot_res(sys,2,3,inf,8); lsim_mod(sys,'u2',60,0,'y3',8,[1,2,1],[1,2,2]);The bars (not plotted here) correspond to the final values of the simulation. |