[Optics] Aberration, interferometry and optical test simulator based on matlab

?About the author: A Matlab simulation developer who loves scientific research. He cultivates his mind and improves his technology simultaneously. For cooperation on MATLAB projects, please send a private message.

Personal homepage: Matlab Research Studio

Personal credo: Investigate things to gain knowledge.

For more complete Matlab code and simulation customization content, click

Intelligent optimization algorithm Neural network prediction Radar communication Wireless sensor Power system

Signal processing Image processing Path planning Cellular automaton Drone

Content introduction

This simulation GUI is used to assist in the teaching of aberrations, interferometry, and optical testing. It was developed for courses in the Institute of Optics at the University of Rochester specifically for OPT 242 at the undergraduate level and OPT 442 (Instrumental Optics) at the graduate level. The GUI interface allows the user to enter aberration/wavefront coefficients as primary Seidel aberrations or fringe Zernike coefficients. The GUI then provides various displays:

Wavefront aberration visualization: wavefront surface plot, wavefront color plot, wavefront contour (sagittal and tangential sector) Transverse ray error visualization: ray intercept plot, point plot Imaging system performance: point spread function, MTF ( 2D color plot or lines along the positive fx and fy axes)

Interferometry: single or double pass 2-beam interferometer (e.g. Fizeau, Mach-Zehnder, Twyman-Green interferometer), transverse shear interferometer (shear plate test)

Non-interference testing: Shack-Hartmann point simulator, Foucault knife edge and line testing

Part of the code

