function [ w, w_pos ] = self_gbeam_propagation( w0, x_lens, f, x0, lambda ) %Beam propagation based on Sidney A. Self's "Focusing of spherical Gaussian %beams". Applied Optics, Vol. 22, Issue 5, pp. 658-661 (1983) n_lens = 3; w = w0; %Initial waist w_pos = x0; %Initial waist position for i = 1:n_lens x_from_next_lens = x_lens(i) - w_pos(i); [w_new, s_new] = gaussian_focus(w(i), x_from_next_lens, f(i), lambda); w(i+1) = w_new; w_pos(i+1) = x_lens(i) + s_new; end end