# RP Resonator – Advanced Software for Laser Resonator Design and Optimization

Overview | Purpose | Model | Interface | Demos | Versions |

## Example Case: Resonator with Automatic Optimization

We consider a linear resonator with a laser crystal at one end:

Originally, the resonator is defined only with roughly estimated parameters. Then we numerically optimize it. The goals for the optimization are:

- The mode radius in the laser crystal should be 250 μm for dioptric powers between 0 and 3 /m.
- The mode radius at mirror M4 should be 100 μm for the dioptric power of 2 /m.
- The total resonator length should be 300 mm.

The optimization goals are reached by fine-tuning the distances between the resonator mirrors. In the script, a “figure-of-merit” function is defined, which contains penalties for all deviations from ideal properties and is then automatically minimized:

```
FOM():= { figure of merit for given arm lengths }
begin
const dF = 0.5;
var F_cr0;
F_cr0 := F_cr;
sqrt(sum(F := 0 to F_cr_max step dF,
((Init(F_cr := F); w(zm[Crystal], lambda_ref)) / w_cr_w - 1)^2)
+((Init(F_cr := F_cr0); w(zm[M4], lambda_ref)) / w4_w - 1)^2
+(L_res / L_res_w - 1)^2
);
end
vary
a in [a_min, a_max],
b in [b_min, b_max],
d in [d_min, d_max],
for minimum of FOM(), ytol = 1e-2
```

Below we plot the result of the optimization. The design goals are met with reasonable precision.