{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# OSLO and the Single Lens, Part 1\n", "\n", "**Scott Prahl**\n", "\n", "**Nov 2019, Version 3**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Overview\n", "\n", "This is the first part of a tutorial that covers the fundamental ideas of most ray tracing programs and OSLO in particular. Ast the end you should be ready to enter most of the lens data into the `Surface Data` spreadsheet. \n", "\n", "* The [FAQ](https://omlc.org/classroom/oslotut/faq.html) may give you a hint or two that will make the OSLO experience a bit less horrible.\n", "\n", "* [The second part](https://omlc.org/classroom/oslotut/simple/simple2.html), explains how to set the size of the object and select rays to be traced.\n", "\n", "* This tutorial is one from a list of [other tutorials](https://omlc.org/classroom/oslotut/index.html) that are available." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## New ideas \n", "\n", "* Surfaces are numbered based on their vertices\n", "\n", "* Weird numbering for surfaces (e.g., `OBJ`, `AST`, or `IMS`)\n", "\n", "* `RADIUS` means *radius of curvature*\n", "\n", "* `THICKNESS` means distance to next surface\n", "\n", "* `APERTURE RADIUS` is one-half the diameter of the optical element\n", "\n", "* `GLASS` means index of refraction of the material following the surface\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Problem\n", "\n", "The problem is to ray trace light from an object through a biconvex lens to the image plane.\n", "\n", "* The focal length of the lens should be 50mm \n", "* The object is 100mm from the lens. \n", "* The object height is 15\n", "* The lens diameter is 38mm\n", "* The lens thickness is 8mm\n", "\n", "The conventional paraxial ray trace through this 4f system would look like \n", "\n", "\"Biconvex\n", "\n", "The intersection of the two blue rays (or two orange rays) determines the image plane. The OSLO result below shows that the paraxial approximation is pretty poor for this case! \n", "\n", "\"OSLO" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Basics\n", "\n", "OSLO requires a complete description of the optical system as a series of numbers; these are organized into the `Surface Data` table. Each row of the table describes a different surface and each column refers to a different property of that surface. Entering the correct numbers is made more difficult because OSLO's column headers have precise meanings that will inevitably differ from yours.\n", "\n", "> The basic inclination of most students who are asked to solve a problem with OSLO is to immediately\n", " start entering numbers into the Surface Data window and then becoming frustrated because nothing\n", " really works. I am sure you're not one of those students.\n", "\n", "> Finding and entering each number is simple, but they all must be done perfectly because OSLO does not\n", " award any partial credit. \n", "\n", "The first few times that you use OSLO, I suggest that you labor through ALL of the steps below.\n", " Once you become more familiar with OSLO the entire sequence can be reduced to an initial sketch\n", " with notes. The steps are \n", "\n", "1. Sketch the Optical System\n", "3. Find the Vertex for each surface\n", "4. Find the Curvature of each surface\n", "5. Find the Distance to next surface\n", "6. Find the Height of each surface\n", "7. Find the Material to next surface\n", "8. Tabulate the result" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Sketch the Optical System\n", "\n", "> Don't use a computer for this step. Use a piece of paper.\n", "\n", "Just do it. I know that you're clever and can keep everything in your head at once (especially\n", " for this trivial system). \n", " \n", " Your sketch should have an optical axis and all the optical elements.\n", " In this case that means an object plane, the lens, and the image plane. \n", " \n", "\"System\n", "\n", "If you don't have a sketch, then you won't be able to play along at home. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Find the Vertex for each surface\n", "\n", "Identify the vertex of each surface by finding where it crosses the optical axis. The vertical\n", " lines are just for finding distances and identifying surfaces. \t\t\t\n", " \n", " \"System\n", " \n", "Now label the surfaces. Start at the left with the object surface \"OBJ\". The next surface\n", " to the right is \"1\", followed surprisingly by surface \"2\". The last surface is the image\n", " surface \"IMS\". \t\t\t\n", " \n", "\"Labeled\n", "\n", "> Unfortunately, OSLO's programmers did not like this numbering scheme. Instead, they observed that in any\n", " optical system, one surface will always be the aperture stop \"AST\". Therefore one surface must be \n", " labelled \"AST\". Whether or not this is a good and interesting thing is not something that you are \n", " allowed to have an opinion about. For our optical system, it makes no difference, so we will just \n", " label the first surface \"AST\" instead of \"1\". \n", "\n", "\"AST\n", " \n", "So far, you're killing it. Am I right?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Find the Curvature of each surface\n", "\n", "We need to know the curvature of the first (AST) surface. The lensmaker's equation for a thin lens is\t\t\n", "$$\n", "{1\\over f} = (n-1)\\left({1\\over R_1} - {1\\over R_2}\\right)\n", "$$\n", "where, of course, $R_1$ is the radius of curvature of the first surface,\n", "$R_2$ is for the second surface, and $f$ is the focal length of the lens. \n", " Now, since the lens is equi-convex, the radius of curvature of one side is the negative\n", " of the radius of the other side so $R_1=R=-R_2$ so\n", "$$\n", "{1\\over f} = (n-1)\\left({1\\over R} - {1\\over (-R)}\\right)\n", "$$\n", "Now we can solve for the radius of curvature \t\t\t\n", "$$\n", "R = {f\\over 2(n-1)}\n", "$$\n", "\n", "* OSLO defines positive radii as those with a center to the right of the vertex. \n", "* OSLO defines negative radii as those with a center to the left of the vertex.\n", "\n", "In this case, the radius of curvature of the first surface is\n", " positive because the sphere's center is to the right of the vertex.\n", "\n", "\"curvature\n", "\n", "The second surface has a negative radius of curvature because the sphere's center is\n", " to the left of the vertex\n", "\t\t\t\n", "\"curvature\n", "\n", "The object and image surfaces also have radii of curvatures. Since they are flat, this\n", " corresponds to a circle that is infinitely big and so, of course, are infinite.\n", " \n", "> OSLO allows one to write `0` to represent infinity for radii\n", "\n", "\"curvature\n", "\n", "Now, collect all the curvatures in one place\t\t\t\n", "\n", "\"curvature\n", "\n", " Collect these curvatures into a table describing your optical system. \n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SurfaceCurvatureDistanceHeightMaterial
OBJ0
AST$R_{AST}$
2$R_2$
IMS0
\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Find the distance to the next surface\n", " \n", " This is easy. The tricky part is that what is measured is the distance to\n", " the next surface. Thus, the object (OBJ) distance is \n", "\n", "\"OBJ\n", " The distance of the first surface (the AST surface) is the thickness of the lens from vertex to vertex \n", "\n", "\"AST\n", " The distance for the second surface is the length to the image surface. You\n", " don't need to set this distance because OSLO can calculate it for you. \n", "\n", "\"surface\n", " \n", "\n", "So, now add these distances to your table describing the single lens system. \n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SurfaceCurvatureDistanceHeightMaterial
OBJ0$D_{OBJ}$
AST$R_{AST}$$D_{AST}$
2$R_2$$D_2$
IMS0(calc)
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Find the height of each surface (from the optical axis)\n", "\n", "This is really easy. The only confusing part is that you'll be determining\n", "the height of the object from the optical axis (or its radius). The object (OBJ) height is \n", "\n", "\"OBJ\n", " The height of the first surface (the AST surface) is \n", "\n", "\"AST\n", " The height of the second surface should be the height of the previous surface\n", "\n", "\"surface\n", " The height of the image surface can be left blank. OSLO will calculate it for you. \n", "\n", "\"surface\n", "\n", " So, once again, add these heights into the table describing your optical system. \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SurfaceCurvatureDistanceHeightMaterial
OBJ0$D_{OBJ}$$h_{OBJ}$
AST$R_{AST}$$D_{AST}$$h_{AST}$
2$R_2$$D_2$$h_2$
IMS0(calc)(calc)
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Find the material to next surface\n", "\n", "This is also easy. \n", "\n", "The tricky part is that the material for each surface comes **after** \n", "the surface. Thus, in our case, the material for the OBJ surface is just air.\n", "\n", "\"OBJ\n", "\n", " The material for the next surface (the AST surface) is the glass that the lens\n", "is made from \n", "\n", "\"AST\n", "\n", " The material for the next surface is air again!\n", "\n", "\"\"\n", " \n", "Once again, you don't have to worry about the last surface and can leave\n", "it as air.\n", " So, the table describing your optical system is \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SurfaceCurvatureDistanceHeightMaterial
OBJ0$D_{OBJ}$$h_{OBJ}$air
AST$R_{AST}$$D_{AST}$$h_{AST}$glass
2$R_2$$D_2$$h_2$air
IMS0(calc)(calc)air
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Finally, start using the OSLO names\n", "\n", "OSLO uses different names for each column. OSLO's names kind of make sense, but they're more ambiguous than the ones that we used. For example, \"height\" becomes \"APERTURE RADIUS\" as you can see below. \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SRFRADIUSTHICKNESSAPERTURE RADIUSGLASS
OBJ0$D_{OBJ}$$h_{OBJ}$air
AST$R_{AST}$$D_{AST}$$h_{AST}$glass
2$R_2$$D_2$$h_2$air
IMS0(calc)(calc)air
\n", "\n", "So how do you do this? Open a new lens file in OSLO. The `Surface Data` window will look like this. The headings are the same as the ones above.\n", "\n", "\"oslo\n", "\n", "Notice that we need one more surface (row). There are many ways to add rows, but the simplest is to select the image surface row (by clicking on the `IMS` button) and typing Ctrl+I.\n", "\n", "\"oslo\n", "\n", "And now it is just a matter of entering the data that you have collected in the table above into your new Surface Data Window. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Next steps\n", "\n", "The \n", "next tutorial will give step by step instructions for finishing this simple lens design.\n", "\n", "This document is also available as a Jupyter notebook as\n", "simple.ipynb. \n", "\n", "\n", "
\n", "\n", "© 2019 Scott Prahl" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 1 }