Graphics, Figures & TablesTransverse Intensity Profile of a Laser Beam

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
thinkpadT
Posts: 25
Joined: Wed Sep 26, 2012 5:46 pm

Transverse Intensity Profile of a Laser Beam

Post by thinkpadT »

Hi everybody,

I'm curious, if there is a way to realize a laser beam profile and its Gauss fit in the manner sketched in the uploaded files.

Thanks in advance
Attachments
image3.png
image3.png (16.86 KiB) Viewed 8257 times
traverse-int.JPG
traverse-int.JPG (2.79 KiB) Viewed 8257 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Transverse Intensity Profile of a Laser Beam

Post by localghost »

The simplest solution I can think of is one with TikZ/PGF. It could look like this. The output is attached.

Code: Select all

\documentclass[11pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz}

\begin{document}
  \begin{tikzpicture}[
    scale=3,
    samples=50,
    declare function={mu=2;},
    declare function={sigma=0.3;},
    declare function={normal(\m,\s)=1/(2*\s*sqrt(pi))*exp(-(\x-\m)^2/(2*\s^2));}
  ]
    \path[inner color=red] (1,1) rectangle (3,3);
    \draw plot[domain=1:3] (\x,{normal(mu,sigma)});
    \draw[rotate=90]  plot[domain=1:3] (\x,{-normal(mu,sigma)});
  \end{tikzpicture}
\end{document}
There is probably a more complicated solution (3D, color gradients, …). But this should be a good starting point.


Thorsten
Attachments
ytmp.png
ytmp.png (8.22 KiB) Viewed 8242 times
thinkpadT
Posts: 25
Joined: Wed Sep 26, 2012 5:46 pm

Re: Transverse Intensity Profile of a Laser Beam

Post by thinkpadT »

@localghost
this looks really fantastic, thanks.

i have missed to say that i have the gaussian beam image done with a camera. i wanted to fit or put the bell-curve alongsides the image taken with the camera.

regards
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Transverse Intensity Profile of a Laser Beam

Post by localghost »

thinkpadT wrote:[…] i have missed to say that i have the gaussian beam image done with a camera. i wanted to fit or put the bell-curve alongsides the image taken with the camera. […]
If it's not a secret, you could attach that picture (perhaps with reduced resolution) to your next post. And perhaps you could describe how this fit should look as well as where and how it should be placed.
thinkpadT
Posts: 25
Joined: Wed Sep 26, 2012 5:46 pm

Re: Transverse Intensity Profile of a Laser Beam

Post by thinkpadT »

@localghost

hi,

the picture is indeed not a secret, and it is attached in my first post (the black and white picture "traverse-int.JPG") and the fits i wanted is drawn with MS paint and they are supposed to be Gaussian and they should be placed in positions showed in that picture.

Now i have the picture and the fit done separately. I wanted to placed them like in the picture. That would be one way i would like to have them

But if there was a way to use Latex, TikZ or pgf plot and do that in one code would be also a great thing.


regards
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Transverse Intensity Profile of a Laser Beam

Post by localghost »

thinkpadT wrote:[…] the picture is indeed not a secret, and it is attached in my first post (the black and white picture "traverse-int.JPG") and the fits i wanted is drawn with MS paint and they are supposed to be Gaussian and they should be placed in positions showed in that picture. […]
That was not clear to me from your first post. The solution is still with TikZ/PGF. I have cut the picture to the relevant content and attached it to this post a well as the resulting output from the below code.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz} 

\pgfdeclareimage[height=4cm]{beam}{transverse-intensity}

\begin{document}
  \begin{tikzpicture}[
    scale=2,
    samples=50,
    declare function={mu=1;},
    declare function={sigma=0.3;},
    declare function={normal(\m,\s)=1/(2*\s*sqrt(pi))*exp(-(\x-\m)^2/(2*\s^2));}
  ]
    \node at (1,1) {\pgfuseimage{beam}};
    \draw plot[domain=0:2] (\x,{-normal(mu,sigma)});
    \draw plot[domain=0:2,rotate around={90:(1,1)}] (\x,{-normal(mu,sigma)});
  \end{tikzpicture}
\end{document}
Attachments
The resulting output.
The resulting output.
ytmp.png (4.68 KiB) Viewed 8188 times
The used graphics file.
The used graphics file.
transverse-intensity.png (2.11 KiB) Viewed 8188 times
thinkpadT
Posts: 25
Joined: Wed Sep 26, 2012 5:46 pm

Re: Transverse Intensity Profile of a Laser Beam

Post by thinkpadT »

@localghost
thanks, that looks very nice. that's exactly what i need.
using your code i get the gaussian profiles but not the image( :? doing something wrong): . An additional question: is there a possibilty to put axis boxes with some number around the image, for example as drawn in the image in red.

regards
Attachments
result.PNG
result.PNG (30.83 KiB) Viewed 8170 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Transverse Intensity Profile of a Laser Beam

Post by Johannes_B »

It is possible to get a frame around the function, but I don't want to mess with Thorstens code right now.
Concerning the image: Can you please provide us with more information, is there any error message?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Transverse Intensity Profile of a Laser Beam

Post by localghost »

thinkpadT wrote:[…] using your code i get the gaussian profiles but not the image( :? doing something wrong): […]
See Johannes' remarks. The exact code in form of a minimal example would be helpful (if it differs from my code sample). The code works for me. Hence there must be something that prevents its functionality on your machine.
thinkpadT wrote:[…] An additional question: is there a possibilty to put axis boxes with some number around the image, for example as drawn in the image in red. […]
Why do you come only bit by bit which such important information? We could have done this in one go right at the beginning. This will require a completely new approach. And there's another problem: It is weekend and very nice weather here. So don't expect a solution before Monday (from me).
Post Reply