This code implements the change of shape of a balloon depending on the altitude (from 15000 to 25000 meters) and set of design parameters.
The basis of this method is the numerical solution of a system of differential equations. The Solve(params) function from solve.py
solves a system of 6 differential equations describing the shape of a balloon depending on the height and parameters
where
The initial conditions are following:
where
More about this system of differential equations you can find in these papers:
Baginski, F., Winker, J. The natural shape balloon and related models
Baginski, F., On the Design and Analysis of Inflated Membranes: Natural and Pumpkin Shaped Balloons
To find the optimal parameters simple_search.py
). We calculate the output mass of LTA gas for that system and compare with theoretical mass of LTA gas. If the difference is 0 (with fixed accuracy) we can approve that the desired solution is found.
-
params.py
: the list of parameters -
calculate_rp.py
: calculate rp(s) function - pumpkin shape balloon radius depends on s -
density.py
: calculate atmosphere and gas density, air pressure and gas temperature depends on the current altitude -
solve.py
: the whole process to calculate the shape of the balloon (system's solver) -
simple_search.py
: calculate optimal$\theta_0$ ,$p_0$ and$r_{max}$ for fixed velocity -
main.py
: whole process to determine the natural shape, velocity, and volume of the balloon minimizing the difference between computed and theoretical mass of LTA gas -
requirements.txt
: used versions of python libraries -
plots
: visual outputs of experiments -
results
: text and data outputs of experiments
We set the range for
After that, we synchronize maximal radius of the balloon on the current altitude, call the solver again with finded
We continue whole this process until
To launch the code you need to run the following:
python main.py --height [HEIGHT]
At the output we get the txt file with complete information about the state of the balloon at the given altitude, csv file with lists of z and r (for future calculations) and svg file with a plot of z vs r.
The following information is written to the text file:
- Parameters
$\theta_0$ and$p_0$ that define the shape of the balloon - Last values of
$\theta$ (should be ~-90 degrees with given tolerance), r (~0 meters with given tolerance) - Maximal radius of the balloon on this altitude
- Volume of the balloon
- Difference between input and output mass of the LTA gas (should be ~0 kg with given tolerance)
- Differences between all forces (should be ~0)
- Input and output values of velocities and difference between them (should be ~0 m/s)
python main.py --height 15000
-
Output result with following tolerances: for
$m_{gas}$ - 0.00001, for$\theta_{last}$ - 0.001, for$r_{last}$ - 0.001:_______________________height = 15000 _______________________
theta0: 1.2193599999999996 , p0: -14.070000000000002
Maximum radius: 3.141763547349405
Last theta: -89.99932706371716 , Last R: 0.0009499022133381274
___________________________________________________________________
Volume of the balloon: 130.02809101854612
Difference between m_gas and calculated m_gas: -4.6893540042169946e-06
Difference betweend Fa and Fg: 11.941509621322496
Difference between all forces {(Fa - Fg) + F_drag}: -1.7763568394002505e-15
Input velocity of the balloon: 2.902734375
Output velocity of the balloon: 2.90095174903956
Difference between input and output velocities: 0.0017826259604398764
Running time: 367.29792070388794 s -
Data of zs and rs for future calculations: (the top part of table)
z, r
0.0, 0.0
0.0009997735499952865, 2.1280242710555148e-05
0.0019995470996851034, 4.25604997725486e-05
0.002999320648764043, 6.38407855342987e-05
0.00399909419692677, 8.512111434072787e-05
0.004998867743868021, 0.00010640150053337178
0.0059986412892825995, 0.00012768195845038794
0.006998414832865382, 0.0001489625024265649
0.007998188374311307, 0.00017024314679333057
0.008997961913315387, 0.00019152390587876152 -
Plot of z vs r: