rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
porsche_circle_x3ref_y3_ref_r20_get_eq_constr.m
1 function eq_constr = porsche_circle_x3ref_y3_ref_r20_get_eq_constr(model)
2 %function eq_constr = porsche_circle_get_eq_constr(model)
3 %
4 % !!! DOKU SCHREIBEN !!!
5 %
6 % Oliver Zeeb, 01.06.2011
7 
8 % n Neben-Bed: punkte aus model.mu_names auf kreis um radius r_n
9 x_ind=0;
10 y_ind=0;
11 for k=1:length(model.mu_names)
12  position_in_pmacro = str2double(model.mu_names{k}(2));
13  x_or_y = model.mu_names{k}(1);
14  if x_or_y == 'x'
15  x_ind = x_ind+1;
16  x(x_ind) = getfield(model, model.mu_names{k});
17  x_fix(x_ind) = model.pmacro(position_in_pmacro,1);
18  elseif x_or_y == 'y'
19  y_ind = y_ind+1;
20  y(y_ind) = getfield(model, model.mu_names{k});
21  y_fix(y_ind) = model.pmacro(position_in_pmacro,2);
22  else
23  error('unknown entry in model.mu_names');
24  end
25 end
26 
27 x_diff_sqr = (x-x_fix).^2;
28 y_diff_sqr = (y-y_fix).^2;
29 r_sqr = (20*ones(1,length(x_diff_sqr))).^2;
30 
31 eq_constr = x_diff_sqr + y_diff_sqr - r_sqr;
32 
33 
34