A finite difference program is described which calculates the magnetic field strength and flux density in a turbogenerator. The mathematical model incorporates solid or laminated iron components with non-linear permeabilities. The fields are evaluated in the r-z plane and vary periodically in the circumferential direction. The program is therefore well suited to three-dimensional end region problems. Use of the program shows how the leakage fields at the core back of a generator vary when radial cooling ducts are introduced. The importance of this for different duct configurations and generator operating voltage is evaluated.