how to make lenses in matlab?
Show older comments
Dear sir/madam,
I am working on optical lenses. I need to create lenses such as biconvex, biconcave, planoconvex and planoconcave for my project. How could I do this in matlab? Looking forward to hearing from you soon.
Thanking you, BSD
1 Comment
PRAKASH JOSHI
on 28 Mar 2019
How do I find the off focus points after the fft
Answers (1)
Bjorn Gustavsson
on 30 Aug 2011
0 votes
There is at least one tool for calculating ray-paths through optical systems on the file exchange: http://www.mathworks.co.uk/matlabcentral/fileexchange/27412-opticalbench
HTH
12 Comments
bsd
on 31 Aug 2011
Bjorn Gustavsson
on 31 Aug 2011
If you look, there is 10 files with "example" in their names. Those surely should be examples of how to use the functions for this or that purpose.
bsd
on 1 Sep 2011
Bjorn Gustavsson
on 1 Sep 2011
Take a look in the opt_exempel*.m files. The .exmpl files are setup-files describing optical elements, with curvature of lens surfaces, glass type, lens position, diameter and other parameters.
bsd
on 2 Sep 2011
Bjorn Gustavsson
on 3 Sep 2011
The ray tracing is simply Snell's law, calculating the angle to the surface normal at the ray-entrance/exit, refraction for the glass-type at the wavelength of the ray. The plotting is just simple geometry.
bsd
on 6 Sep 2011
Iain Robinson
on 6 Sep 2011
The transmitted ray will leave surface 1 and travel to surface 2 along a straight line. You know the angle of this line (to the optical axis) from applying Snell's Law at surface 1. You also know the coordinates of one of the points on the line: the point where it was refracted at surface 1. This is enough information to calculate the equation of the straight line (using the angle to determine the gradient).
The spherical surface of the lens, surface 2, is described by the equation of a circle. You'll need to look up or calculate the radius of curvature.
By solving the equations of the ray (straight line) and the lens surface (circle) you can get the coordinates of the point of intersection between the ray and the surface. There will be two solutions, one for concave surfaces, one for convex.
After picking the right solution draw a line connecting the coordinates of transmitted ray leaving surface 1 to the coordinates of the point where the ray is incident on surface 2.
HTH.
bsd
on 6 Sep 2011
Iain Robinson
on 6 Sep 2011
If the lens is plano-convex and surface 1 is flat then the normal will be parellel to the optical axis. This is a special case, but it makes things slightly simpler.
If surface 1 is not flat then you need to convert the angle of refraction relative to the surface normal to an angle relative to the optical axis. The geometry required is given in, among other places, Nussbaum's "Contemporary Optics for Scientists and Engineers".
By the way, if the refraction angles are "small" then using the paraxial approximation could simplify the problem.
bsd
on 13 Sep 2011
bsd
on 23 Sep 2011
Categories
Find more on Design and Tuning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!