cdeagle Senior Member
 Joined: 22/06/2014 Location: United StatesPosts: 266 |
| Posted: 03:16am 25 Mar 2017 |
Copy link to clipboard |
 Print this post |
|
BALLOON is a program which can be used to determine the performance capability of hot air balloons. The payload weight lifting capability, gas temperature, balloon volume and the maximum altitude capability can be determined accurately with this program. BALLOON requires a combination of the following user inputs;
(1) launch site altitude and temperature (2) liftoff weight (3) balloon volume (4) gas temperature (5) flight altitude From any combination of three items (2, 3, 4 or 5), program BALLOON provides the user with the fourth item. This program also computes the air temperature at the balloon's altitude. The launch site altitude and temperature are required in order to compensate for "non-sea level" conditions such as hot or cold days and flying locations which may not be at sea level.
Here's a typical user interaction with the software.
program balloon --------------- please input the launch site altitude (meters) ? 0 please input the launch site temperature (degrees f) ? 59 performance menu < 1 > gross weight capability < 2 > gas temperature required < 3 > balloon volume required < 4 > maximum altitude capability selection ? 4 please input the gross weight (kilograms) ? 250 please input the balloon volume (cubic meters) ? 1500 please input the gas temperature (degrees f) ? 275 program balloon --------------- gross weight 250.00 kilograms balloon volume 1500.00 cubic meters gas temperature 275.00 degrees f altitude 11157.24 meters ambient temperature -69.70 degrees f
Here's the same example except the balloon is launched on a "high altitude, hot day". For improved performance, hot air balloons in Colorado are launched early in the morning.
program balloon --------------- please input the launch site altitude (meters) ? 1644 please input the launch site temperature (degrees f) ? 90 performance menu < 1 > gross weight capability < 2 > gas temperature required < 3 > balloon volume required < 4 > maximum altitude capability selection ? 4 please input the gross weight (kilograms) ? 250 please input the balloon volume (cubic meters) ? 1500 please input the gas temperature (degrees f) ? 275 program balloon --------------- gross weight 250.00 kilograms balloon volume 1500.00 cubic meters gas temperature 275.00 degrees f altitude 7718.56 meters ambient temperature -5.70 degrees f
Here's the MMBASIC cource code for this program.
' program balloon.bas march 25, 2017 ' determines performance capability of hot air balloons ' gross weight capability, kilograms ' gas temperature required, degrees fahrenheit ' balloon volume required, cubic meters ' maximum altitude capability, meters ' MicroMite eXtreme version '''''''''''''''''''''''''''' option default float dim weight, volume, gastemp, altitude dim rho, rhoamb, gtempabs, tambabs, tsiteabs const altitude0 = 10999.9272 const rhosl = 1.22557 print " " print "program balloon" print "---------------" print " " print "please input the launch site altitude (meters)" input altsite print " " print "please input the launch site temperature (degrees f)" input tempsite ' determine launch site ambient density and absolute temperature rho = rhosl * fnb(altsite) ^ 4.256116 / (1.0 + (tempsite - 59.0) / 518.67) tsiteabs = fna(tempsite) ' print menu and prompt user for selection do print " " print "performance menu" print " " print " " print " < 1 > gross weight capability" print " " print " < 2 > gas temperature required" print " " print " < 3 > balloon volume required" print " " print " < 4 > maximum altitude capability" print " " print " " print "selection" input selection% loop until (selection% >= 1 and selection% <= 4) select case selection% case 1 gweight case 2 trequired case 3 vrequired case 4 maxalt end select ' print results print " " print "program balloon" print "---------------" print " " print "gross weight ", str$(weight, 0, 2), " kilograms" print " " print "balloon volume ", str$(volume, 0, 2), " cubic meters" print " " print "gas temperature ", str$(gastemp, 0, 2), " degrees f" print " " print "altitude ", str$(altitude, 0, 2), " meters" print " " print "ambient temperature ", str$(fnc(tambabs), 0, 2), " degrees f" print " " end '''''''''''''''''''''' function fna(x) as float fna = 5.0 * (x + 459.67) / 9.0 end function '''''''''''''''''''''' function fnb(x) as float fnb = (1.0 - 0.000022556913 * x) end function '''''''''''''''''''''' function fnc(x) as float fnc = 9.0 * x / 5.0 - 459.67 end function ''''''' sub atmos ' ambient density and absolute temperature subroutine if (altitude < altitude0) then a = fnb(altitude) rhoamb = rho * a ^ 4.256116 tambabs = a * tsiteabs else rhoamb = 0.297122 * rho * exp(1.73454773 - 0.0001576872 * altitude) tambabs = 216.65 end if end sub '''''''''''''' sub get_altitude ' request altitude subroutine do print " " print "altitude (meters)" input altitude loop until (altitude > 0.0) end sub ''''''''''''' sub get_gastemp ' request gas temperature subroutine do print " " print "please input the gas temperature (degrees f)" input gastemp loop until (gastemp > 0.0) gtempabs = fna(gastemp) end sub '''''''''''' sub get_volume ' request balloon volume subroutine do print " " print "please input the balloon volume (cubic meters)" input volume loop until (volume > 0.0) end sub '''''''''''' sub get_weight ' request gross weight subroutine do print " " print "please input the gross weight (kilograms)" input weight loop until (weight > 0.0) end sub ''''''''' sub gweight ' gross weight capability subroutine print " " get_volume get_gastemp get_altitude atmos weight = volume * rhoamb * (1.0 - tambabs / gtempabs) end sub '''''''' sub maxalt ' maximum altitude subroutine print " " get_weight get_volume get_gastemp x0 = 0.0 x2 = 3.0 * altitude0 altitude = 0.0 wfunction(wf0) if (wf0 <= 0.0) then print " " print "cannot lift this weight !!" exit sub end if do x1 = 0.5 * (x0 + x2) altitude = x0 wfunction(f0) altitude = x1 wfunction(f1) altitude = x2 wfunction(f2) a = x1 - x0 b = f1 / f0 c = b * b - f2 / f0 x3 = x1 + a * b / sqr(c) altitude = x3 if (abs(x3 - x2) < 0.1) then exit do wfunction(f3) if (f3 * f1 < 0.0) then x0 = x1 if (f3 * f2 < 0.0) then x0 = x2 x2 = x3 loop end sub ''''''''''' sub trequired ' gas temperature required subroutine print " " get_weight get_volume get_altitude atmos a = volume * rhoamb gtempabs = a * tambabs / (a - weight) gastemp = fnc(gtempabs) end sub ''''''''''' sub vrequired ' balloon volume required subroutine print " " get_weight get_gastemp get_altitude atmos volume = weight / (rhoamb * (1.0 - tambabs / gtempabs)) end sub '''''''''''''''' sub wfunction (wf) ' weight function subroutine atmos wf = volume * rhoamb * (1.0 - tambabs / gtempabs) - weight end sub
|