B,1 Program to evaluate function hs from Guha, Wu and Falk
A, B, c, leff : real; begin
spot_size := sqr(pi / 2 / L / lambda) * sqr(x * sqr(x)) + sqr(x) - sqr(Wp) / 2 end;
function curved (x : real) : real; var
A, B, c, leff : real; begin
leff := Ic / 2 / n + d;
A := 1 - (8 / RofC) * leff * (1 - (1 / RofC) * leff);
B : = 4 * n * leff * ( 1 - 3 * leff/ RofC + ( 2 / sqr(RofC))* sqr(leff)); c := sqr(x * sqr(x)) + sqr(sqr(x) * Wp) * (1 / sqr(A) - 1) / 2;
c := c + sqr(B * (lamb& / n) * x / A / pi) - sqr(B * (lambda / n) * Wp / A / pi) / 2; curved := c
end;
This setups all the values and initial conditions required to solve for the time evolution of the Q-switched pulse, depending on r, the number of times threshold
procedure initialise; var
X ,T l . N l . N2, T_peak, T2, N.half, HWl, HW2 : real;
Producing the values of time v photon fraction for the Q-switched pulse is the most time consuming part of the program. It is therefore most efficient to do this only once and save the values in an array
procedure set_up_array; var
ii : integer; begin
for ii := 1 to 250 do this assures that any unused part of the array is zero
pump_frac_array[ii] := 0;
tm := initial_actual;
writelnCpreparing time v photon_frac array'); writeln;
for ii := 1 to round_trips do
begin
itérate(time, z l, z2, le-3, z, dummy); inv_frac := exp(-z) / r;
photon_frac := ((1 - inv_frac) + (1 / r) * ln(inv_frac)) / No;
pump_firac_array[ii] := photon_frac; tm :=! tm + round_trip_time
end end;
The extraction efficiency is required for the calculations function extraction_efficiency (a : real) : real;
begin
extraction_efficiency := ln(a) / (a -1) - r
end;
This allows the time for a certain photon fraction to be calculated, ie the halfwidths function halfwidth (x : real) ; real;
begin
halfwidth := x * exp(-r * x) - exp(r * (photon_frac * No - 1)) end;
begin initialise
writein(’What value of r ?'); readln(r);
writeln;
repeat begin
writeln(’Which model for threshold, Brosnan - Byer (bb) or Guha (g)'); readln(ansl);
writeln('Allow for pump reflection (y/n)?0; readln(ans);
if ans = y then begin
refl := 1;
writeln('What value of reflection % ?');
readln(Rp); Rp ;= R p/ 100;
writeln('Allow for double pass (y/n) ?'); readln(ans)
end else
Appendix B : Computer Programs
initialisation and calculation of the values zi, z l, z2, T l, Tjpeak, T2, and the FWHM zi := -ln(r); zl:=-ln(r)+ 0.0 1; z2 := *ln(x * r) - 0.0 0 1; Tl := 0; N l := exp(-zl) / r; N2 := exp(-z2) / r; N o : = ( l - l / r ) + ( l / r ) * I n ( l / r ) ; simpson(f, z l, 0, T_peak); simpson(f, z l, z2, T2);
By finding the points where photon_frac = 0.5, one before and one after the peak, the FWHM is calculated
photon_frac := 0.5;
iterate(halfwidth,Nl, 1 / r, le-3, N_half, dummy); N_half := -ln(N_half * r);
simpson(f, z l, N_half, HWl);
iterate(halfwidth, 1 / r, N2, le-3, N_half, dummy);
N_half := -ln(N_half * r);
simpson(f, z l, N_half, HW2); tc := fwhm_m / (HW2 - HWl);
calculate time at which photon_frac is 0,05, for the initial time for the round_trips to start photon_frac := 0.05;
itérate(halfwidth,Nl, 1 / r, le-3, N_half, dummy); N_half :=s -ln(N_haif * r); simpson(f, z l, N_half, HWl); initial_actual := tc * HWl; set_up_array; end; main program begin
textwindowrect.top := 40; this set of instructions opens up the text window on
entering
textwindowrect.left := 40; the program to which all write statements, go except those
textwindowrect.bottom := 330; which have 'data' as the ouput textfile, where the write
textwindowrect.right := 460; statement puts the data into a textfile for use in cricket graph
settextrect(textwindowrect); showtext;
filename := 'thresholds.data'; this names and then opens the textfile for outputing data
Appendix B : Computer Programs loss if ans = y then begin end else begin dp := 1; if ansi = 'g' then begin
writeln('What value of hs for the first pass ?*); readln(hs_l);
writelnCWhat value of hs for the second pass ?’);
readln(hs_2) end dp := 0; if ansi = 'g' then begin writelnCWhat value of hs ?"); readln(hs_l) end end; writelnCcrystal length (mm) ?'); readln(lc); Ic := Ic * le-3; L := Ic / n + 2 * d;
writeIn(What is the estimated crystal reflection loss per face at signal (%) ?'); readln(Rc);
Rc := R c/ 1(X);
writeln(What is the estimated crystal absorption at signal (cm-1) ?');
readln(as);
as := as * 1 0 0;
if ansi = 'bb' then begin
writelnCWhat is the estimated crystal absorption at idler (cm-1) ?*);
readln(ai);
ai := ai * 1 0 0;
a_av := (as + ai) / 2;
delta_a := (ai - as);
{writeIn(What value of dkl, from guha analysis ?');} {readln(dkl)) dkl := 0 end else begin a_av :=s 0; delta_a := 0 end;
writein(What value of input miror reflectivity for signal (%) ?'); readln(Rl);
R1 := R1 /100;
writeln(What value of output miror reflectivity for signal(%) ?"); readln(R2);
R2 ;= R2 / 100;
Rd Rl * R2 * sqr(sqr(l - Rc)) * exp(-(l - dp) * as * Ic);
total cavity round trip transmission
Rdd := R1 * R2 * sqr(sqr(l - Rc)); cavity transmission without absorption
writeln(What pump spot size (p.m) ?'); readln(Wp);
Appendix B : Computer Programs
Wp Wp * le-6;
writeln(What is the pulse width (fwhm, ns) ?*); readln(fwhm_m);
fwhm_m :=s fwhm_m * le-9;
tor := fwhm_m * 0.6; this converts the fwhm in ns to hw(l/e) in s
Ws := 0;
gs := 0;
if ansi = 'bb' then begin
writeln('Are the mirrors plane (p) or curved (c) ?'); readln(ans);
if ans = 'p' then begin
iterate(spot_size, 20e-6,800e-6,2e-6, Ws, dummy) end
else begin
writeln(What radius of curvature, in mm ?'); readln(RofC);
RofC := RofC / le3;
Ws := lOOe-6;
iterate(curved, 0, Wp, le-7, Ws, dummy) end;
writeln(Which method, top-hat (t) or iterated pulse (i) ?'); readln(ans);
end;
gs is just a mode coupling parameter which comes from the BB model, it is incidently wrong but close enough for our purposes
gs := sqr(Wp) / (sqr(Wp) + sqr(Ws));
if ans = 't' then this is if you want to solve the simplified eqns which assume that
begin the pump pulse has a top hat temporal profile
dummy := false; gammaL := 0;
itérate(gain, 0.1 + In(l / sqrt(Rd) +sqrt(l /R d - l)),2,le-2, gammaL, dummy); writeln;
writelnCgammaL = ', gammaL : 10 :4); intensity := sqr(gammaL) / (kbb * gs * sqr(lc));
writeln(Threshold = ', intensity / lelO : 10: 1, ' MW/cm'^2’) end
else begin
writelnCWhat time dependence, gaussian assumption (g) or actual (a)'); readln(ans);
round_trip_time := 2 * (1.75 * Ic + 2 * d) / c; {this is just 2*(n*lc+2*d)/c) round_trips := trunc(4 * tor / round_trip_lime);
The round trips are calculated to Iterate between the 5 % points of a gaussian. Although the5 % points are
different for the actual profile, it goes between 5% and 7%, this will give both the same number of round
trips, as they both have the same FWHM
if ans = 'a' then initialise; writeln;
writeln('round trips = ', round_trips ; 5);
I
if ansi = 'bb'then I
begin j
end else begin
Appendix B : Computer Programs
end; The form of this function call is
iterate(function to be iterated,Iower limit, upper limit, accuracy, answer, dummy variable)
it changes the value of intensity, starting at 1 MW/cm^2, until two successive estimates differ by the accuracy parameter, which is 1 MW/cm^2
iterate(iierated_gain,lelO,4/(l-Rp)/(kbb*gs*sqr(lc)>, lelO, intensity, dummy); the value for the second limit gives gammaL = 2
writeln;
writeln(Threshold intensity is ’, (intensity * le-10) : 4 :1, 'MW/cm^2');
end;
writeln(Threshold energy is ', intensity * 2.78 * sqrCWp) * tor * le3 :4 : 2, ' mJ');
writeln(Threshold power is ', intensity * (pi / 2) * sqr(Wp) / le3 : 4 : 1 , ' kW'); writeln;
writeln(The paramaters chosen were := '); writeln;
writeln('Input reflectivity R1 * 100 :4:2, ' % Output relectivity ',R2 * ICX) ;4;2, writelnCCrystal length Ic * le3 : 3 :1, ' mm );
writelnOPump spot size ', Wp * Ie6 :4 ; 1, ' pm');
write('Method of solution was - "): if ans - 't' then
writeln('top-hat') else if ans = 'g' then
writeln(’iterative : gaussian time dependence') else
writeln('iterative ; actual time dependence');
write(data, I * le3 : 2, chr(9), Wp * le6 :4 :1, chr(9), Ws * le6 :4 : 1); writeln(data, chr(9), intensity / le 10 : 4 : 3); end; writeln; writelnCAnother ? (y/n)'); readln(ans); writeln until ans = 'n';
close(data) closes the output data textfile which is necessary before it can be read
end.
B J2
writeln;
writeln('Intensity(MW/cm^2)', 'gammaL', 'no. of photons (♦ 1.6014)"); |
writeln
writeln;
writeln('Power(kW) fraction of threshold photons');
writeln