From e75e6f968d620fde5d5596092e6c6b0f2cc4aa94 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Wed, 13 Apr 2011 11:10:28 -0400 Subject: beam propagation function renamed and moved to separate files Ignore-this: 972fa9dce2f57e8ddb1624bab32be1ed darcs-hash:20110413151028-067c0-a7e6d0c98e2856fdff930d4bf3216056eb937367 --- gbeam_propagation.m | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 gbeam_propagation.m (limited to 'gbeam_propagation.m') diff --git a/gbeam_propagation.m b/gbeam_propagation.m new file mode 100644 index 0000000..524d4ae --- /dev/null +++ b/gbeam_propagation.m @@ -0,0 +1,41 @@ +function q = gbeam_propagation(x_pos, q_in, x_in, optics_elements) +% calculate the 'q' parameter of the Gaussian beam propagating through optical +% 'optics_elements' array along 'x' axis at points 'x_pos' +% takes the gaussian beam with initial q_in parameter at x_in +% x_pos must be monotonic! + + q=0*x_pos; % q vector initialization + + if any(x_pos >= x_in) + % Forward propagation to the right of x_in + q(x_pos >= x_in) = gbeam_propagation_froward_only(x_pos(x_pos>=x_in), q_in, x_in, optics_elements); + end + + if any(x_pos < x_in) + % Backward propagation part the left of x_in + % do it as forward propagation of the reverse beam + x_backw=x_pos(x_pos