# The force exerted by two mangets in a closed system

So this is actually a two-part question. The graphics I've included are just rough ideas of what I'm thinking:

1. Let's assume we have two bar magnets separated by an air gap of distance $$g$$ and with the top magnet exerting having a magnetic field 5x stronger than the bottom one. For now, let's also assume the poles of each magnet facing each other are the same (repelling). Is there a general formula for calculating the repulsive force felt by each magnet? Like what would be the downward force felt by the bottom magnet and the upward force felt by the top magnet? 1. Okay, so let's also now assume that the two magnets are held in the same physical system: Let's assume that both magnets are in a box - the top one nailed to the ceiling and the bottom one nailed to the floor. Would there be any net upward or downward force acting on the box? Somehow I think the answer is "no" but shouldn't there be a net downward force since the top magnet is substantially stronger than the bottom one?