diff options
Diffstat (limited to 'fitness.m')
-rw-r--r-- | fitness.m | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -25,9 +25,9 @@ function Energy = fitness( q_0, q_final, x_final, optics_positions ) d=cat(2, d, d_from_start, d_from_end);
- coef = 1e-1;
-
- penalty=coef*sum( exp(-(d/lens_size).^2) );
+ coef = 1;
+
+ penalty=coef*sum( exp(-(d/(lens_size)).^12) );
Energy = Energy + penalty;
@@ -37,11 +37,22 @@ function Energy = fitness( q_0, q_final, x_final, optics_positions ) d = cat(2, d_from_start, d_from_end);
- coef = 1e-1;
+ coef = 1e-2;
- penalty = coef * sum(1 + tanh(d.^2));
+ penalty = coef * sum(1 + tanh(10*d));
Energy = Energy + penalty;
+ % make collimated region between 2nd and 3rd lens
+ %intialize intermediate points between lenses
+ intermediate_positions = linspace(optics_positions(2), optics_positions(3),10);
+ f_q_x = @(x) gbeam_propagation(x,q_0,x0,optics_placer(optics_positions));
+ q_intermediate = arrayfun(f_q_x,intermediate_positions);
+ lambda_over_waist_sq = (-imag(1./q_intermediate)); %with numerical factor
+
+
+ coef = 1e-2;
+ penalty = coef * sum(exp((std(lambda_over_waist_sq)/mean(lambda_over_waist_sq))));
+ Energy = Energy + penalty;
end
|