rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
SCMonline.m
1 function alpha = SCMonline(mu, model, operator, SCM_data, opt)
2 %function alpha = SCMonline(mu, model, operator, SCM_data, opt)
3 %
4 % Online program of the successive constraint method (scm) for stability
5 % factors.
6 % Returns the fast computed stability factor.
7 %
8 % Requires a offline computation via SCM(model,params,...) first!
9 %
10 % mu: the parameter which stability factor is wanted
11 % opt (optional) = 'ub' : upperbound
12 % = 'lb' (default) : lowerbound (infsup/coercive constant)
13 %
14 % Alternative call: alpha=SCMonline(mu, model, model_data, SCM_data, opt)
15 % See SCM(model,...) for details
16 %
17 % David Kreplin 05.01.2015
18 
19 
20 % Allows the call alpha=SCMonline(mu, model, model_data, SCM_data, opt)
21 if ~isa(operator, 'function_handle')
22  operator =@ (model) model.operators(model,operator);
23 end
24 
25 % no options => lower bound
26 if nargin <= 4
27  %coercive
28  if strcmp(SCM_data.params.type,'coercive');
29  alpha = scm_coercive_lb(mu,model,operator,SCM_data);
30  end
31 
32  %infsup case
33  if strcmp(SCM_data.params.type,'infsup');
34  alpha = sqrt(scm_infsup_lb(mu,model,operator,SCM_data));
35  end
36 end
37 
38 % options => upper bound possible
39 if nargin == 5
40  %upperbound
41  if strcmp(opt,'ub');
42  %coercive
43  if strcmp(SCM_data.params.type,'coercive');
44  alpha = scm_ub(mu,model,operator,SCM_data);
45  end
46  %infsup case
47  if strcmp(SCM_data.params.type,'infsup');
48  alpha = sqrt(scm_infsup_ub(mu,model,operator,SCM_data));
49  end
50  end
51 
52  %lowerbound
53  if strcmp(opt,'lb');
54  %coercive
55  if strcmp(SCM_data.params.type,'coercive');
56  alpha = scm_coercive_lb(mu,model,operator,SCM_data);
57  end
58 
59  %infsup case
60  if strcmp(SCM_data.params.type,'infsup');
61  alpha = sqrt(scm_infsup_lb(mu,model,operator,SCM_data));
62  end
63  end
64 
65 end
66 end
67 
68 
69 % coercive case - upper boundary
70 function alpha_UB = scm_ub(mu,model,operator,SCM_data)
71 
72 model = set_mu(model,mu);
73 model.decomp_mode=2;
74 [theta_q,~] = operator(model);
75 alpha_UB=min(theta_q'*SCM_data.C.UBVector);
76 
77 end
78 
79 
80 % infsup case - upper boundary
81 function alpha_UB = scm_infsup_ub(mu,model,operator,SCM_data)
82 ind =@ (i,j,q) j + (i-1)*q - i*(i-1)/2;
83 
84 model = set_mu(model,mu);
85 model.decomp_mode=2;
86 [A,~] = operator(model);
87 factor= zeros(1,(SCM_data.params.Q)*(SCM_data.params.Q+1)/2);
88 
89 for i=1:SCM_data.params.Q
90  for j=i:SCM_data.params.Q
91  factor(ind(i,j,SCM_data.params.Q)) = (2-(i==j))*(A(i)*A(j));
92  end
93 end
94 
95 alpha_UB=min(factor*SCM_data.C.UBVector);
96 end
function alpha_LB = scm_coercive_lb(mu, model, operator, SCM_data)
alpha_LB = scm_lb(mu,model,model_data) computation of the lowerbound of the coercive constant equal t...
function alpha_LB = scm_infsup_lb(mu, model, operator, SCM_data)
alpha_LB = scm_infsup_lb(mu,model,model_data) computation of the lowerbound of the coercive constant ...
Definition: scm_infsup_lb.m:17