function ErrCode = OPTx42_simulator()</code><code>?</code><code>?</code><code>% GUI developed for the OPT 242 (Aberrations, Interferometry, and Optical</code> <code>% Testing) class at the University of Rochester. Also used for</code><code>% graduate-level OPT 442 (Instrumental Optics) course. The GUI allows the</code><code>% user to specify Seidel aberration coefficients for Zernike polynomial</code><code>% coefficients for a system with a circular pupil, and allows visualization</code><code>% via wavefront maps, ray aberration plots, spot diagrams, MTF plots and</code><code>% code><code>% curves, PSF's, interferograms (2-beam and lateral shearing),</code><code>% Shack-Hartmann spots, and knife-edge or wire tests.</code><code>%</code><code>?</code><code>?</code><code>% Set defaults</code><code>h = 0;</code><code>PolyType = 1; </code><code>SeidelFlag = true; % Added 9/19/2022, Rev. 1.8 (false means Zernikes are used)</code><code>v_Seidel = zeros(1,8);</code><code>PlotType = 1;</code><code>GWmat = zeros(201);</code><code>?</code><code>% Create GUI figure window</code><code>% set( 0, 'Units', 'normalized');</code><code>SVfig = figure('Units', 'normalized', 'Position', [0.25, 0.25, 0.4 , 0.4],...</code><code> 'NumberTitle', 'off', 'Tag', 'SVfig');</code><code> </code> <code>% Generate input pane</code><code>InputPane = uipanel(SVfig, 'Units', 'normalized', 'Position', [0.013, 0.013, 0.31, 0.95],.. .</code><code> 'Title', 'Input Panel', 'FontUnits', 'points', 'FontSize', 11,...</code><code> 'BackgroundColor', [1 1 1]*0.8);</code><code>?</code><code>% New "Polynomial type" menu (Seidel vs. Zernike) added 9/19 /2022, Rev. 1.8</code><code>PolyType_menu = uicontrol(InputPane, 'Style', 'popupmenu', 'String',...</code><code> {' Seidel', 'Zernike'}, 'Units', 'normalized',...</code><code> 'Position', [0.1, 0.92, 0.8, 0.06], \ 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'center',...</code><code> 'BackgroundColor', [1 1 1]*0.9, 'Callback', @PolyType_callback);</code><code>?</code><code>uicontrol(InputPane, 'Style', 'text', 'String', 'h:', 'Units', 'normalized',...</code><code> 'Position', [0.05, 0.85, 0.45, 0.033], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'left', \ 'BackgroundColor', [1 1 1]*0.8);</code><code>h_input = uicontrol(InputPane, 'Style', 'edit', 'String', '0' , 'Units', 'normalized',...</code><code> 'Position', [0.5, 0.83, 0.45, 0.06], 'FontUnits', 'points' ,...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'center', 'Callback', @h_input_callback);</code><code>W011x_label = uicontrol(InputPane, 'Style', 'text', 'String', 'W011,x (TLT,X):', 'Units', 'normalized',.. . % Added variable names to labels so that they can be programmatically switched between Seidel and Zernike labels (9/19/2022, Rev. 1.8)</code><code> 'Position', [0.05, 0.76, 0.45, 0.033], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'left', 'BackgroundColor' , [1 1 1]*0.8);</code><code>W011x_input = uicontrol(InputPane, 'Style', 'edit', 'String', '0', 'Units ', 'normalized',...</code><code> 'Position', [0.5, 0.74, 0.45, 0.06], 'FontUnits', 'points',... </code><code> 'FontSize', 10, 'HorizontalAlignment', 'center', 'Callback', @W011x_input_callback);</code><code>W011y_label = uicontrol(InputPane, 'Style', 'text', 'String', 'W011,y (TLT,Y):', 'Units', 'normalized',...</code><code> 'Position', [0.05, 0.68, 0.45, 0.033], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'left', 'BackgroundColor', [1 1 1]*0.8);</code><code>W011y_input = uicontrol(InputPane, 'Style', 'edit\ ', 'String', '0', 'Units', 'normalized',...</code><code> 'Position', [0.5, 0.66, 0.45, 0.06 ], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'center', 'Callback', @W011y_input_callback);</code><code>W020_label = uicontrol(InputPane, 'Style', 'text', 'String', 'W020 (DEF):', 'Units' , 'normalized',...</code><code> 'Position', [0.05, 0.6, 0.45, 0.033], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'left', 'BackgroundColor', [1 1 1]*0.8);</code><code>W020_input = uicontrol (InputPane, 'Style', 'edit', 'String', '0', 'Units', 'normalized',...</code><code> \ 'Position', [0.5, 0.58, 0.45, 0.06], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment' , 'center', 'Callback', @W020_input_callback);</code><code>W040_label = uicontrol(InputPane, 'Style', 'text', 'String', ' W040 (SPH3):', 'Units', 'normalized',...</code><code> 'Position', [0.05, 0.52, 0.45, 0.033], 'FontUnits\ ', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'left', 'BackgroundColor', [1 1 1]* 0.8);</code><code>W040_input = uicontrol(InputPane, 'Style', 'edit', 'String', '0', 'Units', 'normalized\ ',...</code><code> 'Position', [0.5, 0.5, 0.45, 0.06], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'center', 'Callback', @W040_input_callback);</code><code>W131_label = uicontrol(InputPane, 'Style', \ 'text', 'String', 'W131 (CMA3):', 'Units', 'normalized',...</code><code> 'Position', [ 0.05, 0.44, 0.45, 0.033], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'left' , 'BackgroundColor', [1 1 1]*0.8);</code><code>W131_input = uicontrol(InputPane, 'Style', 'edit', 'String', '0 ', 'Units', 'normalized',...</code><code> 'Position', [0.5, 0.42, 0.45, 0.06], 'FontUnits', 'points ',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'center', 'Callback', @W131_input_callback);</code><code> W222_label = uicontrol(InputPane, 'Style', 'text', 'String', 'W222 (AST3):', 'Units', 'normalized',...</code><code> 'Position', [0.05, 0.36, 0.45, 0.033], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'left', 'BackgroundColor', [1 1 1]*0.8);</code><code>W222_input = uicontrol(InputPane, 'Style', ' edit', 'String', '0', 'Units', 'normalized',...</code><code> 'Position', [0.5, 0.34, 0.45 , 0.06], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'center', 'Callback\ ', @W222_input_callback);</code><code>W220_label = uicontrol(InputPane, 'Style', 'text', 'String', 'W220 (FCR3):', 'Units ', 'normalized',...</code><code> 'Position', [0.05, 0.28, 0.45, 0.033], 'FontUnits', 'points',... </code><code> 'FontSize', 10, 'HorizontalAlignment', 'left', 'BackgroundColor', [1 1 1]*0.8);</code><code>W220_input = uicontrol(InputPane, 'Style', 'edit', 'String', '0', 'Units', 'normalized',...</code><code> 'Position', [0.5, 0.26, 0.45, 0.06], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment ', 'center', 'Callback', @W220_input_callback);</code><code>W311_label = uicontrol(InputPane, 'Style', 'text', 'String', 'W311 (DST3):', 'Units', 'normalized',...</code><code> 'Position', [0.05, 0.2, 0.45, 0.033], ' FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'left', 'BackgroundColor', [1 1 1 ]*0.8);</code><code>W311_input = uicontrol(InputPane, 'Style', 'edit', 'String', '0', 'Units', ' normalized',...</code><code> 'Position', [0.5, 0.18, 0.45, 0.06], 'FontUnits', 'points',...</code><code> 'FontSize', 10, 'HorizontalAlignment', 'center', 'Callback', @W311_input_callback);</code><code>Units_text = uicontrol(InputPane, 'Style' , 'text', 'String', '(W coefficients in units of waves)',...</code><code> 'Units', 'normalized', ' Position', [0.05, 0.1, 0.95, 0.07], 'FontUnits', 'points',...</code><code> 'FontSize', 8, 'HorizontalAlignment', 'left', 'BackgroundColor', [1 1 1]*0.8);</code><code>UpdateButton = uicontrol(InputPane, 'Style', 'pushbutton', 'String\ ', 'Update', 'Units', 'normalized',...</code><code> 'Position', [0.166, 0.03, 0.677, 0.08], 'FontUnits\ ', 'points',...</code><code> 'FontSize', 12, 'FontWeight', 'bold', 'HorizontalAlignment', 'center', ...

Operation results

References

[1] Xue Hanchen, Tong Tong, Zhang Junwu, et al. Research on optical interference experimental measurement based on Matlab image processing [J]. Physics and Engineering, 2022, 32(5):133-137.?

Some theories are quoted from online literature. If there is any infringement, please contact the blogger to delete it
Follow me to receive massive matlab e-books and mathematical modeling materials

Private message complete code, paper reproduction, journal cooperation, paper tutoring and scientific research simulation customization matters

1 Improvements and applications of various intelligent optimization algorithms
Production scheduling, economic scheduling, assembly line scheduling, charging optimization, workshop scheduling, departure optimization, reservoir scheduling, three-dimensional packing, logistics location selection, cargo space optimization, bus scheduling optimization, charging pile layout optimization, workshop layout optimization, Container ship stowage optimization, water pump combination optimization, medical resource allocation optimization, facility layout optimization, visible area base station and drone site selection optimization
2 Machine learning and deep learning
Convolutional neural network (CNN), LSTM, support vector machine (SVM), least squares support vector machine (LSSVM), extreme learning machine (ELM), kernel extreme learning machine (KELM), BP, RBF, width Learning, DBN, RF, RBF, DELM, XGBOOST, TCN realize wind power prediction, photovoltaic prediction, battery life prediction, radiation source identification, traffic flow prediction, load prediction, stock price prediction, PM2.5 concentration prediction, battery health status prediction, water body Optical parameter inversion, NLOS signal identification, accurate subway parking prediction, transformer fault diagnosis
2. Image processing
Image recognition, image segmentation, image detection, image hiding, image registration, image splicing, image fusion, image enhancement, image compressed sensing
3 Path planning
Traveling salesman problem (TSP), vehicle routing problem (VRP, MVRP, CVRP, VRPTW, etc.), UAV three-dimensional path planning, UAV collaboration, UAV formation, robot path planning, raster map path planning , multimodal transportation problems, vehicle collaborative UAV path planning, antenna linear array distribution optimization, workshop layout optimization
4 UAV application
UAV path planning, UAV control, UAV formation, UAV collaboration, UAV task allocation, and online optimization of UAV safe communication trajectories
5 Wireless sensor positioning and layout
Sensor deployment optimization, communication protocol optimization, routing optimization, target positioning optimization, Dv-Hop positioning optimization, Leach protocol optimization, WSN coverage optimization, multicast optimization, RSSI positioning optimization
6 Signal processing
Signal recognition, signal encryption, signal denoising, signal enhancement, radar signal processing, signal watermark embedding and extraction, EMG signal, EEG signal, signal timing optimization
7 Power system aspects
Microgrid optimization, reactive power optimization, distribution network reconstruction, energy storage configuration
8 Cellular Automata
Traffic flow, crowd evacuation, virus spread, crystal growth
9 Radar aspect
Kalman filter tracking, track correlation, track fusion