  Laser Gain calculator is a tiny software to estimate the laser gain if
stored energy, laser rod diameter and laser medium type are known. Note
that this 'stored' energy is in no way the energy, that was accumulated
in laser storage capacitors. Neither it is the pump energy, having been
absorbed by laser medium. The 'stored energy', means the energy accumulated
in population inversion, that can be extracted as laser radiation (with
the precision to various losses).
  HOW TO USE: download, unpack and run the executable. In the popup list
at top right corner of the working window choose the necessary type of 
laser medium. A text window below the popup list will be filled with 
the basic parameters of the selected one. It allows You to check the initial
data before You proceed further.
  Then set laser rod diameter in the text box to the right. Don't forget
to press 'enter' to finalize the input. You can also set the rod section
area. When You press 'enter' the code calculates the effective diameter
of the rod and displays it in the correspondent textbox. The 'diameter of
the rod' means just the effective diameter of equivalent rod with round 
cross section. Actually only the area of that cross section makes sense.
For laser cells of liquid lasers use the cell bore (or bore cross sectional
area). For gas lasers this area (or diameter) must be relevant to the one,
being occupied by gas discharge column.
  Then set the stored energy (see the notes above to comprehend what exactly
it means). Press 'Enter'.
  The code will show the estimated pump energy and pump power, that are needed
to be absorbed by laser medium to give the correspondent stored energy. It will
also show the estimated laser gain. Beware, that if the gain tends to be too
high (very high pumping, typical for superradiant lasers) the textbox with
gain will show the natural logarithm of the gain. Check the label of this
textbox carefully.
  You may also use the gain textbox as an input field. Type the necessary gain
value and press 'Enter'. The code will calculate, the absorbed and stored 
energy, needed to achieve the given gain. (For the given rod diameter and
given medium of course.) Note, that in this case, You always input the gain
itself, rather than its logarithm.
  In order to cross the abyss between the absorbed pump energy (power), shown
by this calculator, and the real energy in the capacitor bank of Your laser, 
You will need to know (or estimate) the efficiency of Your pump system.

  Particularly for solid state lasers You are to know:
*) the efficiency of pump reflector (usually about 50%)
*) the spectral efficiency (how much of lamp light is absorbed by the medium
   usefully). For wide absorbing things, like ruby or LiCAF, it may be as large
   as 30%. For narrow absorbing ones, like Nd in glass or YAG, it is usually
   5..10%.
*) The efficiency of Your lamp. (Typically between 10% and 50%).
  For example the calculator says that (a small) YAG:Nd rod, having 5 mm 
diameter, requires absorbed pump energy =0.0065 J to reach gain of 1.1 
(in other words 10% per pass). To know the needed energy in Your storage 
capacitors, You need to:
*) Divide the result by the efficiency of pump reflector:
    result = absorbed pump energy / efficiency of pump reflector =
                = 0.0065 J / 50% = 0.013 J
*) Divide the result by the spectral efficiency:
    new result = result / spectral efficiency =
                   = 0.013 J / 10% = 0.13 J
*) Divide the result by the lamp efficiency:
    new result = result / lamp efficiency =
                   = 0.13 J / 20% = 0.65 J
  We've finally got, that Your laser should store not less than 0.65 J in
its caps, to have the gain of 10% per pass. (I'd recommend to double the 
result, to take into account the electric losses.) 
  The same goes for the absorbed power (which is essentially the absorbed 
energy divided by the upper laser level lifetime).

  For gas discharge lasers You are to know:
*) The efficiency of electron hit pumping process (how much of energy of
   moving electrons goes to the upper laser level; typically 10..20% for
   far IR lasers like CO2, and 0.1..1% for UV-VIS lasers, like N2 or Cu)
*) The electric efficiency of electric pumping circuit. 
   Need to stress this specifically: usually the electric energy, having
   been absorbed by laser tube (calculated as the electic charge multiplied
   by average voltage drop across the tube) has nothing in common with the 
   energy stored in the capacitors bank (calculated as C*U^2/2, where 
   C - capacity, U - charging voltage). The ratio of the first to the second
   can reach 50% in well designed pump systems, but usually it sits somewhere
   near 10%.

  For example: the calculator says that (a TEA) CO2 laser @760 torr, with its 
laser cell cross section of 1 cm^2, requires absorbed pump energy =0.067 J to 
reach gain of 1.2 (20% per pass in other words). To know the needed energy 
in Your storage capacitors, You need to:
*) Divide the result by the efficiency of electron hit pumping:
    result = absorbed pump energy / efficiency of electron hit pumping =
              = 0.067 J / 20% = 0.335 J
*) Divide the result by the electric efficiency of pump system:
    new result = result / electric efficiency =
                  = 0.335 J / 40% = 0.83 J
  We've finally got, that the laser should store not less than 0.83 J in
its HV caps, to have the gain of 20% per pass.

  For 3-level laser types (like ruby) it is needed that not less than 50% 
