% Measures the  minimum execution time of numerical redundant Taylor 
% expansion of integrator + loudspeaker A

%   CBVK Toolbox
%   JHMG, PMSB 2016


clear

P=4;       % Expansion order
rep=30;    % Number of repetitions for greater precision of execution
           % time measurement

arq='mtaylor_num_Aitgr_P4';  % Output file

% --------------------------------------------------------------------

% Numerical model
[f,g,h,x]=dloudAitgr_num;      % Regenerate model to be sure

x0=zeros(1,length(f));

dt=zeros(1,rep);
warning('off','cbvk:mtred');

for r=1:rep
tic
F1 = mtred(f,x,x0,P);
G1 = mtred(g,x,x0,P-1);
dt(r)=toc;
fprintf('%g\n ', dt(r));
end

min(dt)

%save(arq,'dt');
warning('on','cbvk:mtred');




