diff --git a/06_gravity.Rmd b/06_gravity.Rmd
index 34037aec..e69a2ad0 100644
--- a/06_gravity.Rmd
+++ b/06_gravity.Rmd
@@ -1,4 +1,4 @@
-# Escaping from Mars
+# Escaping from Mars - An example to estimate trajectories
```{julia chap_6_libraries, cache = FALSE, results = FALSE, echo=FALSE}
cd("./06_gravity/")
@@ -16,6 +16,8 @@ piece of information: the escaping velocity from the planet.
What on Mars is the escape velocity?
+## Problem formulation and underlying premises
+
We are going to use the same experiment that Newton thought when thinking about escaping from the gravity of Earth. Gravity pulls us down,
so if we shoot a cannonball, as in the sketch shown below, what will happen? For some velocities, the cannonball will return to Earth, but
there's a velocity at which it scapes since the gravitational pull is not enough to bring it back to the surface. That velocity is called
@@ -40,21 +42,14 @@ of the planet at its surface. So we decide to make an experiment and gather some
We are going to calculate the constant $g_{mars}$ just throwing stones. We are going to explain a bit the equations regarding the experiment.
The topic we need to revisit is Proyectile Motion.
-## Proyectile Motion
-Gravity pulls us down to Earth, or in our case, to Mars. This means that we have an acceletation, since there is a force. Recalling the
-newton equation:
-
+## Proyectile equations of motion
+Gravity pulls objects down to Earth, or in our case, to Mars. Recall Newton's second law:
$\overrightarrow{F} = m * \overrightarrow{a}$
-where $m$ is the mass of the object, $\overrightarrow{F}$ is the force(it's what make us fall) and $\overrightarrow{a}$ is the acceleration, in
-our case is what we call gravity $\overrightarrow{g}$.
-The arrow $\overrightarrow{}$ over the letter means that the quantity has a direction in space, in our case, gravity is pointing to the center of
-the Earth, or Mars.
-
-*How can we derive the motion of the stones with that equation?*
+where $m$ is the mass of the object, $\overrightarrow{F}$ is the force (what make things fall) and $\overrightarrow{a}$ is the acceleration. For the particular case of an object being attracted to a much more massive one, we call this acceleration the gravity $\overrightarrow{g}$.
+The arrow $\overrightarrow{}$ over the letter means that the quantity has a direction in space, in our case, gravity points to the center of the Earth or Mars.
-In the figure below we show a sketch of the problem: We have the 2 axis, $x$ and $y$, the $x$ axis is parallel to the ground and the $y$ axis
-is perpendicular, pointing to the sky. We also draw the initial velocity $v_0$ of the proyectile, and the angle $\theta$ with respect to the ground.
+In the figure below we show a sketch of the problem: We have the two axis, $x$ and $y$, the $x$ axis is parallel to the ground and the $y$ axis is perpendicular, pointing to the sky. We also draw the initial velocity $v_0$ of the proyectile, and the angle $\theta$ with respect to the ground.
Also it's important to notice that the gravity points in the opposite direction of the $y$ axis.
```{julia chap_6_plot_2, echo=FALSE}
@@ -62,26 +57,19 @@ im_1 = load("./06_gravity/images/trajectory.png");
plot(im_1, axis=nothing,border=:none)
```
-*But what is the trajectory of the projectile? and how do the coordinates x and y evolve with time?*
-
-If we remember from school, the equations of $x$ and $y$ over time is:
+The equations of motion for an object with acceleration only in the $y$ axis are given by:
$x(t) = v_0*t*cos(θ)$
-
$y(t) = v_0*t*sin(θ) -\frac{g*t^2}{2}$
-where $t$ is the time at which we want to know the coordinates.
-
-*What do these equations tell us?*
-If we see the evolution of the projectile in the $x$ axis only, it follows a straight line (until it hits the ground) and in the $y$ axis the
-movement follows a parabola, but how do we interpret that?
+In other words, the for each time $t$, this equations give the $x$ and $y$ coordinates of a simple object.
-We can imagine what happens if we trow a stone to the sky: the stone starts to go up and then, at some point, it reaches the highest position it
-can go. Then, the stone starts to go down.
+If we focus on the evolution of the projectile in the $x$ axis alone, it follows a straight line (until it hits the ground) and in the $y$ axis the motion follows a parabola.
+We can imagine what happens if we throw a stone to the sky: the stone goes up and then, at some point, it reaches it's highest position and starts going down.
*How does the velocity evolve in this trajectory?*
-Since the begining, the velocity starts decreasing until it has the value of 0 at the highest point, where the stone stops for a moment, then it
+the velocity starts decreasing until it has the value of 0 at the highest point, where the stone stops for a moment, then it
changes its direction and start to increase again, pointing towards the ground. Ploting the evolution of the height of the stone, we obtain
the plot shown below. We see that, at the begining the stone starts to go up fast and then it slows down. We see that for each value of $y$
there are 2 values of $t$ that satisfies the equation, thats because the stone pass twice for each point, except for the highest value of $y$.
@@ -102,17 +90,14 @@ Those two equations are the ones plotted in the previous sketch, a parabola and
2 directions, but with the same magnitude. So keep in mind that when you throw an object to the sky, when it returns to you, the velocity will
be the same with the one you threw it.
-## Calculating the constant g of Mars
-Now that we have understood the equations we will work with, we ask:
+## Experimentation: Calculating the gravity constant of Mars
-*how do we set the experiment and what do we need to measure?*
+With the equations presented, we are now able to set up an experiment. The steps involved will be as follows:
+- One person will throw stones with an angle.
+- Another person will be far, measuring the time it takes the stone to hit the ground as well as
+the distance $Δx$ the stoned travelled.
-The experiment set up will go like this:
-- One person will be throwing stones with an angle.
-- The other person will be far, watching from some distance, measuring the time since the other throw the stone and it hits the ground. The other
-measurement we will need is the distance Δx the stone travelled.
-- Also, for the first iteration of the experiment, suppose we only keep the measurements with an initial angle θ~45° (we will loosen this
-constrain in a bit).
+For the first iteration of the experiment, we will keep the initial angle θ~45°. We will loosen this constraint later.
```{julia chap_6_plot_4, echo=FALSE}
im = load("./06_gravity/images/sketch_2.png");
@@ -147,7 +132,7 @@ $Δx=t_{f}*v_{0}*cos(θ)$
where Δx is the distance traveled by the stone.
- So, solving for $v_{0}$, the initial velocity, an unknown quantity, we have:
+So, solving for $v_{0}$, the initial velocity, an unknown quantity, we have:
$v_{0}=\frac{Δx}{t_{f}cos(θ)}$
diff --git a/06_gravity/Manifest.toml b/06_gravity/Manifest.toml
index a838b539..036bdf6a 100644
--- a/06_gravity/Manifest.toml
+++ b/06_gravity/Manifest.toml
@@ -30,16 +30,16 @@ uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.6.1"
[[AdvancedHMC]]
-deps = ["AbstractMCMC", "ArgCheck", "DocStringExtensions", "InplaceOps", "LinearAlgebra", "LogDensityProblems", "LogDensityProblemsAD", "ProgressMeter", "Random", "Requires", "Setfield", "Statistics", "StatsBase", "StatsFuns", "UnPack"]
-git-tree-sha1 = "c4a73dfdcce33e17c27b8063eae825fc15631cf8"
+deps = ["AbstractMCMC", "ArgCheck", "DocStringExtensions", "InplaceOps", "LinearAlgebra", "LogDensityProblems", "LogDensityProblemsAD", "ProgressMeter", "Random", "Requires", "Setfield", "SimpleUnPack", "Statistics", "StatsBase", "StatsFuns"]
+git-tree-sha1 = "25d38b80e29533f5f85af19692a39e4275047a51"
uuid = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
-version = "0.4.3"
+version = "0.4.5"
[[AdvancedMH]]
deps = ["AbstractMCMC", "Distributions", "LogDensityProblems", "Random", "Requires"]
-git-tree-sha1 = "dffd459dbda082ef129c4e897dde2373c64771d2"
+git-tree-sha1 = "165af834eee68d0a96c58daa950ddf0b3f45f608"
uuid = "5b7e9947-ddc0-4b3f-9b55-0d8042f74170"
-version = "0.7.2"
+version = "0.7.4"
[[AdvancedPS]]
deps = ["AbstractMCMC", "Distributions", "Libtask", "Random", "Random123", "StatsFuns"]
@@ -82,13 +82,19 @@ version = "3.5.1+1"
[[ArrayInterface]]
deps = ["Adapt", "LinearAlgebra", "Requires", "SnoopPrecompile", "SparseArrays", "SuiteSparse"]
-git-tree-sha1 = "a89acc90c551067cd84119ff018619a1a76c6277"
+git-tree-sha1 = "38911c7737e123b28182d89027f4216cfc8a9da7"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
-version = "7.2.1"
+version = "7.4.3"
[[Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
+[[Atomix]]
+deps = ["UnsafeAtomics"]
+git-tree-sha1 = "c06a868224ecba914baa6942988e2f2aade419be"
+uuid = "a9b6321e-bd34-4604-b9c9-b65b8de01458"
+version = "0.1.0"
+
[[AxisAlgorithms]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"]
git-tree-sha1 = "66771c8d21c8ff5e3a93379480a2307ac36863f7"
@@ -117,9 +123,9 @@ version = "0.1.1"
[[Bijectors]]
deps = ["ArgCheck", "ChainRulesCore", "ChangesOfVariables", "Compat", "Distributions", "Functors", "InverseFunctions", "IrrationalConstants", "LinearAlgebra", "LogExpFunctions", "MappedArrays", "Random", "Reexport", "Requires", "Roots", "SparseArrays", "Statistics"]
-git-tree-sha1 = "4f8d8df1f690c44e46464266ec928aaa5aabb299"
+git-tree-sha1 = "1234b03e94938e6f2b14834dfd3ef45698d5e14f"
uuid = "76274a88-744f-5084-9051-94815aaf08c4"
-version = "0.10.7"
+version = "0.10.8"
[[Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
@@ -170,9 +176,9 @@ version = "0.1.6"
[[Clustering]]
deps = ["Distances", "LinearAlgebra", "NearestNeighbors", "Printf", "Random", "SparseArrays", "Statistics", "StatsBase"]
-git-tree-sha1 = "64df3da1d2a26f4de23871cd1b6482bb68092bd5"
+git-tree-sha1 = "7ebbd653f74504447f1c33b91cd706a69a1b189f"
uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
-version = "0.14.3"
+version = "0.14.4"
[[ColorSchemes]]
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Random", "SnoopPrecompile"]
@@ -333,15 +339,15 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[Distributions]]
deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"]
-git-tree-sha1 = "da9e1a9058f8d3eec3a8c9fe4faacfb89180066b"
+git-tree-sha1 = "13027f188d26206b9e7b863036f87d2f2e7d013a"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
-version = "0.25.86"
+version = "0.25.87"
[[DistributionsAD]]
deps = ["Adapt", "ChainRules", "ChainRulesCore", "Compat", "DiffRules", "Distributions", "FillArrays", "LinearAlgebra", "NaNMath", "PDMats", "Random", "Requires", "SpecialFunctions", "StaticArrays", "StatsBase", "StatsFuns", "ZygoteRules"]
-git-tree-sha1 = "0c139e48a8cea06c6ecbbec19d3ebc5dcbd7870d"
+git-tree-sha1 = "c2ecd634010e6952ce642db65b5885c41cb307b0"
uuid = "ced4e74d-a319-5a8a-b0ac-84af2272839c"
-version = "0.6.43"
+version = "0.6.44"
[[DocStringExtensions]]
deps = ["LibGit2"]
@@ -429,9 +435,9 @@ uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
[[FillArrays]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"]
-git-tree-sha1 = "d3ba08ab64bdfd27234d3f61956c966266757fe6"
+git-tree-sha1 = "fc86b4fd3eff76c3ce4f5e96e2fdfa6282722885"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
-version = "0.13.7"
+version = "1.0.0"
[[FixedPointNumbers]]
deps = ["Statistics"]
@@ -504,15 +510,15 @@ version = "0.1.4"
[[GR]]
deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Pkg", "Preferences", "Printf", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "UUIDs", "p7zip_jll"]
-git-tree-sha1 = "660b2ea2ec2b010bb02823c6d0ff6afd9bdc5c16"
+git-tree-sha1 = "011a22022ed2fb0352a9bded0fa9d3793a8db362"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
-version = "0.71.7"
+version = "0.72.1"
[[GR_jll]]
deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt5Base_jll", "Zlib_jll", "libpng_jll"]
-git-tree-sha1 = "d5e1fd17ac7f3aa4c5287a61ee28d4f8b8e98873"
+git-tree-sha1 = "7ea8ead860c85b27e83d198ea54bb2f387db9fc3"
uuid = "d2c73de3-f751-5644-a686-071e5b155ba9"
-version = "0.71.7+0"
+version = "0.72.1+1"
[[Gettext_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"]
@@ -568,10 +574,10 @@ uuid = "2e76f6c2-a576-52d4-95c1-20adfe4de566"
version = "2.8.1+1"
[[HypergeometricFunctions]]
-deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions", "Test"]
-git-tree-sha1 = "709d864e3ed6e3545230601f94e11ebc65994641"
+deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"]
+git-tree-sha1 = "432b5b03176f8182bd6841fbfc42c718506a2d5f"
uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
-version = "0.3.11"
+version = "0.3.15"
[[ImageAxes]]
deps = ["AxisArrays", "ImageBase", "ImageCore", "Reexport", "SimpleTraits"]
@@ -670,10 +676,10 @@ uuid = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
version = "0.25.2"
[[Imath_jll]]
-deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "87f7662e03a649cffa2e05bf19c303e168732d3e"
+deps = ["Artifacts", "JLLWrappers", "Libdl"]
+git-tree-sha1 = "3d09a9f60edf77f8a4d99f9e015e8fbf9989605d"
uuid = "905a6f67-0a94-5f89-b386-d35d92009cd1"
-version = "3.1.2+0"
+version = "3.1.7+0"
[[IndirectArrays]]
git-tree-sha1 = "012e604e1c7458645cb8b436f8fba789a51b257f"
@@ -709,9 +715,9 @@ version = "0.1.5"
[[IntelOpenMP_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "d979e54b71da82f3a65b62553da4fc3d18c9004c"
+git-tree-sha1 = "0cb9352ef2e01574eeebdb102948a58740dcaf83"
uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0"
-version = "2018.0.3+2"
+version = "2023.1.0+0"
[[InteractiveUtils]]
deps = ["Markdown"]
@@ -736,14 +742,14 @@ uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
version = "0.1.8"
[[InvertedIndices]]
-git-tree-sha1 = "82aec7a3dd64f4d9584659dc0b62ef7db2ef3e19"
+git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038"
uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
-version = "1.2.0"
+version = "1.3.0"
[[IrrationalConstants]]
-git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151"
+git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2"
uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
-version = "0.1.1"
+version = "0.2.2"
[[IterTools]]
git-tree-sha1 = "fa6287a4469f5e048d763df38279ee729fbd44e5"
@@ -775,9 +781,9 @@ version = "1.4.1"
[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
-git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e"
+git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
-version = "0.21.3"
+version = "0.21.4"
[[JpegTurbo]]
deps = ["CEnum", "FileIO", "ImageCore", "JpegTurbo_jll", "TOML"]
@@ -791,6 +797,12 @@ git-tree-sha1 = "6f2675ef130a300a112286de91973805fcc5ffbc"
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
version = "2.1.91+0"
+[[KernelAbstractions]]
+deps = ["Adapt", "Atomix", "InteractiveUtils", "LinearAlgebra", "MacroTools", "SnoopPrecompile", "SparseArrays", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"]
+git-tree-sha1 = "976231af02176082fb266a9f96a59da51fcacf20"
+uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
+version = "0.9.2"
+
[[KernelDensity]]
deps = ["Distributions", "DocStringExtensions", "FFTW", "Interpolations", "StatsBase"]
git-tree-sha1 = "9816b296736292a80b9a3200eb7fbb57aaa3917a"
@@ -809,10 +821,22 @@ git-tree-sha1 = "bf36f528eec6634efc60d7ec062008f171071434"
uuid = "88015f11-f218-50d7-93a8-a6af411a945d"
version = "3.0.0+1"
+[[LLVM]]
+deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Printf", "Unicode"]
+git-tree-sha1 = "a8960cae30b42b66dd41808beb76490519f6f9e2"
+uuid = "929cbde3-209d-540e-8aea-75f648917ca0"
+version = "5.0.0"
+
+[[LLVMExtra_jll]]
+deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"]
+git-tree-sha1 = "09b7505cc0b1cee87e5d4a26eea61d2e1b0dcd35"
+uuid = "dad2f222-ce93-54a1-a47d-0025e8a3acab"
+version = "0.0.21+0"
+
[[LRUCache]]
-git-tree-sha1 = "d862633ef6097461037a00a13f709a62ae4bdfdd"
+git-tree-sha1 = "48c10e3cc27e30de82463c27bef0b8bdbd1dc634"
uuid = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"
-version = "1.4.0"
+version = "1.4.1"
[[LZO_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
@@ -912,9 +936,9 @@ version = "2.35.0+0"
[[Libtask]]
deps = ["FunctionWrappers", "LRUCache", "LinearAlgebra", "Statistics"]
-git-tree-sha1 = "3e893f18b4326ed392b699a4948b30885125d371"
+git-tree-sha1 = "345a40c746404dd9cb1bbc368715856838ab96f2"
uuid = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
-version = "0.8.5"
+version = "0.8.6"
[[Libtiff_jll]]
deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"]
@@ -940,9 +964,9 @@ version = "2.1.1"
[[LogDensityProblemsAD]]
deps = ["DocStringExtensions", "LogDensityProblems", "Requires", "SimpleUnPack"]
-git-tree-sha1 = "9be6d4c96c6367535ed3fecb61af72cac06f023f"
+git-tree-sha1 = "5f219f583a399381dc147b984648429bf8c3fc6a"
uuid = "996a588d-648d-4e1f-a8f0-a84b347e47b1"
-version = "1.4.0"
+version = "1.4.2"
[[LogExpFunctions]]
deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"]
@@ -961,9 +985,9 @@ version = "1.0.0"
[[MCMCChains]]
deps = ["AbstractMCMC", "AxisArrays", "Dates", "Distributions", "Formatting", "IteratorInterfaceExtensions", "KernelDensity", "LinearAlgebra", "MCMCDiagnosticTools", "MLJModelInterface", "NaturalSort", "OrderedCollections", "PrettyTables", "Random", "RecipesBase", "Statistics", "StatsBase", "StatsFuns", "TableTraits", "Tables"]
-git-tree-sha1 = "3d70a6e7f57cd0ba1af5284f5c15d8f6331983a2"
+git-tree-sha1 = "5eec3d97404f1df009560e5e17d0d64ea713dc91"
uuid = "c7f686f2-ff18-58e9-bc7b-31028e88f75d"
-version = "6.0.0"
+version = "6.0.1"
[[MCMCDiagnosticTools]]
deps = ["AbstractFFTs", "DataAPI", "DataStructures", "Distributions", "LinearAlgebra", "MLJModelInterface", "Random", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Tables"]
@@ -1022,9 +1046,9 @@ version = "0.7.2"
[[MicroCollections]]
deps = ["BangBang", "InitialValues", "Setfield"]
-git-tree-sha1 = "4d5917a26ca33c66c8e5ca3247bd163624d35493"
+git-tree-sha1 = "629afd7d10dbc6935ec59b32daeb33bc4460a42e"
uuid = "128add7d-3638-4c79-886c-908ea0c25c34"
-version = "0.1.3"
+version = "0.1.4"
[[Missings]]
deps = ["DataAPI"]
@@ -1052,10 +1076,10 @@ uuid = "6f286f6a-111f-5878-ab1e-185364afe411"
version = "0.10.1"
[[NNlib]]
-deps = ["Adapt", "ChainRulesCore", "LinearAlgebra", "Pkg", "Random", "Requires", "Statistics"]
-git-tree-sha1 = "33ad5a19dc6730d592d8ce91c14354d758e53b0e"
+deps = ["Adapt", "Atomix", "ChainRulesCore", "GPUArraysCore", "KernelAbstractions", "LinearAlgebra", "Pkg", "Random", "Requires", "Statistics"]
+git-tree-sha1 = "99e6dbb50d8a96702dc60954569e9fe7291cc55d"
uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
-version = "0.8.19"
+version = "0.8.20"
[[NaNMath]]
deps = ["OpenLibm_jll"]
@@ -1065,9 +1089,9 @@ version = "1.0.2"
[[NamedArrays]]
deps = ["Combinatorics", "DataStructures", "DelimitedFiles", "InvertedIndices", "LinearAlgebra", "Random", "Requires", "SparseArrays", "Statistics"]
-git-tree-sha1 = "2fd5787125d1a93fbe30961bd841707b8a80d75b"
+git-tree-sha1 = "b84e17976a40cb2bfe3ae7edb3673a8c630d4f95"
uuid = "86f7a689-2022-50b4-a561-43c23ac3c673"
-version = "0.9.6"
+version = "0.9.8"
[[NaturalSort]]
git-tree-sha1 = "eda490d06b9f7c00752ee81cfa451efe55521e21"
@@ -1119,10 +1143,10 @@ uuid = "52e1d378-f018-4a11-a4be-720524705ac7"
version = "0.3.2"
[[OpenEXR_jll]]
-deps = ["Artifacts", "Imath_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]
-git-tree-sha1 = "923319661e9a22712f24596ce81c54fc0366f304"
+deps = ["Artifacts", "Imath_jll", "JLLWrappers", "Libdl", "Zlib_jll"]
+git-tree-sha1 = "a4ca623df1ae99d09bc9868b008262d0c0ac1e4f"
uuid = "18a262bb-aa17-5467-a713-aee519bc75cb"
-version = "3.1.1+0"
+version = "3.1.4+0"
[[OpenLibm_jll]]
deps = ["Artifacts", "Libdl"]
@@ -1154,9 +1178,9 @@ uuid = "91d4177d-7536-5919-b921-800302f37372"
version = "1.3.2+0"
[[OrderedCollections]]
-git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
+git-tree-sha1 = "d321bf2de576bf25ec4d3e4360faca399afca282"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
-version = "1.4.1"
+version = "1.6.0"
[[PCRE2_jll]]
deps = ["Artifacts", "Libdl"]
@@ -1177,9 +1201,9 @@ version = "0.3.17"
[[PaddedViews]]
deps = ["OffsetArrays"]
-git-tree-sha1 = "03a7a85b76381a3d04c7a1656039197e70eda03d"
+git-tree-sha1 = "0fac6313486baae819364c52b4f483450a9d793f"
uuid = "5432bcbf-9aad-5242-b902-cca2824c8663"
-version = "0.5.11"
+version = "0.5.12"
[[Parameters]]
deps = ["OrderedCollections", "UnPack"]
@@ -1229,9 +1253,9 @@ version = "1.3.4"
[[Plots]]
deps = ["Base64", "Contour", "Dates", "Downloads", "FFMPEG", "FixedPointNumbers", "GR", "JLFzf", "JSON", "LaTeXStrings", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "Pkg", "PlotThemes", "PlotUtils", "Preferences", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "RelocatableFolders", "Requires", "Scratch", "Showoff", "SnoopPrecompile", "SparseArrays", "Statistics", "StatsBase", "UUIDs", "UnicodeFun", "Unzip"]
-git-tree-sha1 = "cfcd24ebf8b066b4f8e42bade600c8558212ed83"
+git-tree-sha1 = "5434b0ee344eaf2854de251f326df8720f6a7b55"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
-version = "1.38.7"
+version = "1.38.10"
[[Preferences]]
deps = ["TOML"]
@@ -1241,9 +1265,9 @@ version = "1.3.0"
[[PrettyTables]]
deps = ["Crayons", "Formatting", "LaTeXStrings", "Markdown", "Reexport", "StringManipulation", "Tables"]
-git-tree-sha1 = "96f6db03ab535bdb901300f88335257b0018689d"
+git-tree-sha1 = "548793c7859e28ef026dba514752275ee871169f"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
-version = "2.2.2"
+version = "2.2.3"
[[Printf]]
deps = ["Unicode"]
@@ -1275,9 +1299,9 @@ version = "5.15.3+2"
[[QuadGK]]
deps = ["DataStructures", "LinearAlgebra"]
-git-tree-sha1 = "786efa36b7eff813723c4849c90456609cf06661"
+git-tree-sha1 = "6ec7ac8412e83d57e313393220879ede1740f9ee"
uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
-version = "2.8.1"
+version = "2.8.2"
[[Quaternions]]
deps = ["LinearAlgebra", "Random", "RealDot"]
@@ -1335,10 +1359,10 @@ uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c"
version = "0.6.11"
[[RecursiveArrayTools]]
-deps = ["Adapt", "ArrayInterface", "ChainRulesCore", "DocStringExtensions", "FillArrays", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "Requires", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables", "ZygoteRules"]
-git-tree-sha1 = "3dcb2a98436389c0aac964428a5fa099118944de"
+deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "Requires", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"]
+git-tree-sha1 = "140cddd2c457e4ebb0cdc7c2fd14a7fbfbdf206e"
uuid = "731186ca-8d62-57ce-b412-fbd966d074cd"
-version = "2.38.0"
+version = "2.38.3"
[[Reexport]]
git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
@@ -1377,9 +1401,9 @@ version = "0.4.0+0"
[[Roots]]
deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"]
-git-tree-sha1 = "b45deea4566988994ebb8fb80aa438a295995a6e"
+git-tree-sha1 = "82362f2a4f756951f21ebb3ac2aed094c46a5109"
uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
-version = "2.0.10"
+version = "2.0.12"
[[Rotations]]
deps = ["LinearAlgebra", "Quaternions", "Random", "StaticArrays", "Statistics"]
@@ -1389,9 +1413,9 @@ version = "1.4.0"
[[RuntimeGeneratedFunctions]]
deps = ["ExprTools", "SHA", "Serialization"]
-git-tree-sha1 = "50314d2ef65fce648975a8e80ae6d8409ebbf835"
+git-tree-sha1 = "f139e81a81e6c29c40f1971c9e5309b09c03f2c3"
uuid = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
-version = "0.5.5"
+version = "0.5.6"
[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
@@ -1399,9 +1423,9 @@ version = "0.7.0"
[[SciMLBase]]
deps = ["ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "Preferences", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SnoopPrecompile", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables", "TruncatedStacktraces"]
-git-tree-sha1 = "fdea92555855db1d86c3638f0a789d6e0a830e67"
+git-tree-sha1 = "392d3e28b05984496af37100ded94dc46fa6c8de"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
-version = "1.89.0"
+version = "1.91.7"
[[SciMLOperators]]
deps = ["ArrayInterface", "DocStringExtensions", "Lazy", "LinearAlgebra", "Setfield", "SparseArrays", "StaticArraysCore", "Tricks"]
@@ -1452,9 +1476,9 @@ uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d"
version = "0.9.4"
[[SimpleUnPack]]
-git-tree-sha1 = "46dc21a1bf27b751453f7dea36786c006707f0d4"
+git-tree-sha1 = "58e6353e72cde29b90a69527e56df1b5c3d8c437"
uuid = "ce78b400-467f-4804-87d8-8f486da07d0a"
-version = "1.0.1"
+version = "1.1.0"
[[SimpleWeightedGraphs]]
deps = ["Graphs", "LinearAlgebra", "Markdown", "SparseArrays", "Test"]
@@ -1507,9 +1531,9 @@ version = "0.1.1"
[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "StaticArraysCore", "Statistics"]
-git-tree-sha1 = "2d7d9e1ddadc8407ffd460e24218e37ef52dd9a3"
+git-tree-sha1 = "63e84b7fdf5021026d0f17f76af7c57772313d99"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
-version = "1.5.16"
+version = "1.5.21"
[[StaticArraysCore]]
git-tree-sha1 = "6b7ba252635a5eff6a0b0664a41ee140a1c9e72a"
@@ -1528,9 +1552,9 @@ uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[[StatsAPI]]
deps = ["LinearAlgebra"]
-git-tree-sha1 = "f9af7f195fb13589dd2e2d57fdb401717d2eb1f6"
+git-tree-sha1 = "45a7769a04a3cf80da1c1c7c60caf932e6f4c9f7"
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
-version = "1.5.0"
+version = "1.6.0"
[[StatsBase]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
@@ -1557,9 +1581,9 @@ version = "0.3.0"
[[StructArrays]]
deps = ["Adapt", "DataAPI", "GPUArraysCore", "StaticArraysCore", "Tables"]
-git-tree-sha1 = "b03a3b745aa49b566f128977a7dd1be8711c5e71"
+git-tree-sha1 = "521a0e828e98bb69042fec1809c1b5a680eb7389"
uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
-version = "0.6.14"
+version = "0.6.15"
[[SuiteSparse]]
deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"]
@@ -1590,9 +1614,9 @@ version = "1.0.1"
[[Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"]
-git-tree-sha1 = "c79322d36826aa2f4fd8ecfa96ddb47b174ac78d"
+git-tree-sha1 = "1544b926975372da01227b382066ab70e574a3ec"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
-version = "1.10.0"
+version = "1.10.1"
[[Tar]]
deps = ["ArgTools", "SHA"]
@@ -1617,9 +1641,9 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[TiffImages]]
deps = ["ColorTypes", "DataStructures", "DocStringExtensions", "FileIO", "FixedPointNumbers", "IndirectArrays", "Inflate", "Mmap", "OffsetArrays", "PkgVersion", "ProgressMeter", "UUIDs"]
-git-tree-sha1 = "7e6b0e3e571be0b4dd4d2a9a3a83b65c04351ccc"
+git-tree-sha1 = "8621f5c499a8aa4aa970b1ae381aae0ef1576966"
uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69"
-version = "0.6.3"
+version = "0.6.4"
[[TiledIteration]]
deps = ["OffsetArrays"]
@@ -1635,9 +1659,9 @@ version = "0.2.23"
[[TranscodingStreams]]
deps = ["Random", "Test"]
-git-tree-sha1 = "94f38103c984f89cf77c402f2a68dbd870f8165f"
+git-tree-sha1 = "0b829474fed270a4b0ab07117dce9b9a2fa7581a"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
-version = "0.9.11"
+version = "0.9.12"
[[Transducers]]
deps = ["Adapt", "ArgCheck", "BangBang", "Baselet", "CompositionsBase", "DefineSingletons", "Distributed", "InitialValues", "Logging", "Markdown", "MicroCollections", "Requires", "Setfield", "SplittablesBase", "Tables"]
@@ -1646,21 +1670,21 @@ uuid = "28d57a85-8fef-5791-bfe6-a80928e7c999"
version = "0.4.75"
[[Tricks]]
-git-tree-sha1 = "6bac775f2d42a611cdfcd1fb217ee719630c4175"
+git-tree-sha1 = "aadb748be58b492045b4f56166b5188aa63ce549"
uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
-version = "0.1.6"
+version = "0.1.7"
[[TruncatedStacktraces]]
-deps = ["InteractiveUtils", "MacroTools"]
-git-tree-sha1 = "f7057ba94e63b269125c0db75dcdef913d956351"
+deps = ["InteractiveUtils", "MacroTools", "Preferences"]
+git-tree-sha1 = "7bc1632a4eafbe9bd94cf1a784a9a4eb5e040a91"
uuid = "781d530d-4396-4725-bb49-402e4bee1e77"
-version = "1.1.0"
+version = "1.3.0"
[[Turing]]
deps = ["AbstractMCMC", "AdvancedHMC", "AdvancedMH", "AdvancedPS", "AdvancedVI", "BangBang", "Bijectors", "DataStructures", "Distributions", "DistributionsAD", "DocStringExtensions", "DynamicPPL", "EllipticalSliceSampling", "ForwardDiff", "Libtask", "LinearAlgebra", "LogDensityProblems", "LogDensityProblemsAD", "MCMCChains", "NamedArrays", "Printf", "Random", "Reexport", "Requires", "SciMLBase", "Setfield", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Tracker"]
-git-tree-sha1 = "c839c49b5907233e98997d561c809e619cbe58d0"
+git-tree-sha1 = "26cdfce1cc0301fe832eaa419a5d0edd6a554004"
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
-version = "0.24.2"
+version = "0.24.4"
[[URIs]]
git-tree-sha1 = "074f993b0ca030848b897beff716d93aca60f06a"
@@ -1685,6 +1709,17 @@ git-tree-sha1 = "53915e50200959667e78a92a418594b428dffddf"
uuid = "1cfade01-22cf-5700-b092-accc4b62d6e1"
version = "0.4.1"
+[[UnsafeAtomics]]
+git-tree-sha1 = "6331ac3440856ea1988316b46045303bef658278"
+uuid = "013be700-e6cd-48c3-b4a1-df204f14c38f"
+version = "0.2.1"
+
+[[UnsafeAtomicsLLVM]]
+deps = ["LLVM", "UnsafeAtomics"]
+git-tree-sha1 = "ea37e6066bf194ab78f4e747f5245261f17a7175"
+uuid = "d80eeb9a-aca5-4d75-85e5-170c8b632249"
+version = "0.1.2"
+
[[Unzip]]
git-tree-sha1 = "ca0969166a028236229f63514992fc073799bb78"
uuid = "41fe7b60-77ed-43a1-b4f0-825fd5a5650d"
@@ -1859,15 +1894,15 @@ version = "1.2.12+3"
[[Zstd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
-git-tree-sha1 = "c6edfe154ad7b313c01aceca188c05c835c67360"
+git-tree-sha1 = "49ce682769cd5de6c72dcf1b94ed7790cd08974c"
uuid = "3161d3a3-bdf6-5164-811a-617609db77b4"
-version = "1.5.4+0"
+version = "1.5.5+0"
[[ZygoteRules]]
-deps = ["MacroTools"]
-git-tree-sha1 = "8c1a8e4dfacb1fd631745552c8db35d0deb09ea0"
+deps = ["ChainRulesCore", "MacroTools"]
+git-tree-sha1 = "977aed5d006b840e2e40c0b48984f7463109046d"
uuid = "700de1a5-db45-46bc-99cf-38207098b444"
-version = "0.2.2"
+version = "0.2.3"
[[fzf_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
diff --git a/docs/404.html b/docs/404.html
index 8970d776..286c720c 100644
--- a/docs/404.html
+++ b/docs/404.html
@@ -198,16 +198,17 @@
5.2 Summary
5.3 References
-6 Escaping from Mars
+6 Escaping from Mars - An example to estimate trajectories
7 Football simulation
diff --git a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_11-J1.png b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_11-J1.png
index a7a37bf1..92d11225 100644
Binary files a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_11-J1.png and b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_11-J1.png differ
diff --git a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_14-J1.png b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_14-J1.png
index 6425fa73..0f10c83d 100644
Binary files a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_14-J1.png and b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_14-J1.png differ
diff --git a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_15-J1.png b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_15-J1.png
index 2d43c196..90de51cb 100644
Binary files a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_15-J1.png and b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_15-J1.png differ
diff --git a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_7-J1.png b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_7-J1.png
index d8e8ed45..ee42c523 100644
Binary files a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_7-J1.png and b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_7-J1.png differ
diff --git a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_9-J1.png b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_9-J1.png
index bfe76742..57ba729f 100644
Binary files a/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_9-J1.png and b/docs/data_science_in_julia_for_hackers_files/figure-html/chap_6_plot_9-J1.png differ
diff --git a/docs/reference-keys.txt b/docs/reference-keys.txt
index 830ba2c8..1603177f 100644
--- a/docs/reference-keys.txt
+++ b/docs/reference-keys.txt
@@ -140,3 +140,7 @@ evaluating-the-accuracy
appendix---a-little-more-about-alpha
section
proyectile-motion
+escaping-from-mars---an-example-to-estimate-trajectories
+problem-formulation-and-underlying-premises
+experimentation-calculating-the-gravity-constant-of-mars
+proyectile-equations-of-motion
diff --git a/docs/search_index.json b/docs/search_index.json
index 2370bded..595e9ce6 100644
--- a/docs/search_index.json
+++ b/docs/search_index.json
@@ -1 +1 @@
-[["escaping-from-mars.html", "Chapter 6 Escaping from Mars 6.1 Proyectile Motion 6.2 Calculating the constant g of Mars 6.3 Optimizing the throwing angle 6.4 Summary 6.5 References", " Chapter 6 Escaping from Mars Suppose you landed on Mars by mistake and you want to leave that rocky planet and return home. To escape from a planet you need a very important piece of information: the escaping velocity from the planet. What on Mars is the escape velocity? We are going to use the same experiment that Newton thought when thinking about escaping from the gravity of Earth. Gravity pulls us down, so if we shoot a cannonball, as in the sketch shown below, what will happen? For some velocities, the cannonball will return to Earth, but there’s a velocity at which it scapes since the gravitational pull is not enough to bring it back to the surface. That velocity is called escape velocity. Assuming that the planet is spherical and considering only the gravitational effect of Mars, the escape velocity can be described as \\(v_{escape}=\\sqrt{2*g_{planet}*r_{planet}}\\) where \\(r\\) is the radius of the planet and \\(g\\) the gravity constant at the surface of Mars. Suppose that we remember from school that the escape velocity from Earth is \\(11\\frac{km}{s}\\) and that the radius of Mars if half of the earth’s. We remember that the gravity of Earth at its surface is \\(9.8\\frac{m}{s^2}\\), so all we need to estimate the escape velocity of Mars is the gravity of the planet at its surface. So we decide to make an experiment and gather some data. But what exactly do you need to measure? Let’s see. We are going to calculate the constant \\(g_{mars}\\) just throwing stones. We are going to explain a bit the equations regarding the experiment. The topic we need to revisit is Proyectile Motion. 6.1 Proyectile Motion Gravity pulls us down to Earth, or in our case, to Mars. This means that we have an acceletation, since there is a force. Recalling the newton equation: \\(\\overrightarrow{F} = m * \\overrightarrow{a}\\) where \\(m\\) is the mass of the object, \\(\\overrightarrow{F}\\) is the force(it’s what make us fall) and \\(\\overrightarrow{a}\\) is the acceleration, in our case is what we call gravity \\(\\overrightarrow{g}\\). The arrow \\(\\overrightarrow{}\\) over the letter means that the quantity has a direction in space, in our case, gravity is pointing to the center of the Earth, or Mars. How can we derive the motion of the stones with that equation? In the figure below we show a sketch of the problem: We have the 2 axis, \\(x\\) and \\(y\\), the \\(x\\) axis is parallel to the ground and the \\(y\\) axis is perpendicular, pointing to the sky. We also draw the initial velocity \\(v_0\\) of the proyectile, and the angle \\(\\theta\\) with respect to the ground. Also it’s important to notice that the gravity points in the opposite direction of the \\(y\\) axis. But what is the trajectory of the projectile? and how do the coordinates x and y evolve with time? If we remember from school, the equations of \\(x\\) and \\(y\\) over time is: \\(x(t) = v_0*t*cos(θ)\\) \\(y(t) = v_0*t*sin(θ) -\\frac{g*t^2}{2}\\) where \\(t\\) is the time at which we want to know the coordinates. What do these equations tell us? If we see the evolution of the projectile in the \\(x\\) axis only, it follows a straight line (until it hits the ground) and in the \\(y\\) axis the movement follows a parabola, but how do we interpret that? We can imagine what happens if we trow a stone to the sky: the stone starts to go up and then, at some point, it reaches the highest position it can go. Then, the stone starts to go down. How does the velocity evolve in this trajectory? Since the begining, the velocity starts decreasing until it has the value of 0 at the highest point, where the stone stops for a moment, then it changes its direction and start to increase again, pointing towards the ground. Ploting the evolution of the height of the stone, we obtain the plot shown below. We see that, at the begining the stone starts to go up fast and then it slows down. We see that for each value of \\(y\\) there are 2 values of \\(t\\) that satisfies the equation, thats because the stone pass twice for each point, except for the highest value of \\(y\\). So, in the example we have just explained, we have that the throwing angle is θ=90°, so sin(90°)=1, the trajectory in \\(y\\) becomes: \\(y(t) = v_0*t -\\frac{g*t^2}{2}\\) And the velocity, which is the derivative of the above equation becomes: \\(v_{y}(t) = v_{0} -g*t\\) Those two equations are the ones plotted in the previous sketch, a parabola and a straight line that decreases with time. It’s worth to notice that at each value \\(y\\) of the trajectory, the velocity could have 2 values, just differing in its sign, meaning it can has 2 directions, but with the same magnitude. So keep in mind that when you throw an object to the sky, when it returns to you, the velocity will be the same with the one you threw it. 6.2 Calculating the constant g of Mars Now that we have understood the equations we will work with, we ask: how do we set the experiment and what do we need to measure? The experiment set up will go like this: - One person will be throwing stones with an angle. - The other person will be far, watching from some distance, measuring the time since the other throw the stone and it hits the ground. The other measurement we will need is the distance Δx the stone travelled. - Also, for the first iteration of the experiment, suppose we only keep the measurements with an initial angle θ~45° (we will loosen this constrain in a bit). Let’s use the computer to help with all these calculations. As always, we first import the needed libraries using Distributions using StatsPlots using Turing Suppose we did the experiment and we have measured then the 5 points, Δx and Δt, shown below: Δx = [25.94, 38.84, 52.81, 45.54, 17.24] Δt = [3.91, 4.57, 5.43, 4.85, 3.15] Now, how do we estimate the constant g from those points? When the stone hits the ground, we have that \\(y(t) = 0\\). If we solve for \\(t\\), ignoring the trivial solution \\(t = 0\\), we find that \\(t_{f} = \\frac{2*v_{0}*sin(θ)}{g}\\) where \\(t_{f}\\) is the time at which the stone hits the ground, the time we have measured. And replacing this time in the x(t) equation we find that: \\(Δx=t_{f}*v_{0}*cos(θ)\\) where Δx is the distance traveled by the stone. So, solving for \\(v_{0}\\), the initial velocity, an unknown quantity, we have: \\(v_{0}=\\frac{Δx}{t_{f}cos(θ)}\\) Then replacing it in the equation of \\(t_{f}\\) and solving for \\(\\Delta x\\) we obtain: \\(Δx=\\frac{g*t_{f}^2}{2*tg(θ)}\\) So, the model we are going to propose is a linear regression. A linear equation has the form: \\(y=m*x +b\\) where \\(m\\) is the slope of the curve and \\(b\\) is called the intercept. In our case, if we take \\(x\\) to be \\(\\frac{t_{f}^2}{2}\\), the slope of the curve is g and the intercep is 0. So, in our linear model we are going to propose that each point in the curve is: \\(\\mu = m*x + b\\) \\(y \\sim Normal(\\mu,\\sigma^2)\\) So, what this says is that each point of the regresion is drawn from a gaussian distribution with its center correnponding with a point in the line, as shown in the plot below. So, our linear model will be: \\(g \\sim Distribution\\ to\\ be\\ proposed\\) \\(\\mu[i] = g*\\frac{t_{f}^2[i]}{2}\\) \\(\\Delta x[i]= Normal(\\mu[i],\\sigma^2)\\) Where \\(g\\) has a distribution we will propose next. The first distribution we are going to propose is a uniform distribution for g, between the values of 0 and 10 plot(Uniform(0,10),xlim=(-1,11), ylim=(0,0.2), legend=false, fill=(0, .5, :lightblue)); xlabel!("g_mars"); ylabel!("Probability density"); title!("Uniform prior distribution for g") Now we define the model in Turing and sample from the posterior distribution. @model gravity_uniform(t_final, x_final, θ) = begin # The number of observations. N = length(t_final) g ~ Uniform(0,10) μ = g .* 1/2 .* t_final.^2 for n in 1:N x_final[n] ~ Normal(μ[n], 10) end end iterations = 10000 θ = 45 chain_uniform = sample(gravity_uniform(Δt, Δx, θ), NUTS(), iterations, progress=false); Plotting the posterior distribution for p we that the values are mostly between 2 and 5, with the maximun near 3,8. Can we narrow the values we obtain? histogram(chain_uniform[:g], xlim=[1,6], legend=false, normalized=true); xlabel!("g_mars"); ylabel!("Probability density"); title!("Posterior distribution for g with Uniform prior") As a second option, we propose a Gaussian distribution instead of a Uniform distribution for \\(g\\), like the one shown below, with a mean of 5 and a variance of 2, and let the model update its beliefs with the points we have. plot(Normal(5,2), legend=false, fill=(0, .5,:lightblue)); xlabel!("g_mars"); ylabel!("Probability density"); title!("Normal prior distribution for g") We define then the model with a gaussian distribution as a prior for \\(g\\): @model gravity_normal(t_final, x_final, θ) = begin # The number of observations. N = length(t_final) g ~ Normal(6,2) μ = g .* 1/2 .* t_final.^2 for n in 1:N x_final[n] ~ Normal(μ[n], 3) end end Now we sample values from the posterior distribution and plot and histogram with the values obtained: chain_normal = sample(gravity_normal(Δt, Δx, θ), NUTS(), iterations, progress=false) histogram(chain_normal[:g], xlim=[3,4.5], legend=false, normalized=true, title="Posterior distribution for g with Normal prior"); xlabel!("g_mars"); ylabel!("Probability density"); title!("Posterior distribution for g with Normal prior") We see that the plausible values for the gravity have a clear center in 3.7 and now the distribution is narrower, that’s good, but we can do better. If we observe the prior distribution proposed for \\(g\\), we see that some values are negative, which makes no sense because if that would the case when you trow the stone, it would go up and up, escaping from the planet. We propose then a new model for not allowing the negative values to happen. The distribution we are interested in is a LogNormal distribution. In the plot below is the prior distribution for g, a LogNormal distribution with mean 1.5 and variance of 0.5. plot(LogNormal(1,0.5), xlim=(0,10), legend=false, fill=(0, .5,:lightblue)); xlabel!("g_mars"); ylabel!("Probability density"); title!("Prior LogNormal distribution for g") The model gravity_lognormal defined below has now a LogNormal prior. We sample the posterior distribution after updating with the data measured. @model gravity_lognormal(t_final, x_final, θ) = begin # The number of observations. N = length(t_final) g ~ LogNormal(0.5,0.5) μ = g .* 1/2 .* t_final.^2 for n in 1:N x_final[n] ~ Normal(μ[n], 3) end end chain_lognormal = sample(gravity_lognormal(Δt, Δx, θ), NUTS(), iterations, progress=false) histogram(chain_lognormal[:g], xlim=[3,4.5], legend=false, title="Posterior distribution for g with LogNormal prior", normalized=true); xlabel!("g_mars"); ylabel!("Probability density"); title!("Posterior distribution for g with LogNormal prior") 6.3 Optimizing the throwing angle Now that we have a good understanding of the equations and the overall problem, we are going to add some difficulties and we will loosen a constrain we have imposed: Suppose that the device employed to measure the angle has an error of 15°, no matter the angle. We want to know what are the most convenient angle to do the experiment and to measure or if it doesn’t matter. To do the analysis we need to see how the angle influence the computation of \\(g\\), so solving the equation for \\(g\\) we have: \\(g = \\frac{2*tg(\\theta)*\\Delta x}{t^{2}_f}\\) We can plot then the tangent of θ, with and error of 15° and see what is its maximum and minimun value: angles = 0:0.1:70 error = 15/2 μ = tan.(deg2rad.(angles)) ribbon = tan.(deg2rad.(angles .+ error)) - μ plot(angles, μ, ribbon=ribbon, color="lightblue", legend=false); xlabel!("θ [deg]"); ylabel!("tan(θ)"); title!("tan(θ) and its error") But we don’t care about the absolute value of the error, we want the relavite error, so plotting the percentual error we have: err = tan.(deg2rad.(angles .+ error)) .- tan.(deg2rad.(angles .- error)) perc_error = err .* 100 ./ μ plot(angles, perc_error, xlim=(5,70), ylim=(0,200), color="lightblue", legend=true, lw=3, label="Percentual error"); xlabel!("θ [deg]"); ylabel!("Δtan(θ)/θ"); title!("Percentual error"); vline!([angles[findfirst(x->x==minimum(perc_error), perc_error)]], lw=3, label="Minimum error") So, now we see that the lowest percentual error is obtained when we work in angles near 45°, so we are good to go and we can use the data we measured adding the error in the angle. We now define the new model, where we include an uncertainty in the angle. We propose an uniform prior for the angle centered at 45°, the angle we think the measurement was done. @model gravity_angle_uniform(t_final, x_final, θ) = begin # The number of observations. error = 15 angle ~ Uniform(45 - error/2, 45 + error/2) g ~ LogNormal(log(4),0.3) μ = g .* (t_final.*t_final./(2 * tan.(deg2rad(angle)))) N = length(t_final) for n in 1:N x_final[n] ~ Normal(μ[n], 10) end end chain_uniform_angle = sample(gravity_angle_uniform(Δt, Δx, θ), NUTS(), iterations, progress=false) histogram(chain_uniform_angle[:g], legend=false, normalized=true); xlabel!("g_mars"); ylabel!("Probability density"); title!("Posterior distribution for g, including uncertainty in the angle") 6.3.1 Calculating the escape velocity Now that we have calculated the gravity, we are going to calculate the escape velocity. What data do we have until now? we know from the begining that: \\(R_{Earth}\\approxeq 2R_{Mars}\\) \\(g_{Earth}\\approxeq 9.8\\) and we have also computed the distribution of the plausible values of \\(g_{Mars}\\). So, replacing them in the equation of the escape velocity: \\(\\frac{v_{Mars}}{v_{Earth}} =\\sqrt{\\frac{g_{Mars}*R_{Mars}}{g_{Earth}*R_{Earth}}}\\) so, \\(\\frac{v_{Mars}}{11} =\\sqrt{\\frac{g_{Mars}*2*R_{Mars}}{9.8*R_{Mars}}} \\qquad \\left[\\frac{km}{s} \\right]\\) \\(v_{Mars} =11 * \\sqrt{\\frac{g_{Mars}}{9.8*2}} \\qquad \\left[\\frac{km}{s} \\right]\\) v = 11 .* sqrt.(chain_uniform_angle[:g] ./ (9.8*2)) histogram(v, legend=false, normalized=true); title!("Escape velocity from Mars"); xlabel!("Escape Velocity of Mars [km/s]"); ylabel!("Probability density") Finally, we obtained the escape velocity scape from Mars. 6.4 Summary In this chapter we had to find the escape velocity from Mars. To solve this problem, we first needed to find the gravity of Mars, so we started with a physical description of the problem and concluded that by measuring the distance and time of a rock throw plus some Bayesian analysis we could infer the gravity of Mars. Then we created a simple probabilistic model, with the prior probability set to a uniform distribution and the likelihood to a normal distribution. We sampled the model and obtained our first posterior probability. We repeated this process two more times, changing the prior distribution of the model for more accurate ones, first with a Normal distribution and then with a LogNormal one. Finally, we used the gravity we inferred to calculate the escape velocity from Mars. 6.5 References Khatri, Poudel, Gautam, M.K., P.R., A.K. (2010). Principles of Physics. Kathmandu: Ayam Publication. pp. 170, 171. [ISBN] "],["404.html", "Page not found", " Page not found The page you requested cannot be found (perhaps it was moved or renamed). You may want to try searching to find the page's new location, or use the table of contents to find the page you are looking for. "]]
+[["escaping-from-mars---an-example-to-estimate-trajectories.html", "Chapter 6 Escaping from Mars - An example to estimate trajectories 6.1 Problem formulation and underlying premises 6.2 Proyectile equations of motion 6.3 Experimentation: Calculating the gravity constant of Mars 6.4 Optimizing the throwing angle 6.5 Summary 6.6 References", " Chapter 6 Escaping from Mars - An example to estimate trajectories Suppose you landed on Mars by mistake and you want to leave that rocky planet and return home. To escape from a planet you need a very important piece of information: the escaping velocity from the planet. What on Mars is the escape velocity? 6.1 Problem formulation and underlying premises We are going to use the same experiment that Newton thought when thinking about escaping from the gravity of Earth. Gravity pulls us down, so if we shoot a cannonball, as in the sketch shown below, what will happen? For some velocities, the cannonball will return to Earth, but there’s a velocity at which it scapes since the gravitational pull is not enough to bring it back to the surface. That velocity is called escape velocity. Assuming that the planet is spherical and considering only the gravitational effect of Mars, the escape velocity can be described as \\(v_{escape}=\\sqrt{2*g_{planet}*r_{planet}}\\) where \\(r\\) is the radius of the planet and \\(g\\) the gravity constant at the surface of Mars. Suppose that we remember from school that the escape velocity from Earth is \\(11\\frac{km}{s}\\) and that the radius of Mars if half of the earth’s. We remember that the gravity of Earth at its surface is \\(9.8\\frac{m}{s^2}\\), so all we need to estimate the escape velocity of Mars is the gravity of the planet at its surface. So we decide to make an experiment and gather some data. But what exactly do you need to measure? Let’s see. We are going to calculate the constant \\(g_{mars}\\) just throwing stones. We are going to explain a bit the equations regarding the experiment. The topic we need to revisit is Proyectile Motion. 6.2 Proyectile equations of motion Gravity pulls objects down to Earth, or in our case, to Mars. Recall Newton’s second law: \\(\\overrightarrow{F} = m * \\overrightarrow{a}\\) where \\(m\\) is the mass of the object, \\(\\overrightarrow{F}\\) is the force (what make things fall) and \\(\\overrightarrow{a}\\) is the acceleration. For the particular case of an object being attracted to a much more massive one, we call this acceleration the gravity \\(\\overrightarrow{g}\\). The arrow \\(\\overrightarrow{}\\) over the letter means that the quantity has a direction in space, in our case, gravity points to the center of the Earth or Mars. In the figure below we show a sketch of the problem: We have the two axis, \\(x\\) and \\(y\\), the \\(x\\) axis is parallel to the ground and the \\(y\\) axis is perpendicular, pointing to the sky. We also draw the initial velocity \\(v_0\\) of the proyectile, and the angle \\(\\theta\\) with respect to the ground. Also it’s important to notice that the gravity points in the opposite direction of the \\(y\\) axis. The equations of motion for an object with acceleration only in the \\(y\\) axis are given by: \\(x(t) = v_0*t*cos(θ)\\) \\(y(t) = v_0*t*sin(θ) -\\frac{g*t^2}{2}\\) In other words, the for each time \\(t\\), this equations give the \\(x\\) and \\(y\\) coordinates of a simple object. If we focus on the evolution of the projectile in the \\(x\\) axis alone, it follows a straight line (until it hits the ground) and in the \\(y\\) axis the motion follows a parabola. We can imagine what happens if we throw a stone to the sky: the stone goes up and then, at some point, it reaches it’s highest position and starts going down. How does the velocity evolve in this trajectory? the velocity starts decreasing until it has the value of 0 at the highest point, where the stone stops for a moment, then it changes its direction and start to increase again, pointing towards the ground. Ploting the evolution of the height of the stone, we obtain the plot shown below. We see that, at the begining the stone starts to go up fast and then it slows down. We see that for each value of \\(y\\) there are 2 values of \\(t\\) that satisfies the equation, thats because the stone pass twice for each point, except for the highest value of \\(y\\). So, in the example we have just explained, we have that the throwing angle is θ=90°, so sin(90°)=1, the trajectory in \\(y\\) becomes: \\(y(t) = v_0*t -\\frac{g*t^2}{2}\\) And the velocity, which is the derivative of the above equation becomes: \\(v_{y}(t) = v_{0} -g*t\\) Those two equations are the ones plotted in the previous sketch, a parabola and a straight line that decreases with time. It’s worth to notice that at each value \\(y\\) of the trajectory, the velocity could have 2 values, just differing in its sign, meaning it can has 2 directions, but with the same magnitude. So keep in mind that when you throw an object to the sky, when it returns to you, the velocity will be the same with the one you threw it. 6.3 Experimentation: Calculating the gravity constant of Mars With the equations presented, we are now able to set up an experiment. The steps involved will be as follows: - One person will throw stones with an angle. - Another person will be far, measuring the time it takes the stone to hit the ground as well as the distance \\(Δx\\) the stoned travelled. For the first iteration of the experiment, we will keep the initial angle θ~45°. We will loosen this constraint later. Let’s use the computer to help with all these calculations. As always, we first import the needed libraries using Distributions using StatsPlots using Turing Suppose we did the experiment and we have measured then the 5 points, Δx and Δt, shown below: Δx = [25.94, 38.84, 52.81, 45.54, 17.24] Δt = [3.91, 4.57, 5.43, 4.85, 3.15] Now, how do we estimate the constant g from those points? When the stone hits the ground, we have that \\(y(t) = 0\\). If we solve for \\(t\\), ignoring the trivial solution \\(t = 0\\), we find that \\(t_{f} = \\frac{2*v_{0}*sin(θ)}{g}\\) where \\(t_{f}\\) is the time at which the stone hits the ground, the time we have measured. And replacing this time in the x(t) equation we find that: \\(Δx=t_{f}*v_{0}*cos(θ)\\) where Δx is the distance traveled by the stone. So, solving for \\(v_{0}\\), the initial velocity, an unknown quantity, we have: \\(v_{0}=\\frac{Δx}{t_{f}cos(θ)}\\) Then replacing it in the equation of \\(t_{f}\\) and solving for \\(\\Delta x\\) we obtain: \\(Δx=\\frac{g*t_{f}^2}{2*tg(θ)}\\) So, the model we are going to propose is a linear regression. A linear equation has the form: \\(y=m*x +b\\) where \\(m\\) is the slope of the curve and \\(b\\) is called the intercept. In our case, if we take \\(x\\) to be \\(\\frac{t_{f}^2}{2}\\), the slope of the curve is g and the intercep is 0. So, in our linear model we are going to propose that each point in the curve is: \\(\\mu = m*x + b\\) \\(y \\sim Normal(\\mu,\\sigma^2)\\) So, what this says is that each point of the regresion is drawn from a gaussian distribution with its center correnponding with a point in the line, as shown in the plot below. So, our linear model will be: \\(g \\sim Distribution\\ to\\ be\\ proposed\\) \\(\\mu[i] = g*\\frac{t_{f}^2[i]}{2}\\) \\(\\Delta x[i]= Normal(\\mu[i],\\sigma^2)\\) Where \\(g\\) has a distribution we will propose next. The first distribution we are going to propose is a uniform distribution for g, between the values of 0 and 10 plot(Uniform(0,10),xlim=(-1,11), ylim=(0,0.2), legend=false, fill=(0, .5, :lightblue)); xlabel!("g_mars"); ylabel!("Probability density"); title!("Uniform prior distribution for g") Now we define the model in Turing and sample from the posterior distribution. @model gravity_uniform(t_final, x_final, θ) = begin # The number of observations. N = length(t_final) g ~ Uniform(0,10) μ = g .* 1/2 .* t_final.^2 for n in 1:N x_final[n] ~ Normal(μ[n], 10) end end iterations = 10000 θ = 45 chain_uniform = sample(gravity_uniform(Δt, Δx, θ), NUTS(), iterations, progress=false); Plotting the posterior distribution for p we that the values are mostly between 2 and 5, with the maximun near 3,8. Can we narrow the values we obtain? histogram(chain_uniform[:g], xlim=[1,6], legend=false, normalized=true); xlabel!("g_mars"); ylabel!("Probability density"); title!("Posterior distribution for g with Uniform prior") As a second option, we propose a Gaussian distribution instead of a Uniform distribution for \\(g\\), like the one shown below, with a mean of 5 and a variance of 2, and let the model update its beliefs with the points we have. plot(Normal(5,2), legend=false, fill=(0, .5,:lightblue)); xlabel!("g_mars"); ylabel!("Probability density"); title!("Normal prior distribution for g") We define then the model with a gaussian distribution as a prior for \\(g\\): @model gravity_normal(t_final, x_final, θ) = begin # The number of observations. N = length(t_final) g ~ Normal(6,2) μ = g .* 1/2 .* t_final.^2 for n in 1:N x_final[n] ~ Normal(μ[n], 3) end end Now we sample values from the posterior distribution and plot and histogram with the values obtained: chain_normal = sample(gravity_normal(Δt, Δx, θ), NUTS(), iterations, progress=false) histogram(chain_normal[:g], xlim=[3,4.5], legend=false, normalized=true, title="Posterior distribution for g with Normal prior"); xlabel!("g_mars"); ylabel!("Probability density"); title!("Posterior distribution for g with Normal prior") We see that the plausible values for the gravity have a clear center in 3.7 and now the distribution is narrower, that’s good, but we can do better. If we observe the prior distribution proposed for \\(g\\), we see that some values are negative, which makes no sense because if that would the case when you trow the stone, it would go up and up, escaping from the planet. We propose then a new model for not allowing the negative values to happen. The distribution we are interested in is a LogNormal distribution. In the plot below is the prior distribution for g, a LogNormal distribution with mean 1.5 and variance of 0.5. plot(LogNormal(1,0.5), xlim=(0,10), legend=false, fill=(0, .5,:lightblue)); xlabel!("g_mars"); ylabel!("Probability density"); title!("Prior LogNormal distribution for g") The model gravity_lognormal defined below has now a LogNormal prior. We sample the posterior distribution after updating with the data measured. @model gravity_lognormal(t_final, x_final, θ) = begin # The number of observations. N = length(t_final) g ~ LogNormal(0.5,0.5) μ = g .* 1/2 .* t_final.^2 for n in 1:N x_final[n] ~ Normal(μ[n], 3) end end chain_lognormal = sample(gravity_lognormal(Δt, Δx, θ), NUTS(), iterations, progress=false) histogram(chain_lognormal[:g], xlim=[3,4.5], legend=false, title="Posterior distribution for g with LogNormal prior", normalized=true); xlabel!("g_mars"); ylabel!("Probability density"); title!("Posterior distribution for g with LogNormal prior") 6.4 Optimizing the throwing angle Let us remove the angle constraint and add complexity to the problem. We will consider that the device measuring the angle has a 15 degree error, no matter the angle. Does a most convenient angle to do the experiment exist? Or it doesn’t matter? Is there an angle that is most convenient for making the experiment? Or doesn’t it even matter? To do the analysis we need to see how the angle influence the computation of \\(g\\), so solving the equation for \\(g\\) we have: \\(g = \\frac{2*tg(\\theta)*\\Delta x}{t^{2}_f}\\) We can plot then the tangent of θ, with a 15 degree error and see what their maximum and minimum values are: angles = 0:0.1:70 error = 15/2 μ = tan.(deg2rad.(angles)) ribbon = tan.(deg2rad.(angles .+ error)) - μ plot(angles, μ, ribbon=ribbon, color="lightblue", legend=false); xlabel!("θ [deg]"); ylabel!("tan(θ)"); title!("tan(θ) and its error") But we don’t care about the absolute value of the error, we want the relavite error, so plotting the percentual error we have: err = tan.(deg2rad.(angles .+ error)) .- tan.(deg2rad.(angles .- error)) perc_error = err .* 100 ./ μ plot(angles, perc_error, xlim=(5,70), ylim=(0,200), color="lightblue", legend=true, lw=3, label="Percentual error"); xlabel!("θ [deg]"); ylabel!("Δtan(θ)/θ"); title!("Percentual error"); vline!([angles[findfirst(x->x==minimum(perc_error), perc_error)]], lw=3, label="Minimum error") So, now we see that the lowest percentual error is obtained when we work in angles near 45°, so we are good to go and we can use the data we measured adding the error in the angle. We now define the new model, where we include an uncertainty in the angle. We propose an uniform prior for the angle centered at 45°, the angle we think the measurement was done. @model gravity_angle_uniform(t_final, x_final, θ) = begin # The number of observations. error = 15 angle ~ Uniform(45 - error/2, 45 + error/2) g ~ LogNormal(log(4),0.3) μ = g .* (t_final.*t_final./(2 * tan.(deg2rad(angle)))) N = length(t_final) for n in 1:N x_final[n] ~ Normal(μ[n], 10) end end chain_uniform_angle = sample(gravity_angle_uniform(Δt, Δx, θ), NUTS(), iterations, progress=false) histogram(chain_uniform_angle[:g], legend=false, normalized=true); xlabel!("g_mars"); ylabel!("Probability density"); title!("Posterior distribution for g, including uncertainty in the angle") 6.4.1 Calculating the escape velocity Now that we have calculated the gravity, we are going to calculate the escape velocity. What data do we have until now? we know from the begining that: \\(R_{Earth}\\approxeq 2R_{Mars}\\) \\(g_{Earth}\\approxeq 9.8\\) and we have also computed the distribution of the plausible values of \\(g_{Mars}\\). So, replacing them in the equation of the escape velocity: \\(\\frac{v_{Mars}}{v_{Earth}} =\\sqrt{\\frac{g_{Mars}*R_{Mars}}{g_{Earth}*R_{Earth}}}\\) so, \\(\\frac{v_{Mars}}{11} =\\sqrt{\\frac{g_{Mars}*2*R_{Mars}}{9.8*R_{Mars}}} \\qquad \\left[\\frac{km}{s} \\right]\\) \\(v_{Mars} =11 * \\sqrt{\\frac{g_{Mars}}{9.8*2}} \\qquad \\left[\\frac{km}{s} \\right]\\) v = 11 .* sqrt.(chain_uniform_angle[:g] ./ (9.8*2)) histogram(v, legend=false, normalized=true); title!("Escape velocity from Mars"); xlabel!("Escape Velocity of Mars [km/s]"); ylabel!("Probability density") Finally, we obtained the escape velocity scape from Mars. 6.5 Summary In this chapter we had to find the escape velocity from Mars. To solve this problem, we first needed to find the gravity of Mars, so we started with a physical description of the problem and concluded that by measuring the distance and time of a rock throw plus some Bayesian analysis we could infer the gravity of Mars. Then we created a simple probabilistic model, with the prior probability set to a uniform distribution and the likelihood to a normal distribution. We sampled the model and obtained our first posterior probability. We repeated this process two more times, changing the prior distribution of the model for more accurate ones, first with a Normal distribution and then with a LogNormal one. Finally, we used the gravity we inferred to calculate the escape velocity from Mars. 6.6 References Khatri, Poudel, Gautam, M.K., P.R., A.K. (2010). Principles of Physics. Kathmandu: Ayam Publication. pp. 170, 171. [ISBN] "],["404.html", "Page not found", " Page not found The page you requested cannot be found (perhaps it was moved or renamed). You may want to try searching to find the page's new location, or use the table of contents to find the page you are looking for. "]]