so far I've found out the formula for force between two permanent magnets and it states that the force is directly proportional to the product of their flux densities at poles. Now my doubt is that can we use the same formula by substituting the value of flux density and other parameters of solenoid instead of magnet.