However, computing the magnetic field and force exerted by ferromagnetic materials in general is difficult for two reasons. First, because the strength of the field varies from point to point in a complicated way, particularly outside the core and in air gaps, where fringing fields and leakage flux must be considered. Second, because the magnetic field B and force are nonlinear functions of the current, depending on the nonlinear relation between B and H for the particular core material used. For precise calculations, computer programs that can produce a model of the magnetic field using the finite element method are employed.