of active centers (ions of dopant) be at the excited state for the gain
only to start to build up. The nice relation between the energy, the rod 
diameter and the gain is still intact, provided that You haven't forgotten 
that the stored enegry should now be reckoned not from zero, but from this 
level, where 50% of active centers are excited. To come from the stored energy
to the absorbed pump one, one now needs to know the full number of the active 
centers, so the calculator needs 'rod length' in this case. The correspondent
textbox for input will appear below the gain textbox if You've selected 
a 3-level laser medium. In other cases it is unnecessary.

 Finally the 'calculate' button is used to perform calculations if nothing
was changed. Usually all the calculations are done when user presses 'enter',
and no separate button is needed. But what if You've selected the laser medium
and You are satisfied with the default diameter and stored energy, so You don't
want to change anything? In this case just press 'calculate'. 


MAIN DESIGNATIONS USED IN CODE AND IN INTERFACE ARE:
sigma_las - stimulated emission cross section
lambda_las - main wavelength of laser emission
tau_las - upper laser level lifetime
hv_las - energy of photon at the main wavelength of laser emission
Es - energy of saturation
Is - intensity of saturation
lambda_pump - major wavelength of pump spectrum (for gas discharge lasers
              this value is purely a virtual one);

SOURCES OF INFO:
1) YAG:Nd optimistic: Zverev G.M. Lasers on alumoyttrium garnet with 
     neodymium. M.: Radio i Svyaz, 1985. UDK 621.373.826.038.825
2) YAG:Nd @1.3 um  Zverev G.M. Lasers on alumoyttrium garnet with neodymium.
     M.: Radio i Svyaz, 1985. UDK 621.373.826.038.825
3) Nd Glass on Silicate an Phosphate base: Handbook on lasers. Edited by
     Prokhorov A.M. M,:Sov. Radio, 1978. 
     GLS-1 was choosen as silicate glass and GLS-22 was choosen as phospate
     glass as being most representative. 
4) Ruby - Bela A. Lengyel. Lasers, Second Edition. (C) 1971, by John Wiley & Sons, 
     Inc. ISBN 0 471 52620 7.
5) LISAF, LICAF, LISGAF - www.bjgot.com/crystal_laser/lisaf_cr_properties.htm
6) Rhodamine 6G - W. Brunner, K.Junge. Wissenspeicher Lasertechnik. 
     VEB Fachbuchverlag Leipzig, 1987. ISBN 3-343-00204-6
7) CO2 @ 60 torr - K.R. Nambiar. Lasers: Principles, Types and Applications.
8) CO2 @ 760 torr - calculated by me from [CO2 @ 60 torr] data in an 
     assumption that up to 76 torr CO2 undergoes doppler broadening and from 76 
     to 760 torr it undergoes impact broadening.
9) N2 @ 20 torr - K.R. Nambiar. Lasers: Principles, Types and Applications.
10) N2 @ 760 torr - calculated by me from [N2 @ 20 torr] data in an 
     assumption that up to 50 mbar N2 undergoes doppler broadening and 
     from 50 to 1000 mbar it undergoes impact broadening.
11) Cu @ 510 & 578 nm - K.R. Nambiar. Lasers: Principles, Types and Applications.
12) YLF:Nd - www.bjgot.com/crystal_laser/ylf_nd_properties.htm
13) GSGG:Cr:Nd - E.V. Zharikhov, V.A. Zhitnyuk, I.I. Kuratev et al., Laser on 
      GSGG:Cr3+,Nd3+ Working on 4F3/2 -> 4I9/2 Transition at Room Themperature.
      Izvestia Academii Nauk CCCR, seria physicheskaya, Vol 48 Issue 7, 1984.
      

  The code is freeware, opensource and public domain. It is provided 'as is'
with no warranty. Even without an implied warranty. Its author is not 
responsible for any damage to Your computer or Your health that could arise
due to the usage of this program. The author is also not responsible for any 
possible loss of profit and so on. 
  The calculations performed by the code are very simple, and any skilled 
laserist performs them by hands or even in mind. The assumptions and 
approximations being used are also very rude, making this code more like a toy 
rather than like an instrument of serious engineering. The main purpose of
this software is to lower the threshold of entrance for newbies in the 
field of laser building. So feel free to study the code, find there the 
appropriate formulas, learn them and comprehend them. 

  You can compile the code if needed. This program was written and compiled 
in Lazarus IDE v 1.6.2. Lazarus is Delphi-like free pascal IDE, that provides 
possibility to compile for many platforms, so You should be able to use the 
program under Windows(tm), Linux, MacOs and Android. However I pesonally 
haven't tested these possibilities yet.
  The code is somewhat dirty and it may be bad for portability, scalability 
and code-thieves. Sorry for this. But hey, it is completely open and free! 
Fell free to optimize and clean up as You wish.

						With regards.
						Y.S. (LKlabs)
						Oct. 2020.
Version Info:
v0.2 alfa: YAG:Nd of average and poor quality abandoned. For not to confuse
people in vane. Such crystals are extremely hard to get nowadays, so there
are almost no chances for You to face them.
 