# How Flight Works 8, Exercise 2: what a wrong pressure setting does to an altimeter # An altimeter measures air pressure and converts it to height with the standard model. # If the pressure setting is off by some hPa, every height it shows is off by a fixed amount. def height(p_hpa): return 44331.5 * (1 - (p_hpa / 1013.25) ** (1 / 5.25588)) for off in (1, 5, 10, 20): err = height(1013.25 - off) - height(1013.25) print("setting off by", off, "hPa -> height error about", round(err), "m (", round(err * 3.281), "ft )") # Output when run: # setting off by 1 hPa -> height error about 8 m ( 27 ft ) # setting off by 5 hPa -> height error about 42 m ( 137 ft ) # setting off by 10 hPa -> height error about 84 m ( 274 ft ) # setting off by 20 hPa -> height error about 168 m ( 551 ft ) # # The error is about 8 m for every 1 hPa, so a slip of a few hPa matters when the # ground is close. This is why pilots set the local pressure on the altimeter # and cross-check it, and why the setting appears in the checklist.