Module:Sandbox/Wnt

local p = {}

increment = 10 -- in meters  Basis is meters and kilograms throughout.
G = 6.674E-11 -- 6.674×10−11 N⋅m2/kg2
M = 1E24

function localg (r)
	-- black hole has gravity GM / r2
	return M * G / (r*r)
end

function deltapressure (pressure, gravity)
	-- for a given global increment, return the increase in pressure in atm, pressure in gs
    -- density of "air" per pressure in atm is (1.225 kg/m3) / atm
    -- pressure of air is 101325 newton / m2 at 1 atm
    -- newton weight is kg * gravity
    -- so x atm of pressure weigh x * gravity * 1225 kg per kilometer per square meter
    return pressure * gravity * 0.001225 * increment
end

function p.main (frame)
	-- we SHOULD start at the "exobase", which on Earth is roughly 7000 km from the center
	-- I am not finding decent figures for exosphere pressure
	-- for now let's calculate from an arbitrary (too high) 1 pascal and see from there what the dependence is
	-- exobase equivalent is where GM/r = same as on Earth, i.e. r = 7000 km * M / mass of Earth
	local r = 7000000 * M / 5.97237E24 -- kg, mass of Earth
	local p = 1 -- arbitrary 1 pascal
	local it = 0
	output = "radius gravity pressure"
	repeat
		it = it + 1
	    p = p + deltapressure (p, localg(r))
	    r = r - increment
	    output = output .. r .. "," .. localg(r) .. "," .. p .. "<br />"
	until (it > 100 or r<0)
	return output
end
return p

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.