Focusing of spherical Gaussian beams using a thin lenses (Based on Self's paper, Applied Optics, Vol. 22, Issue 5, pp. 658-661 (1983), http://www.opticsinfobase.org/ao/abstract.cfm?id=26503 )
lambda - beam's wavelength
beam_waist - waist of the beam at the waist position (wp)
wp - waist position
fpos - lenses positions vector [pos1, pos2, pos3 ...]
f - lenses focal-lengths vector [f1, f2, f3 ...]
Gaussian_Propagation(8e-7,0.00075,-0.1,[0 0.1],[-0.5 0.2])
Continue the beam propagation up to the beam waist if it happens to be much after the last lens position (thanks Graham). Added the option to print waist positions and sizes on the figure.
Create scripts with code, output, and formatted text in a single executable document.