Skip to content

Commit

Permalink
Deploying to gh-pages from @ 8ed858c 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jul 26, 2024
1 parent e49a78e commit 9244c25
Show file tree
Hide file tree
Showing 60 changed files with 820 additions and 820 deletions.
Binary file added _weave/lecture02/jl_r4SbWN/optimizing_16_1.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 _weave/lecture02/jl_r4SbWN/optimizing_17_1.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 removed _weave/lecture02/jl_u4mnMm/optimizing_16_1.png
Binary file not shown.
Binary file removed _weave/lecture02/jl_u4mnMm/optimizing_17_1.png
Binary file not shown.
108 changes: 54 additions & 54 deletions _weave/lecture02/optimizing/index.html

Large diffs are not rendered by default.

Binary file added _weave/lecture03/jl_V4oHyq/sciml_35_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added _weave/lecture03/jl_V4oHyq/sciml_41_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added _weave/lecture03/jl_V4oHyq/sciml_45_1.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 removed _weave/lecture03/jl_gD21qX/sciml_35_1.png
Binary file not shown.
Binary file removed _weave/lecture03/jl_gD21qX/sciml_41_1.png
Binary file not shown.
Binary file removed _weave/lecture03/jl_gD21qX/sciml_45_1.png
Binary file not shown.
214 changes: 107 additions & 107 deletions _weave/lecture03/sciml/index.html

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions _weave/lecture04/dynamical_systems/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</span><span class='hljl-k'>end</span><span class='hljl-t'>
</span><span class='hljl-nd'>@time</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
0.000050 seconds &#40;1.00 k allocations: 86.062 KiB&#41;
0.000054 seconds &#40;1.00 k allocations: 86.062 KiB&#41;
1000-element Vector&#123;Vector&#123;Float64&#125;&#125;:
&#91;1.0, 0.0, 0.0&#93;
&#91;0.8, 0.56, 0.0&#93;
Expand All @@ -138,7 +138,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</pre> <pre class='hljl'>
<span class='hljl-nd'>@time</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save_push</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
0.012133 seconds &#40;4.50 k allocations: 336.016 KiB, 99.40&#37; compilation tim
0.011324 seconds &#40;4.50 k allocations: 336.016 KiB, 99.43&#37; compilation tim
e&#41;
1000-element Vector&#123;Vector&#123;Float64&#125;&#125;:
&#91;1.0, 0.0, 0.0&#93;
Expand All @@ -164,7 +164,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</pre> <p>The first time Julia compiles the function, and the second is a straight call.</p> <pre class='hljl'>
<span class='hljl-nd'>@time</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save_push</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
0.000057 seconds &#40;1.01 k allocations: 99.984 KiB&#41;
0.000056 seconds &#40;1.01 k allocations: 99.984 KiB&#41;
1000-element Vector&#123;Vector&#123;Float64&#125;&#125;:
&#91;1.0, 0.0, 0.0&#93;
&#91;0.8, 0.56, 0.0&#93;
Expand All @@ -190,7 +190,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
<span class='hljl-k'>using</span><span class='hljl-t'> </span><span class='hljl-n'>BenchmarkTools</span><span class='hljl-t'>
</span><span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
38.372 μs &#40;1001 allocations: 86.06 KiB&#41;
27.531 μs &#40;1001 allocations: 86.06 KiB&#41;
1000-element Vector&#123;Vector&#123;Float64&#125;&#125;:
&#91;1.0, 0.0, 0.0&#93;
&#91;0.8, 0.56, 0.0&#93;
Expand All @@ -215,7 +215,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</pre> <pre class='hljl'>
<span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save_push</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
44.223 μs &#40;1006 allocations: 99.98 KiB&#41;
33.333 μs &#40;1006 allocations: 99.98 KiB&#41;
1000-element Vector&#123;Vector&#123;Float64&#125;&#125;:
&#91;1.0, 0.0, 0.0&#93;
&#91;0.8, 0.56, 0.0&#93;
Expand Down Expand Up @@ -248,7 +248,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</span><span class='hljl-k'>end</span><span class='hljl-t'>
</span><span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save_matrix</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
69.190 μs &#40;2001 allocations: 179.66 KiB&#41;
66.845 μs &#40;2001 allocations: 179.66 KiB&#41;
3×1000 Matrix&#123;Float64&#125;:
1.0 0.8 0.752 0.80096 0.920338 … 1.98201 1.67886 1.4744
0.0 0.56 0.9968 1.39785 1.81805 0.466287 0.656559 0.85300
Expand All @@ -265,7 +265,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</span><span class='hljl-k'>end</span><span class='hljl-t'>
</span><span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save_matrix_view</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
34.535 μs &#40;1002 allocations: 101.61 KiB&#41;
34.956 μs &#40;1002 allocations: 101.61 KiB&#41;
3×1000 Matrix&#123;Float64&#125;:
1.0 0.8 0.752 0.80096 0.920338 … 1.98201 1.67886 1.4744
0.0 0.56 0.9968 1.39785 1.81805 0.466287 0.656559 0.85300
Expand All @@ -282,7 +282,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</span><span class='hljl-k'>end</span><span class='hljl-t'>
</span><span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save_matrix_resize</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
1.198 ms &#40;2318 allocations: 11.65 MiB&#41;
1.043 ms &#40;2318 allocations: 11.65 MiB&#41;
3×1000 Matrix&#123;Float64&#125;:
1.0 0.8 0.752 0.80096 0.920338 … 1.98201 1.67886 1.4744
0.0 0.56 0.9968 1.39785 1.81805 0.466287 0.656559 0.85300
Expand Down Expand Up @@ -388,15 +388,15 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</pre> <p>which would compute <code>f</code> and then take the values of <code>du</code> and update <code>u</code> with them, but that&#39;s 3 extra operations than required, whereas <code>u,du &#61; du,u</code> will change <code>u</code> to be a pointer to the updated memory and now <code>du</code> is an &quot;empty&quot; cache array that we can refill &#40;this decreases the computational cost by ~33&#37;&#41;. Let&#39;s see what the cost is with this newest version:</p> <pre class='hljl'>
<span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
37.210 μs &#40;1000 allocations: 78.12 KiB&#41;
25.919 μs &#40;1000 allocations: 78.12 KiB&#41;
3-element Vector&#123;Float64&#125;:
1.4744010677851374
0.8530017039412324
20.62004063423844
</pre> <pre class='hljl'>
<span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_mutate</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
7.301 μs &#40;3 allocations: 240 bytes&#41;
7.291 μs &#40;3 allocations: 240 bytes&#41;
3-element Vector&#123;Float64&#125;:
1.4744010677851374
0.8530017039412324
Expand Down Expand Up @@ -445,7 +445,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</pre> <pre class='hljl'>
<span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,</span><span class='hljl-nd'>@SVector</span><span class='hljl-p'>[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
8.766 μs &#40;2 allocations: 23.48 KiB&#41;
8.850 μs &#40;2 allocations: 23.48 KiB&#41;
1000-element Vector&#123;SVector&#123;3, Float64&#125;&#125;:
&#91;1.0, 0.0, 0.0&#93;
&#91;0.8, 0.56, 0.0&#93;
Expand Down Expand Up @@ -511,7 +511,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</pre> <pre class='hljl'>
<span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,</span><span class='hljl-nd'>@SVector</span><span class='hljl-p'>[</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>],</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
6.723 μs &#40;2 allocations: 23.48 KiB&#41;
6.721 μs &#40;2 allocations: 23.48 KiB&#41;
1000-element Vector&#123;SVector&#123;3, Float64&#125;&#125;:
&#91;1.0, 0.0, 0.0&#93;
&#91;0.8, 0.56, 0.0&#93;
Expand All @@ -536,7 +536,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</pre> <p>And we can get down to non-allocating for the loop:</p> <pre class='hljl'>
<span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system</span><span class='hljl-p'>(</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,</span><span class='hljl-nd'>@SVector</span><span class='hljl-p'>([</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>]),</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
6.502 μs &#40;1 allocation: 32 bytes&#41;
6.496 μs &#40;1 allocation: 32 bytes&#41;
3-element SVector&#123;3, Float64&#125; with indices SOneTo&#40;3&#41;:
1.4744010677851374
0.8530017039412324
Expand All @@ -552,7 +552,7 @@ <h1 class=title >How Iteration Works, An Introduction to Discrete Dynamics</h1>
</span><span class='hljl-n'>u</span><span class='hljl-t'> </span><span class='hljl-oB'>=</span><span class='hljl-t'> </span><span class='hljl-nf'>Vector</span><span class='hljl-p'>{</span><span class='hljl-nf'>typeof</span><span class='hljl-p'>(</span><span class='hljl-nd'>@SVector</span><span class='hljl-p'>([</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>]))}(</span><span class='hljl-n'>undef</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span><span class='hljl-t'>
</span><span class='hljl-nd'>@btime</span><span class='hljl-t'> </span><span class='hljl-nf'>solve_system_save!</span><span class='hljl-p'>(</span><span class='hljl-n'>u</span><span class='hljl-p'>,</span><span class='hljl-n'>lorenz</span><span class='hljl-p'>,</span><span class='hljl-nd'>@SVector</span><span class='hljl-p'>([</span><span class='hljl-nfB'>1.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>,</span><span class='hljl-nfB'>0.0</span><span class='hljl-p'>]),</span><span class='hljl-n'>p</span><span class='hljl-p'>,</span><span class='hljl-ni'>1000</span><span class='hljl-p'>)</span>
</pre> <pre class=output >
6.498 μs &#40;0 allocations: 0 bytes&#41;
6.500 μs &#40;0 allocations: 0 bytes&#41;
1000-element Vector&#123;SVector&#123;3, Float64&#125;&#125;:
&#91;1.0, 0.0, 0.0&#93;
&#91;0.8, 0.56, 0.0&#93;
Expand Down
Loading

0 comments on commit 9244c25

Please sign in to comment.