[Tutor] Order Of Operations Question
Alan Gauld
alan.gauld at btinternet.com
Wed Jul 28 19:45:52 CEST 2010
"David Hutto" <smokefloat at gmail.com> wrote
> To check it states that the answer should be app. 10**18kg However,
> and I've checked to make sure that the math I've layed out matches
> up
> with the texts, I get 5.07360705863e+20
A couple of comments but my Physics is a bit rusty!!
> import math
> def atmosphereWeight():
> pi = math.pi
> """Air Pressure (at sea level) P0. This is the long-term average.
> P0 = 1.01325 × 10**5"""
You can express scientific notaton directly:
> airPressCLevl = 1.01325*(10**5)
airPressCLevl = 1.01325e5
> gravity = 9.82
It was 9.81 when I was at school.
Doubt if that accounts for the difference though...
> """We can use g to get the kg of mass from the force of air
> pressure P0. Apply the acceleration of gravity
> (in m/sec2) to the air pressure (in kg · m/sec2).
I'd expect pressure to be in Pa or N/m2 or (Kg*m/s2)/m2 = Kg/ms2?
> mass of the atmosphere in kilograms per
> square meter (kg/m2).
> Mm2 = P0 × g"""
> masAtmoInKgPerSqM = airPressCLevl * gravity
So I'd expect P0/g?
> """Given the mass of air per square meter, we need to know how
> many square meters of surface to apply
> this mass to. Radius of Earth R in meters, m. This is an average
> radius; our planet isn’t a perfect sphere.
> R = 6.37 × 10"""
> avgRadiusEarth = 6.37 * (10**6)
I assume the comment's exponent is wrong?! :-)
> """The area of a Sphere.
> A = 4πr2"""
> areaSphere = 4 * pi * (avgRadiusEarth**2)
> """Mass of atmosphere (in Kg) is the weight per square meter,
> times the number of square meters
> Ma = P0 × g × A"""
> masEarthAtmoInKgPerSqM = airPressCLevl * gravity * areaSphere
Why don't you use the value you calculated above?
Now if you divide by 10 instead of multiplying by 10 you get a
different of 2 in the exponent?
> print(masEarthAtmoInKgPerSqM)
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
More information about the Tutor
mailing list