# NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

## Information about this web site => Question related to Physics or physics related simulation => Topic started by: lookang on June 22, 2009, 01:00:25 pm

 Title: how simulate a len changing thickness for convex or concave len? Post by: lookang on June 22, 2009, 01:00:25 pm http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1155msg4448;topicseen#msg4448Hi prof,I examine the physlet applet, it seems to have a good example of a thickness of lens changing with focus length f.I look through many examples of optics here, but i don't see one that has a changing thickness lens.i notice the lens usually don't change thickness or drawingany chance of some tips how to make one realistically?  Title: Re: how simulate a len changing thickness for convex or concave len? Post by: Fu-Kwun Hwang on June 22, 2009, 01:43:54 pm QuoteI examine the physlet applet, it seems to have a good example of a thickness of lens changing with focus length f.Could you provide the URL of the examples ?I think if you use thin lens approximation in the simulation, the thickness of the lens is only visual effect.If you want to simulate effect due to thick lens, you need to use Snell's Law to calculate all the refractions occurs at the boundary of lens. You are welcomed to check out Thick Lens (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=46.0)If you want to show how the thickness of a lens affect the focus, that is another story! Many drawing in Physlet optical bench is only an approximation.Please check out the attached image. It assumed thin mirror and thin lens case. The space in the simulation is not the same as real world. The mirror and lens will be almost like a thin/short line if you want to draw it according to real dimension. Title: Re: how simulate a len changing thickness for convex or concave len? Post by: lookang on June 22, 2009, 02:03:17 pm Quote from: Fu-Kwun Hwang on June 22, 2009, 01:43:54 pmCould you provide the URL of the examples ?http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1140.0Quote from: Fu-Kwun Hwang on June 22, 2009, 01:43:54 pmI think if you use thin lens approximation in the simulation, the thickness of the lens is only visual effect.If you want to simulate effect due to thick lens, you need to use Snell's Law to calculate all the refractions occurs at the boundary of lens. You are welcomed to check out Thick Lens (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=46.0)If you want to show how the thickness of a lens affect the focus, that is another story! Many drawing in Physlet optical bench is only an approximation.Please check out the attached image. It assumed thin mirror and thin lens case. The space in the simulation is not the same as real world. The mirror and lens will be almost like a thin/short line if you want to draw it according to real dimension.Yes! i only want a visual effect, like physlet ones.I google and found your thick lens http://www.compadre.org/OSP/document/ServeFile.cfm?ID=8257&DocID=886but the function to draw the polygon that represents the lens is complicated. I doubt i can copy it over to make it work. Title: Re: how simulate a len changing thickness for convex or concave len? Post by: Fu-Kwun Hwang on June 22, 2009, 02:45:34 pm If you just need visual effect, you can change the width of shape (the GUI used to draw lens) and let it change with f.EJS version of thick lens can be found at Lens (thick lens) and Mirror (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=121.0). The snell's law were used to calculate all the refraction to simulate a real thick lens. Title: Re: how simulate a len changing thickness for convex or concave len? Post by: lookang on June 22, 2009, 09:12:09 pm Quote from: Fu-Kwun Hwang on June 22, 2009, 02:45:34 pmIf you just need visual effect, you can change the width of shape (the GUI used to draw lens) and let it change with f.i understand your suggestion,any tips how i get get a suitable equation?size X = size*2*(2- Math.sin(f)) doesn't look good           = size*2*(1/f) is the correct relationship but it doesn't look nice.i am stuck thinking of a eqn ;D Title: Re: how simulate a len changing thickness for convex or concave len? Post by: lookang on June 22, 2009, 09:39:46 pm i used a simplified methodfixed relationsif ( f > 1 ) {  fdraw = 1;}else {  fdraw = f;  }Lens X size= size*2*1/(fdraw+1)looks better now ;D