forked from jameclear/Metagrating-Topology-Optimization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRunOpt.m
34 lines (26 loc) · 1.07 KB
/
RunOpt.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
close all
clear all
addpath('Functions')
% Initialize optimization parameters
% Default values and descriptions found in 'Functions/Initialize.m'
OptParm = Initialize();
% Defines target output angle
target_angle = 50;
% Device parameters
OptParm.Input.Wavelength = 1050;
OptParm.Input.Polarization = 'TM';
OptParm.Optimization.Target = [1];
OptParm.Geometry.Thickness = 325; % Device layer thickness
% Compute necessary period corresponding to target angle
period = [OptParm.Input.Wavelength/sind(target_angle),0.5*OptParm.Input.Wavelength];
OptParm.Geometry.Period = period;
% Define # of Fourier orders
OptParm.Simulation.Fourier = [12 12];
% Run robust optimization
OptParm.Optimization.Robustness.StartDeviation = [-5 0 5]; % Starting edge deviation values
OptParm.Optimization.Robustness.EndDeviation = OptParm.Optimization.Robustness.StartDeviation; % Ending edge deviation values
OptParm.Optimization.Robustness.Weights = [.5 1 .5];
% Plot efficiency history
OptParm.Display.PlotEfficiency = 1;
% Run optimizations
optout = OptimizeDevice(OptParm)