First comes the theory, which allows you to establish the expected mathematical relationship.
Then experiments decide how well the theory explains observations.
Once your are confident in your equation, you do lots of experiments.
The Higgs boson is the latest example of doing many experiments to calculate something. It turns out the two leading theories were wrong.
Constants themselves arise out of mathematical relationships. For a simple example, to say that “y is proportional to x” is the same as saying y = kx for some constant k. So when certain relationships or equations are posited, the constants naturally come along with them. These relationships are then tested by experiments, and either the value of the constant is measured, or the relationship can be disproven.
Measurement, guesswork, and agreement.
Take *g*, the agreed-upon value for the net acceleration towards Earth’s center. It was first established by measurements done in Paris, simply by dropping objects and measuring how fast they accelerated. At the time, it was known that this acceleration would differ depending on where in the world one is, so the measured value was adjusted by an estimated amount to account for elevation and distance from the equator.
Further measurements and understanding of physics have led to our current state of understanding; we know to within a very close degree of error the exact value for any point on earth. But we still need a constant for general reference, so the international scientific community has come to an agreed-upon value of 9.80665 m/s^2 for *g*, despite the fact that nowhere on earth has that exact value.
Latest Answers