Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://www.ltc.lu/enseignants/mike.anen/pdf/dichte_9de.pdf
- dichteLuft = 0.0012041 --g/cm³
- dichten={
- dichteAlu = 2.700,
- dichteStahl = 7.900,
- }
- pi = math.pi
- print("g to lift")
- io.write("> ")
- gToLift = tonumber(io.read())
- print("dicke der hülle in mm")
- io.write("> ")
- hullThickness = tonumber(io.read())
- i = 0
- print("Welches hüllenmaterial soll verwendet werden?")
- for k,v in pairs(dichten) do
- i = i + 1
- print(i,k,v.."g/cm3")
- end
- io.write(">")
- number = tonumber(io.read())
- i = 0
- for k,v in pairs(dichten) do
- i = i + 1
- if i == number then
- dichteHull = v
- end
- end
- print(dichteHull)
- function doTheFancyShit(m,p1,p2,d) -- masse,dichteLuft,dichteHülle,dickeDerHülle
- -- get volume needet to replace enugh air to lift [m]
- Va = m/p1
- -- get radius of said volume
- r = math.pow(Va/(4/3)/pi,1/3)
- -- get volume of hull
- Vh = (4/3*pi*math.pow(r+d,3)-4/3*pi*math.pow(r,3))
- -- get mass of hull
- Mh = Vh * p2
- return r,Mh
- end
- Mh = 0 -- hull weight is init
- rl = 0 -- last radius
- repeat
- rl = r
- r,Mh = doTheFancyShit(gToLift+Mh,dichteLuft,dichteHull,hullThickness)
- print(r,Mh)
- until rl == r
- print("Radius: "..math.floor(r).."mm")
Advertisement
Add Comment
Please, Sign In to add comment