# Lead balloon

**URL:** <https://discourse.julialang.org/t/lead-balloon/58729>\
**Category:** Offtopic\
**Created:** [April 7, 2021, 4:51am UTC](https://discourse.julialang.org/t/lead-balloon/58729 "2021-04-07T04:51:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [April 7, 2021, 4:51am UTC](https://discourse.julialang.org/t/lead-balloon/58729/1 "2021-04-07T04:51:27Z")

</div>

[_Mythbusters_ made a lead balloon](https://www.youtube.com/watch?v=HZSkM-QEeUg) and I wanted to reproduce it.

```julia
using Unitful
using GeometryBasics
using PeriodicTable
using PhysicalConstants.CODATA2018: g_n

struct Shell
    inner
    thickness
end

struct Object
    shape
    material
end

GeometryBasics.volume(s::Sphere) = (4/3)π * s.r^3
GeometryBasics.volume(s::Shell) = volume(Sphere(p0, s.inner.r + s.thickness)) - volume(s.inner)
buoyancy(x::Object) = volume(x.shape) * x.material.density * g_n

p0 = Point(0.0u"m", 0.0u"m", 0.0u"m")
radius = 2u"m"
thickness = .0007u"inch"
substance = elements["lead"]
fluid = elements["helium"]

balloon = Object(Shell(Sphere(p0, radius), thickness), substance)
interior = Object(balloon.shape.inner, fluid)
upreferred.([buoyancy(balloon), buoyancy(interior)])

```

```julia
julia> upreferred.([buoyancy(balloon), buoyancy(interior)])
2-element Array{Quantity{Float64,𝐋 𝐌 𝐓^-2,Unitful.FreeUnits{(kg, m, s^-2),𝐋 𝐌 𝐓^-2,nothing}},1}:
 99.38920184883817 kg m s^-2
 58692.24563097477 kg m s^-2

```

I thought these two numbers would be the net force on the balloon and the contents, respectively, and that they would be similar. What did I do wrong?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [April 7, 2021, 5:01am UTC](https://discourse.julialang.org/t/lead-balloon/58729/2 "2021-04-07T05:01:51Z")

</div>

Area of the sphere is not proportional to radius cubed is it?

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [April 7, 2021, 5:05am UTC](https://discourse.julialang.org/t/lead-balloon/58729/3 "2021-04-07T05:05:45Z")

</div>

That’s a typo yeah, but actually I’m not using that function. (Edited to delete it.)

---

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [April 7, 2021, 6:39am UTC](https://discourse.julialang.org/t/lead-balloon/58729/4 "2021-04-07T06:39:28Z")

</div>

> [@jzr](#):
>
> and that they would be similar

Why did you think that they would be similar? The volume of the “balloon” (i.e. the shell without its interior) could be much smaller than the volume of the interior of the inflated balloon. (A deflated balloon is usually much smaller than half the volume of an inflated balloon.)

> [@jzr](#):
>
> What did I do wrong?

You have defined `buoyancy(x::Object)` but the buoyancy does not only depend on the object, but also on the fluid that surrounds it. (Your function computes the weight.)
