An evolutionary algorithm was applied to a mechanistic model of the mammary gland to find the parameter values that minimised the difference between predicted and actual lactation curves of milk yields in New Zealand Jersey cattle managed at different feeding levels. The effect of feeding level, genetic merit, body condition score at parturition and age on total lactation yields of milk, fat and protein, days in milk, live weight and evolutionary algorithm derived mammary gland parameters was then determined using a multiple regression model. The mechanistic model of the mammary gland was able to fit lactation curves that corresponded to actual lactation curves with a high degree of accuracy. The senescence rate of quiescent (inactive) alveoli was highest at the very low feeding level. The active alveoli population at peak lactation was highest at very low feeding levels, but lower nutritional status at this feeding level prevented high milk yields from being achieved. Genetic merit had a significant linear effect on the active alveoli population at peak and mid to late lactation, with higher values in animals, which had higher breeding values for milk yields. A type of genetic merit × feeding level scaling effect was observed for total yields of milk and fat, and total number of alveoli produced from conception until the end of lactation with the benefits of increases in genetic merit being greater at high feeding levels. A genetic merit × age scaling effect was observed for total lactation protein yields. Initial rates of differentiation of progenitor cells declined with age. Production levels of alveoli from conception to the end of lactation were lowest in 5- to 8-year-old animals; however, in these older animals, quiescent alveoli were reactivated more frequently. The active alveoli population at peak lactation and rates of active alveoli proceeding to quiescence were highest in animals of intermediate body condition scores of 4.0 to 5.0. The results illustrate the potential uses of a mechanistic model of the mammary gland to fit a lactation curve and to quantify the effects of feeding level, genetic merit, body condition score, and age on mammary gland dynamics throughout lactation.