Skip to content

Commit

Permalink
Apply some changes to the slides
Browse files Browse the repository at this point in the history
  • Loading branch information
santisoler committed Nov 4, 2024
1 parent 0f34a1b commit 7559a58
Show file tree
Hide file tree
Showing 5 changed files with 232 additions and 4 deletions.
Binary file added images/numerical-instabilities-fixed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/numerical-instabilities-issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions images/svg/numerical-instabilities-fixed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions images/svg/numerical-instabilities-issue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 14 additions & 4 deletions slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,8 @@ r2=50.00000000000001
</div> <!-- fragment -->
<div class="fragment">

So `r2 != -x2`, but `r1 == -x1`
So <code style="color: var(--r-dracula-green);">r2 != -x2</code>,
but <code style="color: var(--r-dracula-red);">r1 == -x1</code>.

</div> <!-- fragment -->

Expand Down Expand Up @@ -904,7 +905,7 @@ If _$x < 0$_ and _$|x| \gg |y|, |z|$_, issues evaluating _$\ln(x + r)$_:
</div>
<div class="col-50">

<img src="images/log_small_values_issue.png" alt="">
<img src="images/numerical-instabilities-issue.png" alt="">

</div>
</div>
Expand Down Expand Up @@ -967,7 +968,7 @@ def safe_log(x, y, z, r):
</code>
</pre>

<img class="fragment" src="images/log_small_values_fixed.png" alt="" style="width: 70%;">
<img class="fragment" src="images/numerical-instabilities-fixed.png" alt="" style="width: 70%;">

</div>

Expand Down Expand Up @@ -1164,6 +1165,8 @@ For the purpose of today, we'll leave this here.

</div>

_More details in [fatiando.org/choclo](https://fatiando.org/choclo)._

---

<!-- .slide: data-visibility="hidden" -->
Expand Down Expand Up @@ -1299,6 +1302,13 @@ Benchmark Numba implementation:

<img class="r-stretch" src="images/choclo-docs.png" alt="">

<div class="text-xs">

[www.fatiando.org/choclo](https://www.fatiando.org)

</div>


---

<!-- .slide: class="center" -->
Expand Down Expand Up @@ -1429,7 +1439,7 @@ def gravity_upward(coordinates, prisms, densities):
# Initialize a result array full of zeros
result = np.zeros_like(easting, dtype=np.float64)

# Forward every prism for each observation point
# On each observation point, forward each prism
for i in numba.prange(len(easting)):
for j in range(prisms.shape[0]):
result[i] += gravity_u(
Expand Down

0 comments on commit 7559a58

Please sign in to comment.