1. A method for optimizing an illumination condition of a lithographic apparatus by computer simulation using isofocal compensation, the lithographic apparatus comprising an illuminator configured to provide an illumination arrangement, a projection system and a mask having at least one pattern to be printed on a substrate, the method comprising: defining a lithographic pattern to be printed on the substrate; selecting a simulation model; selecting a grid of source points in a pupil plane of the illuminator; calculating separate responses for individual source points, each of the responses representing a result of a single or series of simulations using the simulation model; calculating a metric representing variation of the separate responses for individual source points with defocus; and adjusting an illumination arrangement based on analysis of the metric.