1 function [C1,C2] = lin_ds_estimate_bound_constants(model,model_data)
2 %
function [C1,C2] = lin_ds_estimate_bound_constants(model,model_data)
4 %
function estimating the constant
5 % \verbatim @f$ C1 >= ||expm(A(mu) t)||_G
for all t @f$ \endverbatim
9 % \verbatim @f$ C2 >= |C(mu)|_G @f$ \endverbatim
11 % Bernard Haasdonk 3.4.2009
16 nmu = model.estimate_lin_ds_nmu;
17 nX = model.estimate_lin_ds_nX;
18 nt = model.estimate_lin_ds_nt;
22 X = rand(size(G,1),nX);
23 Xnorm = sqrt(sum((G*X).*X,1));
24 X = X*sparse(1:nX,1:nX,Xnorm.^(-1));
25 %Xnorm = sqrt(sum((G*X).*X,1));
26 %disp(
'check norm 1!')
29 M = rand_uniform(nmu,model.mu_ranges);
30 T = (0:nt)/nt * model.T;
32 % the following implementation with 2 loops is very bad matlab
33 % style. But I
do not yet see, how that can be vectorized easily...
38 model = model.set_mu(model,M(:,mui));
39 model.decomp_mode = 0; % complete
40 model = model.set_time(model,0);
42 A = model.A_function_ptr(model,model_data);
43 C = model.C_function_ptr(model,model_data);
47 expAtX = expm(A*T(ti+1))*X ;
48 normAtX = sqrt(sum((G*expAtX).*expAtX,1));
61 normCX = sqrt(sum((G*CX).*CX,1));
63 normCX = sqrt(CX.*CX);
76 disp([
'current C1: ',num2str(C1),
' ',...
77 'current C2: ',num2str(C2)]);
81 if (ti == 1) && (mui == 1)
82 disp([
'Estimation of constants C1 and C2 will take ',...
83 num2str(t*(nmu*(nt+1)-2)),
' seconds']);