# pst-optexp: Trouble in drawing collimated beam

I want to draw a Z-Scan experimental setup. My lab's DPSS Laser has a beam radius of some value, and I change this value by using a simple telescope. It was supposed to be easy to draw this using pst-optexp package. Problem is I can't find the correct focal lengths to collimate the beam again. Here's an example of what I'm saying:

As one can easily see, the beam is not exactly leaving the last lens perfectly collimated. It's still diverging a little bit, like I'm making some mistake in positioning the lenses. Problem is I've set them to have lensradius=1 and lensradius=2, and it doesn't seem that in this case the focal length is exactly 1. It seems to be a little offset, a little longer than 1.

If someone could help me with a solution to draw collimated beams, I would appreciate.

My code to generate the image was written as follows (sorry for the mess):

\documentclass[]{revtex4}

\usepackage{pst-optexp}
\usepackage{pst-node}

\begin{document}

\begin{pspicture}

\pnodes(1,1){S}(0,3){A}(11,5){BS}(13,1){M1}(13,5){M2}(1,1){S}
\pnodes(4,1){L1}(7,1){L2}(1,5){D1}(11,7){D2}(3,1){P}(10,5){L3}
\psset{mirrortype=extended, mirrordepth=0.2}

\begin{optexp}
\optsource[innerlabel](S)(P){DPSS}
\polarization[poltype=parallel] (S)(P)
\mirror[compname=M1](S)(M1)(M2)
\mirror[compname=M2](M1)(M2)(BS)
\optdetector[compname=Det1](BS)(D1)
\drawwidebeam[beamwidth=0.4,fillstyle=solid,fillcolor=green!20!white]
(S){L1}{L2}{M1}{M2}{Det1}
\end{optexp}

\end{pspicture}

\end{document}

• try (7.1,1){L2} – user2478 May 18 '16 at 20:15
• It looks like it works, but the beam still isn't quite collimated. This solution should be decent enough if I can't find a proper way to set the beam accurately collimated. – a-sf-d May 18 '16 at 20:32

In general you have different options to adjust the beam path in such a situation: fine tune the position of the second lens, or its refractive index. Or you can define the beam path piecewise, see the telescope example in chapter 9.5 of the documentation.

\documentclass[]{revtex4}

\usepackage{pst-optexp}
\usepackage{pst-node}

\begin{document}

\begin{pspicture}
\pnodes(1,1){S}(0,3){A}(11,5){BS}(13,1){M1}(13,5){M2}(1,1){S}
\pnodes(4,1){L1}(7,1){L2}(1,5){D1}(11,7){D2}(3,1){P}(10,5){L3}
\psset{mirrortype=extended, mirrordepth=0.2}
\begin{optexp}
\optsource[innerlabel](S)(P){DPSS}
\polarization[poltype=parallel] (S)(P)
\mirror[compname=M1](S)(M1)(M2)
\mirror[compname=M2](M1)(M2)(BS)
\optdetector[compname=Det1](BS)(D1)
\drawwidebeam[beamwidth=0.4, beaminsidelast](S){L1}{L2}

That traces a first beam until the last interface of L2. The end position is saved internally, because savebeampoints is true by default. Now, the second beam can load the end points of the first beam with loadbeampoints, but now the beam divergence is zero and you have a perfectly collimated beam.
• Please use the option useNA=true when debugging. That shows rays also when they miss a given target (that was at least my problem when I added a lens midway between last mirror and detector) – Christoph May 23 '16 at 18:54