Simultaneous Q-switching and second harmonic generation in KTP is anal
ysed numerically. In this mode of operation, the phase matching condit
ion for second harmonic generation and the half-wave voltage for Q-swi
tching are interrelated. In this paper, this coupled numerical problem
is solved iteratively until a self-consistent solution is obtained. T
he effective refractive index and effective electro-optical coefficien
t along the phase matching direction are defined and calculated in ord
er to estimate the half-wave voltage for Q-switching with KTP. Additio
nally, the application of temperature and wavelength dispersion tuning
to compensate for the constant retardation in this biaxial crystal is
also studied. It is found that the operating temperature of the KTP c
rystal should be stable to within 0.1 degrees C for exact retardation
compensation.