Wednesday, July 7, 2021

Python Library for Calculation of Balloon Properties

I have now put up a python library with numerical implementations of the fundamental relationships for pressure, volume, mass, etc. of a gravity balloon.

https://github.com/AlanCoding/gravitational-balloon-mathematics

The old work on this blog was done largely in an Excel spreadsheet with macros. In terms of the library of methods, I feel that the python version is now better and more correct. Some library methods haven't yet been converted, but the important ones will, and that should go quite fast.

Doing this allows me to put work in Juypter notebooks, which is much better for sharing my work down to the numerical implementation. For a demo, I have re-done the graphs for the PR and PV curve.


These are showing the same thing as the prior post did:

https://gravitationalballoon.blogspot.com/2013/03/gravity-balloon-pressure-volume-curve.html

That had some errors in it, and I'm now confident those are corrected.

The python library is much much easier to understand and modify, and any further improvements will become considerably faster.

I already have a few new fun ideas. I tried very hard to write these as numerical solvers. This gives a lot of flexibility to modify the equations themselves. This easily opens the door to include things like gravitation from the air inside. It might even be practical to make the same equations apply to the super-large case where I account for drop in air pressure away from the center.

2 comments:

  1. Nice work Alan. However I do wonder if there's any stable gravitational pressure differentials in an enclosed sub-Jeans Mass of real gases. Modified Lane-Embden equation models of such seem to indicate otherwise (took some tracking down in the literature!)

    ReplyDelete
    Replies
    1. My equations were treating these as a iosthermal gas.

      https://github.com/AlanCoding/gravitational-balloon-mathematics/blob/master/content/Air%20Pressure%20Effects.ipynb

      This won't render in a comment, but I'll paste the relevant equation here anyway.

      $$ P'(r) = - \frac{P(r) g(r)}{R_{sp} T } \\
      g'(r) = \frac{ 4 G \pi }{ R_{sp} T } P(r) - \frac{ 2 g(r) }{ r } $$

      Your Lane-Embden reference points me to the Emden–Chandrasekhar equation, which says that the thing I'm integrating should just be... the Poisson equation.

      I'm perfectly willing to accept this outcome, I never claimed that this was a complicated system.

      Delete