rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
porsche_circle_x3opt_y3opt_r20_get_eq_constr.m
1 function eq_constr = porsche_circle_x3opt_y3opt_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 R=20;
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  x_fix(x_ind) = model.mittelpunkt(1);
19  elseif x_or_y == 'y'
20  y_ind = y_ind+1;
21  y(y_ind) = getfield(model, model.mu_names{k});
22  %y_fix(y_ind) = model.pmacro(position_in_pmacro,2);
23  y_fix(y_ind) = model.mittelpunkt(2);
24  else
25  error('unknown entry in model.mu_names');
26  end
27 end
28 
29 x_diff_sqr = (x-x_fix).^2;
30 y_diff_sqr = (y-y_fix).^2;
31 r_sqr = (R*ones(1,length(x_diff_sqr))).^2;
32 
33 eq_constr = x_diff_sqr + y_diff_sqr - r_sqr;
34 
35 
36