{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Normal " -1 256 1 {CSTYLE "" -1 -1 "Times" 1 24 0 0 0 1 2 1 2 2 2 2 1 1 1 1 } 3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT 256 16 "Thin Lens Optics" }} {PARA 257 "" 0 "" {TEXT -1 20 "By: Jason D. Caerels" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 163 "This maplet calcutates the image of a specified object produced by a specified lens. A ray \+ diagram can then be plotted for a visual interpretation of the problem ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 168 "The conventions used are as follows: 1. the object is located of the left side of the lens, 2. a postive radius implies a convex surface (left \+ to right) and visa versa." }}{PARA 0 "" 0 "" {TEXT -1 887 "In order to find an image and describe it, the lens and surrounding medium and th e object must be specified. The index of refraction for a crown glass lens is 1.52 and the index of air (1 atm and 20\260C) is 1.0003, (for wavelength of light = 589 nm). A typical thins lens would have left \+ and right hand side radii of 20 and -20 respectively. The object heigh t and distance can be any value, keeping in mind they have the same un its as the lens' radii and for this particular example the focal point of the lens equals 20 which results in an infinite image distance and is hence trapped by an error. After these values have been supplied \+ click the \"Find Image\" button and the particulars of the image will \+ be calculated and displayed. To see the ray diagram for the situation click the \"Ray Diagram\" button. The red arrow represents the objec t and the green arrow represents the image." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 58 "To run the maplet, execute this worksheet by pressing the " }{TEXT 257 3 "!!!" }{TEXT -1 24 " button \+ in the tool bar." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "with(Maplets): with(Ele ments): with(Tools): with(plots): with(plottools):" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name changecoords has been redefined\n" }} {PARA 7 "" 1 "" {TEXT -1 43 "Warning, the name arrow has been redefine d\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 264 "imagesize:=proc(obj ectheight, objectposition, imageposition)\n# This procedure calculates the size (height) of the image produced\n\nlocal imageheight:\n\nDigi ts:=5:\nimageheight := (objectheight*imageposition)/objectposition:\ni mageheight := abs(imageheight):\n\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 335 "imagemagnification := proc(objectposition, imag eposition)\n# This procedure calculates the magnification of the objec t\n# The sign indicates the orientation of the image\n\nlocal Mag:\n\n Digits:=5:\n\nMag := (-1)*imageposition/objectposition:\n\nif Mag > 0 \+ then\n Set(CB1::anything = true)\nelse\n Set(CB2::anything = true) \nfi:\n\nMag:\n\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 649 "imageposition:=proc(SO, R1, R2, n1, n2)\n# This procedure calcula tes image position according to input values\n\nlocal ff, F, image, po sition:\n\nff:= (1/f = ((n2 - n1)/n1)*(1/R1 - 1/R2)):\nF:=solve(ff, f) :\n\n# Check to ensure that SO is not at the focal point of the lens\n # which would imply SI = infinity\nif F = SO then\n error \"The obje ct is located at the focal point of the lens.\\nThis would produce an \+ infinite image distance.\"\nfi;\n\nimage:= 1/SO + 1/SI = 1/F:\nDigits: =5;\nposition := solve(image, SI):\n\n#a:= parse(convert(position, int eger)):\nif position > 0 then\n Set(CB3::anything = true)\nelse\n \+ Set(CB4::anything = true)\nfi:\nposition:\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1389 "raydiagram:= proc(Yo, So, n2, R1, n1, R 2, Yi, Si)\n\n# This procedure creates the plot command for the ray di agram\n\n# Define local variables\nlocal object, image, objparray, imp array, objstrray, imstrray, lslens, rslens:\n# Create the object arrow \nobject:= arrow([-So, 0], [-So, Yo], 0.1, 0.8, 0.05, arrow, color = r ed):\n\n# Create parallel ray from top of object to centre of lens (i. e. the y-axis)\nobjparray := line([-So, Yo], [0, Yo], color=blue, line style=3):\n\n# Create ray from top of object to origin\nobjstrray := l ine([-So, Yo], [0, 0], color=violet, linestyle=3):\n\n# Create the ima ge arrow\n# Create rays connecting object to image through lens\nif Si > 0 then\n image:= arrow([Si, 0], [Si, -Yi], 0.1, 0.8, 0.05, arrow, color = green):\n imparray := line([0, Yo], [Si, -Yi], color=blue, \+ linestyle=3):\n imstrray := line([0, 0], [Si, -Yi], color=violet, li nestyle=3):\nelse\n image:= arrow([Si, 0], [Si, Yi], 0.1, 0.8, 0.05, arrow, color = green):\n imparray := line([0, Yo], [Si, Yi], color= blue, linestyle=3):\n imstrray := line([0, 0], [Si, Yi], color=viole t, linestyle=3):\nfi:\n\n# Create the plot of the thin lens\nlslens := arc([R1-1,0], -R1, -arccos(abs((R1-1)/R1))..arccos(abs((R1-1)/R1))): \nrslens := arc([R2+1,0], -R2, -arccos(abs((R2+1)/R2))..arccos(abs((R2 +1)/R2))):\n\ndisplay(\{object, image, objparray, imparray, objstrray, imstrray, lslens, rslens\}, thickness = 2):\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5759 "thinlens := proc()\n\nlocal maple t:\n\nmaplet:= Maplet(onstartup = RunWindow(W1), Window[W1](\"Thin Len s Optics\", menubar = MB1,\n\n# Window containing input fields and cal culation results \n[\n[GridLayout(border = true, caption = \"Lens Spec ifications\", inset = 3,\n GridRow(\n GridCell() \n ),\n GridRow(\n GridCell(\"Enter index of refraction for a thin le ns: \", halign = right),\n GridCell(value = TF3), \n Grid Cell(),\n GridCell(\"Radius of the l.h.s of lens: \", halign = \+ right),\n GridCell(value = TF4),\n GridCell()\n ),\n G ridRow(\n GridCell(\"Enter index of refraction for the medium: \+ \", halign = right),\n GridCell(value = TF5), \n GridCell( ),\n GridCell(\"Radius of the r.h.s of lens: \", halign = right ),\n GridCell(value = TF6),\n GridCell()\n )\n)],\n[Grid Layout(border = true, caption = \"Object Specifications\", inset = 3, \n GridRow(\n GridCell() \n ),\n GridRow(\n Grid Cell(),\n GridCell(),\n GridCell(\"Object Height: \", hal ign = right), \n GridCell(value = TF1), \n GridCell(),\n \+ GridCell()\n ), \n GridRow(\n GridCell(),\n GridC ell(),\n GridCell(\"Object Distance: \", halign = right), \n \+ GridCell(value = TF2),\n GridCell(),\n GridCell()\n \+ ) \n),\nGridLayout(border = true, caption = \"Image Results\", inset = 3,\n GridRow(\n GridCell() \n ),\n GridRow(\n G ridCell(),\n GridCell(),\n GridCell(\"Image Height: \", h align = right), \n GridCell(value = TF7), \n GridCell(),\n GridCell()\n ), \n GridRow(\n GridCell(),\n Gri dCell(),\n GridCell(\"Image Distance: \", halign = right), \n \+ GridCell(value = TF8),\n GridCell(),\n GridCell()\n \+ ),\n GridRow(\n GridCell(),\n GridCell(),\n GridC ell(\"Magnification: \", halign = right), \n GridCell(value = T F9),\n GridCell(),\n GridCell()\n ) \n)],\n[GridLayout( \n GridRow(\n GridCell() \n ),\n GridRow(\n Grid Cell(value = B3), \n GridCell(value = B4), \n GridCell(), \n GridCell(),\n GridCell(),\n GridCell()\n ), \n \+ GridRow(\n GridCell(), \n GridCell(),\n GridCell() ,\n GridCell(), \n GridCell(),\n GridCell()\n ) \n ),\nGridLayout(border = true, caption = \"Physical Description of Resu lting Image\", inset = 3,\n GridRow(\n GridCell() \n ), \n GridRow(\n GridCell(\"Orientation: \", halign = right), \n GridCell(value = TF10), \n GridCell(),\n GridCell() \n ), \n GridRow(\n GridCell(\"Type: \", halign = right), \+ \n GridCell(value = TF11),\n GridCell(),\n GridCell( )\n ),\n GridRow(\n GridCell(), \n GridCell(),\n \+ GridCell(),\n GridCell()\n ) \n)]\n]),\n\n# Window with Ray \+ Diagram for the thin lens problem specified by the user in the above w indow\nWindow[W4](\"Ray Diagram\", \n[\n[GridLayout(\n GridRow(\n \+ GridCell(value = PL1)\n )\n\n)]\n]),\n\n\n# Actions and Buttons\n \nAction[A1](RunWindow(W2)),\nAction[A2](RunWindow(W3)),\nAction[A3](E valuate(TF8 = 'imageposition(TF2, TF4, TF6, TF5, TF3)'), Evaluate(TF7 \+ = 'imagesize(TF1, TF2, TF8)'), Evaluate(TF9 = 'imagemagnification(TF2, TF8)')),\nAction[A4](SetOption(TF10 = \"erect\")),\nAction[A5](SetOpt ion(TF10 = \"inverted\")),\nAction[A7](SetOption(TF11 = \"real\")),\nA ction[A8](SetOption(TF11 = \"virtual\")),\nAction[A9](RunWindow(W4), E valuate(PL1 = 'raydiagram(TF1, TF2, TF3, TF4, TF5, TF6, TF7, TF8)')), \n\nButton[B1](\"OK\", onclick = CloseWindow(W2)),\nButton[B2](\"OK\", onclick = CloseWindow(W3)),\nButton[B3](\"Find Image\", onclick = A3) ,\nButton[B4](\"Ray Diagram\", onclick = A9 ),\n\n# Text Fields\n\nTex tField[TF1](5, \"5\"), TextField[TF2](5, \"10\"), TextField[TF3](5, \" 1.52\"), TextField[TF4](5, \"20\"), TextField[TF5](5, \"1.0\"), TextFi eld[TF6](5, \"-20\"),\n\n# Text Fields of the image results\nTextField [TF7](5, tooltip = \"This is the absolute height of the image.\", edit able = false), \nTextField[TF8](5, tooltip = \"A negative image distan ce implies a virtual image.\", editable = false),\nTextField[TF9](5, t ooltip = \"Sign indicates orientation, i.e. '+'ve -> erect and '-'ve - > inverted\", editable = false), \nTextField[TF10](10, editable = fals e),\nTextField[TF11](10, editable = false),\n\n# Elements\nMenuBar[MB1 ](\n Menu(\"File\",\n MenuItem(\"Exit\", Shutdown([TF7, TF8, TF 9]))\n ),\n Menu(\"Help\",\n MenuItem(\"What is the purpose o f this maplet?\", onclick = A1),\n MenuItem(\"Instructions and Co nventions\", onclick = A2)\n )\n\n),\n\n# Hidden check boxes set by \+ procedures to update physical image attributes\nCheckBox[CB1](visible \+ = false, onchange = A4),\nCheckBox[CB2](visible = false, onchange = A5 ),\nCheckBox[CB3](visible = false, onchange = A7),\nCheckBox[CB4](visi ble = false, onchange = A8),\n\n# Plotter for display of the ray diagr am\nPlotter[PL1](tooltip = \"Ray Diagram\"),\n\n# Window with a Descri ption of this maplet's purpose\nWindow[W2](\"About\", \n [GridLayout (\n GridRow(GridCell(\"The purpose of this maplet is to:\", halig n = left)),\n GridRow(GridCell(\"1. Find the image of a given obj ect produced by a specified thin lens\", halign = left)),\n GridR ow(GridCell(\"2. Create a ray diagram to visually interpret the situat ion\", halign = left)),\n GridRow(GridCell()),\n GridRow(Gri dCell()),\n GridRow(GridCell(value = B1, halign = center))\n )] \n),\n\n# Window with a Instructions \nWindow[W3](\"Instructions and C onventions\", \n [GridLayout(\n GridRow(GridCell(\"1. The objec t is assumed to be to the left of the lens\", halign = left)),\n \+ GridRow(GridCell(\"2. \", halign = left)),\n GridRow(GridCell()), \n GridRow(GridCell()),\n GridRow(GridCell()),\n GridRo w(GridCell(value = B2, halign = center))\n )]\n\n)):\n\nDisplay(mapl et):\n\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "thinle ns();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 6 0" 737 }{VIEWOPTS 1 1 0 3 4 1802 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }