summaryrefslogtreecommitdiff
path: root/gbeam_propagation_froward_only.m
diff options
context:
space:
mode:
authorMatt Argao <mcargao@email.wm.edu>2013-03-31 22:35:49 -0400
committerMatt Argao <mcargao@email.wm.edu>2013-03-31 22:35:49 -0400
commit4d08c162d5ce4ac8b7eaeb9d985bfef62c886e99 (patch)
tree45733367770ddc4585faa09976b403a858d5d8e5 /gbeam_propagation_froward_only.m
parent2f3d161985ae2e57ed966981e58eb117d3a49c71 (diff)
downloadmode_match-4d08c162d5ce4ac8b7eaeb9d985bfef62c886e99.tar.gz
mode_match-4d08c162d5ce4ac8b7eaeb9d985bfef62c886e99.zip
Added descriptions to each function.v3.0
Diffstat (limited to 'gbeam_propagation_froward_only.m')
-rw-r--r--gbeam_propagation_froward_only.m9
1 files changed, 6 insertions, 3 deletions
diff --git a/gbeam_propagation_froward_only.m b/gbeam_propagation_froward_only.m
index afc1316..2cdc1d8 100644
--- a/gbeam_propagation_froward_only.m
+++ b/gbeam_propagation_froward_only.m
@@ -1,4 +1,4 @@
-function q = gbeam_propagation_froward_only(x_pos, q_in, x_in, optics_elements)
+function [q] = gbeam_propagation_froward_only(x_pos, q_in, x_in, optics_elements)
% calculate the 'q' parameter of the Gaussian beam propagating through optical
% 'optics_elements' only in the positive direction along 'x' axis at points 'x_pos'
% takes the gaussian beam with initial q_in parameter at x_in
@@ -8,6 +8,10 @@ function q = gbeam_propagation_froward_only(x_pos, q_in, x_in, optics_elements)
%
% all x_pos must be to the right of x_in
% x_pos must be monotonic!
+
+ %Initialize q_lens (q at position of lens)
+ q_lens = zeros(1,size(optics_elements,2));
+
if (any(x_pos < x_in))
error('all beam positions must be to the right of the x_in');
end
@@ -45,8 +49,7 @@ function q = gbeam_propagation_froward_only(x_pos, q_in, x_in, optics_elements)
index = (x_last_calc <= x_pos);
x=x_pos(index);
q(index)= q_after_free_space(q_last_calc,x-x_last_calc);
-
-
+
end