-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.c
104 lines (80 loc) · 2.13 KB
/
Main.c
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
clemens schaefermeier
*/
#include "include_me.h"
#include "msg.h"
#include "optic.h"
#include "ff.h"
int main()
{
//Find best parameters to yield a beam waist of 30 um
double lambda = 632.8e-6;
double w0 = 1e-1;
double target = 3e-2;
manff_simplex(lambda, w0, target);
/*
The output should be read as follows
MESSAGE:
NMAX exceeded in small_amoeba
528.3232857859 222.2128733950 961.1164778513 1.412123305e-026
528.3232857859 222.2128733950 961.1164778513 1.36018537e-026
528.3232857859 222.2128733950 961.1164778513 1.36018537e-026
528.3232857859 222.2128733950 961.1164778513 1.412123305e-026
*/
//Ray propagation through optical elements
/*
double lambda=632.8e-6;
double w0=1e-1;
double M1[4],M2[4];
qbeam q,qp;
setq(&q,0.,rayleighr(w0,lambda),lambda);
q_out(&q,"in");
propagation(M1,400.);
thin_lens(M2,258.);
M_mult_ip(M2,M1);
propagation(M1,1400.);
M_mult_ip(M1,M2);
thin_lens(M2,140.4);
M_mult_ip(M2,M1);
propagation(M1,172.1);
M_mult_ip(M1,M2);
qp=qtrans(M1,&q);
q_out(&qp,"out");
*/
/*
The output should be read as follows
q.in : z[e-3m] w0[e-6m]
0 100
R[e-3m] wz[e-6m]
inf 100
q.out : z[e-3m] w0[e-6m]
-0.0721956 40.0079
R[e-3m] wz[e-6m]
-874.728 40.0095
*/
//A linear resonator, left mirror is plane, distance to right mirror is 400 mm, curvature of right mirror is 2 m
/*
double M1[4],M2[4];
qbeam q;
cplx c;
q.lam=1064e-6;
propagation(M1,400.);
reflection(M2,2000.);
M_mult_ip(M2,M1);
propagation(M1,400.);
M_mult_ip(M1,M2);
c=eigenmod_res(M1);
q.R=c.R;
q.I=c.I;
q_out(&q,"res");
*/
/*
The output should be read as follows
q.res : z[e-3m] w0[e-6m]
0 520.524
R[e-3m] wz[e-6m]
inf 520.524
*/
return 0;
}