Force between two magnets I have a case where I need to calculate the force per area (pressure) between two flexible magnets of equal shape and dimensions (2000×25×5mm). I'm trying to figure out what strength of each magnet is needed to achieve a predetermined pull force between both magnets, and how does dimensions adjustment affect this calculation. The two magnets are to be stuck onto each other. I've been recently researching on how much force is generated by two magnets stuck together by magnetic attraction, and all I've got are:

Force between two magnetic poles
If both poles are small enough to be represented as single points then they can be considered to be point magnetic charges. Classically, the force between two magnetic poles is given by:
$${\displaystyle F={{\mu q_{m1}q_{m2}} \over {4\pi r^{2}}}}$$
  where
F is force (SI unit: newton)
  qm1 and qm2 are the magnitudes of magnetic poles (SI unit: ampere-meter)
  μ is the permeability of the intervening medium (SI unit: tesla meter per ampere, henry per meter or newton per ampere squared)
  r is the separation (SI unit: meter).
  The pole description is useful to practicing magneticians who design real-world magnets, but real magnets have a pole distribution more complex than a single north and south. Therefore, implementation of the pole idea is not simple. In some cases, one of the more complex formulas given below will be more useful.
Force between two nearby magnetized surfaces of area A 
The mechanical force between two nearby magnetized surfaces can be calculated with the following equation. The equation is valid only for cases in which the effect of fringing is negligible and the volume of the air gap is much smaller than that of the magnetized material, the force for each magnetized surface is:
$${\displaystyle F={\frac {\mu _{0}H^{2}A}{2}}={\frac {B^{2}A}{2\mu _{0}}}}$$
  where:
A is the area of each surface, in m2
  H is their magnetizing field, in A/m.
  μ0 is the permeability of space, which equals $4π×10^{−7}$ T·m/A
  B is the flux density, in T
Link: https://en.m.wikipedia.org/wiki/Force_between_magnets

So my question is, how do I achieve the above stated feat.
 A: The method of poles is valid only when the magnets are far apart, because it replaces extended body by a pair of points and force between these points decays with distance as $1/r^2$. That is, when the points are close, the force becomes arbitrarily high. This does not happen with real magnets, because the poles are not really points and they cannot get as close to each other - mechanical contact and their rigidity will prevent that.
The general method for finding force between permanent magnets (applicable for any shape and position of magnets) is to calculate forces due to magnetic field of the magnet 1 on all magnetic moments composing magnet 2 and sum up those forces.
Mathematically, this means to integrate twice: first to get magnetic field B of magnet 1 at every point of magnet 2, and second to sum up over all elements of magnet 2.
Check out the formula for force $\mathbf F$  between two magnetic moments here:
https://en.wikipedia.org/wiki/Force_between_magnets#Magnetic_dipole-dipole_interaction
For highly symmetrical arrangement this can be integrated by hand, but much easier and more general is to write down a program that calculates the integral numerically. There may be some software available which does that, but if you are not familiar with it and do not plan to do this routinely, chances are it is more valuable to you to write the program yourself.
One possible method for sampling the magnets evenly is the Monte Carlo method; enclose both magnets in as small imaginary rectangular box as possible and then repeatedly pick pairs of points (one in each box) with each having uniform probability distribution in its box. When point happens to land inside a magnet, use it to calculate contribution to net force using abovementioned formula. Magnetic moment of a point should be chosen such that 
$$
\text{number of points used to represent the magnet}\times\text{magnetic moment of a single point} = 
$$
$$= \text{total magnetic moment of the magnet, which is usually magnetization} \times \text{magnet volume}.
$$
