Skip to content

Commit 6a7e555

Browse files
committed
Update blog post
1 parent f80f2fd commit 6a7e555

File tree

4 files changed

+693
-7
lines changed

4 files changed

+693
-7
lines changed

_config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ related_blog_posts:
100100
# Follow instructions on https://giscus.app/ to setup for your repo to fill out the information below.
101101
giscus:
102102
repo: langestefan/langestefan.github.io # <your-github-user-name>/<your-github-repo-name>
103-
repo_id: # leave empty or specify your repo_id (see https://giscus.app/)
103+
repo_id: R_kgDON4FOIA # leave empty or specify your repo_id (see https://giscus.app/)
104104
category: General # name of the category under which discussions will be created
105-
category_id: # leave empty or specify your category_id (see https://giscus.app/)
105+
category_id: DIC_kwDON4FOIM4CnORg # leave empty or specify your category_id (see https://giscus.app/)
106106
mapping: pathname # identify discussions by post title
107107
strict: 1 # use strict identification mode
108108
reactions_enabled: 1 # enable (1) or disable (0) emoji reactions
109109
input_position: bottom # whether to display input form below (bottom) or above (top) the comments
110110
theme: preferred_color_scheme # name of the color scheme (preferred works well with al-folio light/dark mode)
111-
emit_metadata: 0
111+
emit_metadata: 1
112112
lang: en
113113

114114
# Disqus comments (DEPRECATED)

_posts/guides/interactive-blog/2025-02-13-interactive-julia-plotting.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ I found out yet again how great, supportive and helpful the Julia community is.
3030
posting on the [Julia Discourse](https://discourse.julialang.org/)
3131
I got [a response from Simon Danisch](https://discourse.julialang.org/t/exporting-figures-to-static-html/125896/16?u=langestefan) who is the creator of Makie.jl.
3232

33-
34-
3533
{% alert note %}
3634
Besides WGLMakie.jl we will also need <a href="https://github.com/SimonDanisch/Bonito.jl">Bonito.jl</a>
3735
to create the HTML descriptions, which will enable us to embed the plot in a blog post.
@@ -87,10 +85,34 @@ Now for a more exciting example, we will use the
8785
the position of a soccer ball after giving it a kick and use [Makie.jl](https://docs.makie.org/stable/)
8886
to visualize the resulting trajectory.
8987

90-
We will start from a physical description of the problem.
88+
We will start from a physical description of the problem. This description is derived
89+
from Newton's second law of motion, which states that the acceleration of an object is
90+
directly proportional to the net forces acting on it. An excellent summary of the
91+
physics involved can be found in a series of blog posts by Hugo, namely [Bend it like Newton: curves in football](http://chalkdustmagazine.com/blog/bend-it-like-newton-curves-in-football/) and [The maths behind a chip goal](https://chalkdustmagazine.com/blog/the-maths-behind-a-chip-goal/).
92+
93+
<div style="margin-top: 20px; margin-bottom: -100px;"><center>
94+
<svg viewBox="0 0 250 250">
95+
{% include_relative soccerball.svg %}
96+
</svg></center></div>
9197

9298
<div class="theorem-box" markdown="1">
9399
### The trajectory of a soccer ball
94100

95-
Given a vector $v \in \mathbb{R}^n$ and a function $f: \mathbb{R}^n \to \mathbb{R}^m$,
101+
The position of a soccer ball in three dimensions can be described by a vector
102+
$\vec{x} = [x, y, z]^T$.
103+
104+
Newton's second law of motion relates the acceleration of the ball to the forces acting
105+
on it. Mathematically, this can be written as:
106+
107+
$$
108+
\begin{equation}
109+
m \frac{d^2 \vec{x}}{dt^2} = \vec{F_G} + \vec{F_D} + \vec{F_L}
110+
\end{equation}
111+
$$
112+
113+
Where we consider the gravitational force $\vec{F_G}$, the drag force $\vec{F_D}$ and the
114+
lift force $\vec{F_L}$. We are interested in solving this equation for $\vec{x}$ because
115+
that will give us the position of the ball at any given time. $m$ is the mass of the ball.
96116
</div>
117+
118+

_posts/guides/interactive-blog/plots.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ end
2828

2929
using DifferentialEquations
3030

31+
# struct to hold problem constants
32+
struct SoccerConst
33+
m::Float64 # mass of the ball
34+
g::Float64 # acceleration due to gravity
35+
r::Float64 # radius of the ball
36+
ρ::Float64 # density of the air
37+
C_L::Float64 # lift coefficient
38+
C_D::Float64 # drag coefficient
39+
end
40+
41+
# inital conditions
42+
struct SoccerIC
43+
x::Float64 # initial x position
44+
y::Float64 # initial y position
45+
z::Float64 # initial z position
46+
v_x::Float64 # initial x velocity
47+
v_y::Float64 # initial y velocity
48+
v_z::Float64 # initial z velocity
49+
end
50+
3151
# open("_posts/examples/diffeqviz/contour.html", "w") do io
3252
# app = App() do
3353
# markersize = Bonito.Slider(range(10, stop=100, length=100))

0 commit comments

Comments
 (0)