clear all; close all; clear classes
addpath(genpath('Classes'));
disp('---------------------------------------------------------------------------')
disp(' OSCAR V3.0 ')
disp(' ')
% Define the grid for the simulation: 256 X 256, 40 cm X 40 cm
G1 = Grid(256,0.4);
% Define the incoming beam outside the cavity (beam radius 4.3 cm,
% wavefront curvature 1034 m, mode Laguerre Gauss 3,3)
E_input = E_Field(G1,0.043,-1034,'LG',3,3);
% Define the 2 mirrors, RofC_IM = 1500m, RofC_IM = 1700m, 30 cm in diameter, transmission 2%,
% no loss
IM = Interface(G1,1500,0.35,0.02,0);
EM = Interface(G1,1700,0.35,0.02,0);
% Load the mirror maps
IM = Add_map(IM,'Map1.txt',1.5E-3);
EM = Add_map(EM,'Map2.txt',1.5E-3);
% To normalise the maps for example to 1 nm RMS use:
% IM = Add_map(IM,'Map1.txt',1.5E-3,1E-9);
% Use the 2 previous Interfaces and the input beam to defing a cavity 3000
% meter long
C1 = Cavity1(IM,EM,3000,E_input);
C1.Laser_start_on_input = false ;
% % Calculate the resonance length
C1 = Cavity_resonance_phase(C1);
% Calculate and display the reflected field
C1 = Calculate_fields(C1);
Display_results(C1);