-
Notifications
You must be signed in to change notification settings - Fork 3
/
notebook.jl
2253 lines (1811 loc) · 78.3 KB
/
notebook.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
### A Pluto.jl notebook ###
# v0.19.42
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
el
end
end
# ╔═╡ bafcc8b1-2519-4dc3-837b-e65fa36cbfef
using Plots # main plotting package
# ╔═╡ 74266685-f5c4-4b19-ab58-1dc890f885c5
using PlotlyJS: PlotlyJS # provides an interactive backend for web browsers
# ╔═╡ 48cc1cbf-91b0-424a-8645-035cd40c194a
using Unitful # package for adding physical units to numbers
# ╔═╡ 15b99748-69eb-4789-b9e8-243a97f3a36e
using Optim
# ╔═╡ dc860b9f-bceb-4c19-8675-aaa43ccf3536
using DataFrames
# ╔═╡ 4cb5a162-2f49-4569-9093-bb1e1d3024a4
using LsqFit
# ╔═╡ 0b299610-118d-4bcb-8b74-b4bc4f2ebe46
using PlutoUI
# ╔═╡ eb48686d-86a9-48fb-9543-b809d5d025be
html"<button onclick='present()'>Toggle presentation mode</button>"
# ╔═╡ b956f723-9404-4a2f-bda2-1ea984332064
md"""
# Scientific computing with Julia
"""
# ╔═╡ f37832b0-a362-4df8-9046-74d54828032d
md"""
## Pluto: reproducibility by default
$(Resource("https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4544406/bin/f1000research-4-7374-g0000.jpg"))
_Image by Paul Blow in article ["Reproducibility: The risks of replication drive"](https://doi.org/10.1038/503333a) by Mina Bissel, Nature, 2013._
Julia is an interactive programming language, much like Python and R, and can be used in notebooks for exploratory work or data science workflows.
It can be used in Jupyter notebooks (the "Ju" in the name stands for "Julia"!) via the [`IJulia.jl`](https://github.com/JuliaLang/IJulia.jl) kernel, but here we want to demonstrate [`Pluto.jl`](https://github.com/fonsp/Pluto.jl) 🎈, an alternative type of notebook with focus on reproducibility.
Pluto is _reactive_, which means that interdependent cells are automatically updated, much like a spreadsheet.
You can also use widgets to set the value of variables.
"""
# ╔═╡ 64a8c492-f6cd-4b31-b200-f15210fdc6af
a = 2
## to make `a` into a slider, uncomment the following line and comment the above one.
## Comments in Julia use the # syntax.
# @bind a Slider(0:10; show_value=true, default=2)
# ╔═╡ ef5fe3c7-d01d-48de-a9c5-1010d8c75f5e
b = a ^ 2
# ╔═╡ 4f425f14-e2ec-4b5c-a2d2-f5614da38c7a
md"""
Pluto has also a tight integration with the Julia package manager, to make sure the notebook you run locally will use the same set packages on someone else's machine.
To achieve this, Pluto creates a virtual environment under the hood, but whenever you use Julia outside of Pluto do remember to create a [local environment](https://pkgdocs.julialang.org/v1/environments/) for your projects!
"""
# ╔═╡ 9ff517e2-d978-4b52-ac09-3dc16b222d11
md"""
## What's Julia?
Julia is a modern, dynamic, general-purpose, compiled programming language.
It's interactive ("like Python"), can be used in a REPL or notebooks, like Jupyter (it's the "Ju") or Pluto (this one🎈).
Julia has a runtime which includes a just-in-time (JIT) compiler and a garbage collector (GC), for automatic memory management.
Julia is mainly used for numerical computing; the differential equations solvers suite is particularly popular.
The main paradigm of Julia is multiple dispatch: the ability of functions or methods to depend on the type and number of _all_ its arguments.
Fun fact: version 1.0 was released in London in 2018 during JuliaCon hosted at UCL!
### Why Julia?
From "[My Target Audience](https://scientificcoder.com/my-target-audience)" by Matthijs Cox:
$(Resource("https://cdn.hashnode.com/res/hashnode/image/upload/v1681735971356/91b6e886-7ce1-41a3-9d9f-29b7b096e7f2.png"))
$(Resource("https://cdn.hashnode.com/res/hashnode/image/upload/v1681735992315/62fdd58f-4630-4120-8eb4-5238740543e8.png"))
### Two-language problem
This is another way to look at two-community problem discussed above:
* one language for the prototype, a different one for production, or
* one language for the front-end, a different one for the backend.
$(Resource("https://pde-on-gpu.vaw.ethz.ch/assets/literate_figures/l1_two_lang.png"))
$(Resource("https://pde-on-gpu.vaw.ethz.ch/assets/literate_figures/l1_flux-vs-tensorflow.png"))
### Performance
!!! note "About performance"
Julia _can_ be fast, but it is also easy to write slow code.
Writing efficient code can take some practice, but you can remain in the same language, without being forced to resort to rewrite your program in a different language to achieve better performance.
_Plots in this section are from the presentation of the training course [Julia for HPC @ UCL 2024](https://github.com/carstenbauer/JuliaUCL24)_
#### Julia can be fast
$(Resource("https://i.imgur.com/vQjzPEF.png"))
$(Resource("https://i.imgur.com/7HLD6Ta.png"))
Gradual performance improvement, no disruptive
language change!
#### Julia can be parallel
$(Resource("https://i.imgur.com/FvDZF1Z.png"))
$(Resource("https://i.imgur.com/iHh7KsQ.png"))
### Productivity
$(Resource("https://i.imgur.com/Ym5H0Pz.jpeg"))
$(Resource("https://i.imgur.com/KZMZSru.jpeg"))
from <https://twitter.com/ChapelLanguage/status/1623389242822111232>
### Summary
* Explorable & Understandable
* Composability thanks to multiple dispatch
* User-defined types are as fast and compact as built-ins
* Code that is close to the mathematics
* No need to switch languages for performance...
* ...but you can still call C-like shared libraries with simple Foreign Function Interface (FFI) if you want to
* Built-in package manager
* Most packages are written in Julia: end users and software developers talk the same language
* MIT licensed: free and open source
"""
# ╔═╡ 7e38a429-1d1d-4981-97a9-e3d6e530ab4f
md"""
## What does Julia code look like
_This section is partly inspired by [ETH's course 101-0250-00L on solving partial differential equations (PDEs) in parallel on graphical processing units (GPUs) with the Julia language](https://pde-on-gpu.vaw.ethz.ch/lecture1/)._
"""
# ╔═╡ 54f48b85-33d5-4284-b906-6062085c3c18
function lorenz(x)
σ = 10
β = 8/3
ρ = 28
return [
σ * (x[2] - x[1]),
x[1] * (ρ - x[3]) - x[2],
x[1] * x[2] - β * x[3]
]
end
# ╔═╡ cfc6b81c-69f9-4a64-8c48-659b6b7be51f
function integrate()
# integrate dx/dt = lorenz(t,x) numerically for 500 steps
dt = 0.01
x₀ = [2.0, 0.0, 0.0]
out = zeros(3, 500) # increase second dimension for more steps
out[:,1] = x₀
for i=2:size(out,2)
out[:,i] = out[:,i-1] + lorenz(out[:,i-1]) * dt
end
return out
end
# ╔═╡ 1d8cf13d-dbf3-4d10-9387-830fb80e6fca
attractor = integrate()
# ╔═╡ 08be6ab3-9ef3-442c-bd23-97aa68efad92
plotlyjs(); # enable the PlotlyJS backend
# ╔═╡ 3c4c6b49-fadc-4833-a886-c8c2edcc5f7b
plot(attractor[1,:], attractor[2,:], attractor[3,:])
# ╔═╡ 4a7ba915-ef5a-4c2e-a0c0-b044017f0316
md"""
## Crash course on multiple dispatch
From "[SIAM CSE19: Solving the Two Language Problem in Scientific Computing and Machine Learning with Julia](https://www.youtube.com/watch?v=OfMP5PTFQk0)" (acceptance speech for J. H. Wilkinson Prize 2019 for Numerical Software)
$(Resource("https://i.imgur.com/QqUPohw.png"))
_Based on the blogpost "[Rock–paper–scissors game in less than 10 lines of code](https://giordano.github.io/blog/2017-11-03-rock-paper-scissors)"._
"""
# ╔═╡ 2fc1cab7-d477-4487-a101-1a1aae214865
begin
abstract type Shape end
struct Rock <: Shape end
struct Paper <: Shape end
struct Scissors <: Shape end
play(::Type{Paper}, ::Type{Rock}) = "Paper wins"
play(::Type{Paper}, ::Type{Scissors}) = "Scissors wins"
play(::Type{Rock}, ::Type{Scissors}) = "Rock wins"
play(::Type{T}, ::Type{T}) where {T<: Shape} = "Tie, try again"
play(a::Type{<:Shape}, b::Type{<:Shape}) = play(b, a) # Commutativity
end
# ╔═╡ a8a6ab01-1c32-45c5-80f9-1ba0f49cdfcb
md"""
You can also extend to more data structures
"""
# ╔═╡ 6074a761-3264-42cd-9a67-fb8fcea557ca
begin
struct Well <: Shape end
play(::Type{Well}, ::Type{Rock}) = "Well wins"
play(::Type{Well}, ::Type{Scissors}) = "Well wins"
play(::Type{Well}, ::Type{Paper}) = "Paper wins"
end
# ╔═╡ c75a74b1-651b-4d26-b8e3-0b6c4c3d3a59
play(Paper, Scissors)
# ╔═╡ f04b4438-3bea-4d7f-bbd8-6c7ea800cc9f
play(Rock, Rock)
# ╔═╡ cde75794-0f43-40e7-b2e4-9a748bf67431
play(Rock, Paper)
# ╔═╡ 8f875943-61d1-45f8-9b37-a75fff536da9
play(Paper, Well)
# ╔═╡ 2730f18e-dc79-448d-97cd-b32da0221abc
play(Well, Rock)
# ╔═╡ 534d35aa-e5cc-4507-b440-cbf53764a4dd
play(Well, Well)
# ╔═╡ 87a54b0d-2e42-4fe9-a40e-4567ae9fcb87
md"""
Multiple dispatch is the key ingredient to make Julia packages very composable!
"""
# ╔═╡ 1ab78041-e834-4fac-a1f7-1fb3b14fc394
md"""
## Play with Julia code
### Basic datatypes
#### Numbers
"""
# ╔═╡ 0d2421e4-4a9f-405d-831b-9146056110aa
my_integer = 42
# ╔═╡ 506a56cf-675f-42f4-99c6-45ca025ec7f4
my_float = 3.14
# ╔═╡ d614d6c7-49b4-4b38-822a-6fbc295e675d
my_integer + my_float
# ╔═╡ f50d27fd-f101-489c-b240-ee14c8c1dd33
my_float / my_integer
# ╔═╡ 1a1e2a98-2338-4673-b599-a435f83a1fbe
md"""
#### Strings
"""
# ╔═╡ 8ae49a36-670b-493d-8957-29436ff9519c
my_string = "hello world"
# ╔═╡ 4266fc68-5fbf-4c2f-85a6-f2064b1ca52d
println(my_string)
# ╔═╡ df57efba-663f-4408-914a-e4ff00902d97
greet(name::String) = println("Hello ", name)
# ╔═╡ b8901b06-fa08-4a6c-ad44-0965a55f8ca8
greet("UCL ARC")
# ╔═╡ de339ded-7430-4d87-aa00-edbf3eee0f1a
md"""
#### Vectors and multi-dimensional arrays
"""
# ╔═╡ c8afa835-47c7-488b-8827-e72c3df3a43f
my_vector = [1, 2, 3, 5, 7, 11, 13]
# ╔═╡ 2a13f83a-cfa7-48d7-9c42-651698428b6d
my_vector[1]
# ╔═╡ 936fb03d-ea61-42a3-b389-21cbb351fd35
my_vector[3:5]
# ╔═╡ 3e60fa18-e8e7-44c2-9c46-45ab1fca1537
new_vector = [1, 1, 2, 3, 5, 8, 13]
# ╔═╡ 2f32386b-eed2-4f42-847a-4629d9522701
my_vector + new_vector
# ╔═╡ 61e6ab7f-e16e-444c-b73a-df3ac15cb7e7
my_vector * new_vector'
# ╔═╡ 020d657b-f8fd-44d5-aea9-dd579e4af180
my_matrix = randn(3, 3)
# ╔═╡ 7ffe9fd0-d724-4567-86da-bf57bd215215
my_matrix[2, 2]
# ╔═╡ 9bb42815-39ad-4cc2-a3c0-30b2fd6c2152
my_matrix[1:3, 2]
# ╔═╡ 0d71f10f-f753-48cd-baff-da0460e3a419
my_matrix ^ 2
# ╔═╡ 132aa1da-7051-4da7-8643-2c5497fa6b3d
my_matrix * my_vector[1:3]
# ╔═╡ c6163ccc-3a4e-409c-b21d-347858e7a134
md"""
#### Dictionaries
"""
# ╔═╡ d0e2fbe1-fc53-42dd-a984-08607c097b7d
my_dictionary = Dict("a" => 97, "b" => 98, "c" => 99)
# ╔═╡ 84469f69-f90f-4a6e-bb21-de399bcf16a5
my_dictionary["a"]
# ╔═╡ 0057156f-9a23-4ec7-bd2f-f5d1fa28b3fd
my_dictionary["d"] = 100
# ╔═╡ 4d6cecf8-273d-42e6-a405-2fbf45ec8a21
my_dictionary
# ╔═╡ b2f7edec-14d9-4011-8d84-8fc65fd0d266
md"""
## Hands-on tutorial: ideal projectile (no air resistance)
For this hands-on we will study the [motion of an ideal projectile](https://en.wikipedia.org/wiki/Projectile_motion), without air resistance or any other complication.
$(Resource("https://upload.wikimedia.org/wikipedia/commons/8/8f/Moto_parabolico.png"))
The coordinates $$x$$ and $$y$$ of the projectile at time $$t$$, launched at time $$t = 0$$ from position $$(0,0)$$ with launch angle $$\theta$$ and initial speed with magnitude $$v_0$$ are given by the formulas:
```math
\begin{aligned}
x &= v_0 t \cos(\theta), \\
y &= v_0 t \sin(\theta) - \frac{1}{2}gt^2.
\end{aligned}
```
Furthermore, the [time of flight](https://en.wikipedia.org/wiki/Projectile_motion#Time_of_flight_or_total_time_of_the_whole_journey) of the projectile (the time after which the projectile reaches the ground again, i.e. $$y = 0$$) is given by
```math
t = \frac{2v_0\sin(\theta)}{g}.
```
"""
# ╔═╡ 4e81e65a-810e-4aa7-9fc2-2d8b3d0049d6
md"""
where $$g$$ is the constant of the [acceleration of gravity](https://en.wikipedia.org/wiki/Standard_gravity). Let's set a Julia variable with value $$9.81~\mathrm{m}/\mathrm{s}^2$$:
"""
# ╔═╡ 33367bb4-c7d7-4011-9195-1c7b0719ec26
g = 9.81 * u"m/s^2"
# ╔═╡ bb56b280-ba25-43f7-9cc0-c9e3e66570df
md"""
Let's now define the functions for the coordinates $$x$$ and $$y$$, and the time of flight:
"""
# ╔═╡ 2068fa89-94d4-4b8d-802b-aa06258e1f90
displacement_x(t, v₀, θ, g) = v₀ * t * cos(θ)
# ╔═╡ 06de99b9-46fa-4f2a-bdf3-4bcc12f89d0c
displacement_y(t, v₀, θ, g) = v₀ * t * sin(θ) - (g * t ^ 2) / 2
# ╔═╡ 171d9bc1-6d38-4064-93a2-7e2224ab6c72
time_of_flight(v₀, θ, g) = 2 * v₀ * sin(θ) / g
# ╔═╡ cfddaa20-b7d7-4d96-9c89-9f3ade90b9a0
md"""
Finally, let's define the variables which represent the initial speed and launch angle of the projectile.
We can use Pluto sliders for this, to more easily change their values
"""
# ╔═╡ 4f22a3c0-bdb6-415b-87bf-f8775eafa49a
@bind tmp_v₀ Slider(0:0.1:10; show_value=true, default=5)
# ╔═╡ ebf792fa-6cfe-4e43-b50c-800afa835e3f
v₀ = tmp_v₀ * u"m/s"
# ╔═╡ ab591e9d-c2f0-430a-a06d-c86d67e54ec9
@bind θ Slider(range(; start=0, stop=pi/2, length=101); show_value=true, default=pi/4)
# ╔═╡ 16f4e440-a59c-4267-8d9f-58f8c25cf7b2
total_t_range = range(; start=0.0 * u"s", stop=time_of_flight(v₀, θ, g), length=100)
# ╔═╡ 8ad79456-9bfb-4e4a-89f0-0df46775432d
md"""
Move the following slider to see fewer or more points in the plot below.
"""
# ╔═╡ 6ec5e4ea-7b18-400f-b417-fffbb74415cd
@bind t Slider(1:1:length(total_t_range); default=90, show_value=true)
# ╔═╡ 48d63c64-dee4-47a8-87df-8db849cdc18d
let
p = plot(displacement_x.(total_t_range[1:t], v₀, θ, g), displacement_y.(total_t_range[1:t], v₀, θ, g);
ylims=(0, Inf),
label="",
xlabel="x",
ylabel="y",
title="Projectile trajectory", marker=:o,
)
end
# ╔═╡ a34cdc3d-3d38-44ca-9835-7db8b451a468
md"""
### Find condition for maximum range of projectile
[It can be derived](https://en.wikipedia.org/wiki/Range_of_a_projectile#Flat_ground) that the range of the projectile $d$ is given by the formula:
```math
d = \frac{v_0^2 \sin(2\theta)}{\lvert{}g\rvert{}}
```
We want to find the condition under which the range of the projectile is maximum.
We can observe $d$ increases monotonically with the initial speed $v_0$, but the relation with $\theta$ is (slightly!) more complicated, so we can write some code to find the value of $\theta$ which maximizes the range.
To do this, we'll use a package for [numerical optimisation](https://en.wikipedia.org/wiki/Mathematical_optimization) called [`Optim.jl`](https://github.com/JuliaNLSolvers/Optim.jl).
"""
# ╔═╡ d2c5fbe4-a364-4f48-919c-bc192cc01af4
md"""
Let's define the function `total_distance` which represents the range of the projectile as a function of initial speed $v_0$, launch angle $\theta$ and acceleration of gravity $g$
!!! warning "Units in Optim.jl"
Due to the complexity of the operations performed internally, `Optim.jl` doesn't guarantee dimensional consistency of its operations, and as such it isn't compatible with `Unitful.jl` or other unit-checking packages.
We will have to strip the units, in meters, from the return value of `total_distance`.
"""
# ╔═╡ 8cc58d50-40e7-4ac5-81ed-6ce2a02d9d3c
total_distance(v₀, θ, g) = ustrip(u"m", v₀ ^ 2 * sin(2 * θ) / abs(g))
# ╔═╡ 8dfeac4b-47f5-4e7a-a34b-0976ae60304a
md"""
We will use the `optimize` function from `Optmi.jl`, which tries to _minimize_ the value of the objective function passed as input.
However, in our case we want to find when `total_distance` is _maximum_, so to do this we'll try to minimize the function `-total_distance`.
Additionally, we want to vary only the launch angle, $\theta$, while keeping the other parameters fixed.
To do this, we can write an [anonymous function](https://docs.julialang.org/en/v1/manual/functions/#man-anonymous-functions) with the `->` syntax.
Finally, note that the [`Optim.jl` API](https://julianlsolvers.github.io/Optim.jl/stable/user/minimization/) expects the objective function to take a _vector_ of parameters as the only input argument, even if it is only one, so we'll write the anonymous function keeping this in mind (always read the documentation!).
With the drop-down menu below you can choose different minimization algorithims.
"""
# ╔═╡ 4775cb36-5991-4ef5-a150-cb614caf8326
@bind minim_algorithm Select([NelderMead, SimulatedAnnealing, BFGS, LBFGS, ConjugateGradient, GradientDescent, MomentumGradientDescent, AcceleratedGradientDescent, Newton, NewtonTrustRegion]; default=BFGS)
# ╔═╡ c58d3cfb-a234-44cd-89b8-1cb072b84c26
result = optimize(
θ -> -total_distance(v₀, θ[1], g), # Target function to minimize: remember we want to maximize the total distance!
[1.0], # Initial guess for the free parameter(s)
minim_algorithm() # Minimization algorithm (change it with the drop-drown menu)
)
# ╔═╡ 48ce8d19-e01d-4894-8441-5eaca0c675a2
md"""
The value of the initial $\theta$ which maximizes the range of the projectile is thus
"""
# ╔═╡ 36cd06ae-f7fc-4775-ba15-57bf1fcdc709
mod(Optim.minimizer(result)[1], pi/2) # We want angles in the range [0, pi/2]
# ╔═╡ 1722c037-2231-4d0a-ad16-8a63ec374046
md"""
or $\theta = \pi/4 = 45\degree$.
Play with the slider of `θ` above to verify this result.
### Dealing with data
In this section we want to have a look at the tools available in the Julia ecosystem that may be useful for data science.
The reference package in this domain is [`DataFrames.jl`](https://github.com/JuliaData/DataFrames.jl), which has similar functionalities to analogous packages in other packages like `data.frame` in R, or Pandas and Polars in Python.
Let's generate a dataframe which contains the data of a simulated projectile trajectory.
Columns represent the time `t`, and the corresponding coordinates `x` and `y`:
"""
# ╔═╡ 82228247-05a0-40be-b42a-4b1338c18b8b
data = let
v₀ = rand() * 10 * u"m/s"
θ = rand() * pi/2
t_range = range(; start=0u"s", stop=time_of_flight(v₀, θ, g), length=25)
# Some quantities to modulate the random noise
max_height = v₀ ^ 2 * sin(θ) ^ 2 / (2 * abs(g))
d = total_distance(v₀, θ, g) * u"m"
# Generate the data for x and y, and add random noise
x = displacement_x.(t_range, v₀, θ, g) .+ randn.() .* (max_height / 100)
y = displacement_y.(t_range, v₀, θ, g) .+ randn.() .* (d / 100)
# Save in a dataframe
DataFrame(:t => t_range, :x => x, :y => y)
end
# ╔═╡ ee419b81-f381-41d3-bbf1-37b16a4bc0cc
scatter(data.x, data.y; label="", xlabel="x", ylabel="y")
# ╔═╡ 812119b0-6915-4975-9c16-465d00912870
md"""
Then we can use the package [`LsqFit.jl`](https://github.com/JuliaNLSolvers/LsqFit.jl) for doing a simple curve fitting.
!!! warning "Caveats"
For simplicity we'll only fit the data for the vertical displacement, discarding the horizontal one.
Also, for obtaining the best fit, we will have to strip the units.
"""
# ╔═╡ 5368ecc6-d37b-4d88-8fd6-c5fa78da92d1
best_fit = curve_fit(
(t, p) -> ustrip(displacement_y.(t, p[1], p[2], ustrip(g))), # Function to fit
ustrip.(data.t), # data on the "x axis"
ustrip.(data.y), # data on the "y axis"
[0.5, 0.5], # Initial guesses for parameters `v₀` and `θ`: tweak them for better models
)
# ╔═╡ 4a50cea7-f0eb-4a16-bcf2-522753f5712b
let
scatter(ustrip.(data.y); label="data")
plot!(ustrip.(displacement_y.(ustrip.(data.t), best_fit.param[1], best_fit.param[2], ustrip.(g))); label="best model")
end
# ╔═╡ b5dfea75-9910-45db-bb69-67a956b9851b
md"""
#### More about data wrangling
You can use `DataFrames.jl` to do all the classical data wrangling operations .
Check out [the documentation](https://dataframes.juliadata.org/stable/) and play with the data below.
"""
# ╔═╡ 128fa05d-89a9-44fc-96a3-5e0fa54d27db
filter(:x => <(1u"m"), data)
# ╔═╡ 1eb5ec9f-2304-4e91-9e9a-ab57f335434d
describe(data)
# ╔═╡ 7a647923-f4a6-4cbe-ae13-546e55760b36
md"""
## Do you need help with Julia?
* Get in touch with the [ARC Collaborations group](https://www.ucl.ac.uk/advanced-research-computing/collaborations-and-consultancy) for collaboration on funded project
* Engage with the [Julia community](https://julialang.org/community/), e.g. [Discourse web forum](https://discourse.julialang.org/)
* Learning resource:
* [Official documentation](https://docs.julialang.org/)
* [Other learning resources](https://julialang.org/learning/)
* [doggo dot jl YouTube channel](https://www.youtube.com/@doggodotjl)
* [Julia for HPC @ UCL 2024](https://github.com/carstenbauer/JuliaUCL24)
"""
# ╔═╡ 490efc11-a562-4042-bec6-60b6256c2002
md"""
## Notebook setup
This section is not very interesting, it contains only some setup code for this notebook.
"""
# ╔═╡ 67d426e1-5985-4e9a-99cd-b9fae9e0abf1
PlutoUI.TableOfContents(; include_definitions=false, depth=4)
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
LsqFit = "2fda8390-95c7-5789-9bda-21331edee243"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
[compat]
DataFrames = "~1.6.1"
LsqFit = "~0.15.0"
Optim = "~1.9.4"
PlotlyJS = "~0.18.13"
Plots = "~1.40"
PlutoUI = "~0.7.59"
Unitful = "~1.20"
julia = "~1.10"
"""
# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
julia_version = "1.10.4"
manifest_format = "2.0"
project_hash = "6749f9a5cd4403655db8bacf5503f28bb125e022"
[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
git-tree-sha1 = "6e1d2a35f2f90a4bc7c2ed98079b2ba09c35b83a"
uuid = "6e696c72-6542-2067-7265-42206c756150"
version = "1.3.2"
[[deps.Adapt]]
deps = ["LinearAlgebra", "Requires"]
git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "4.0.4"
[deps.Adapt.extensions]
AdaptStaticArraysExt = "StaticArrays"
[deps.Adapt.weakdeps]
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[[deps.AliasTables]]
deps = ["PtrArrays", "Random"]
git-tree-sha1 = "9876e1e164b144ca45e9e3198d0b689cadfed9ff"
uuid = "66dad0bd-aa9a-41b7-9441-69ab47430ed8"
version = "1.1.3"
[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.1"
[[deps.ArrayInterface]]
deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"]
git-tree-sha1 = "ed2ec3c9b483842ae59cd273834e5b46206d6dda"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "7.11.0"
[deps.ArrayInterface.extensions]
ArrayInterfaceBandedMatricesExt = "BandedMatrices"
ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices"
ArrayInterfaceCUDAExt = "CUDA"
ArrayInterfaceCUDSSExt = "CUDSS"
ArrayInterfaceChainRulesExt = "ChainRules"
ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore"
ArrayInterfaceReverseDiffExt = "ReverseDiff"
ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore"
ArrayInterfaceTrackerExt = "Tracker"
[deps.ArrayInterface.weakdeps]
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e"
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
[[deps.AssetRegistry]]
deps = ["Distributed", "JSON", "Pidfile", "SHA", "Test"]
git-tree-sha1 = "b25e88db7944f98789130d7b503276bc34bc098e"
uuid = "bf4720bc-e11a-5d0c-854e-bdca1663c893"
version = "0.1.0"
[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[deps.BitFlags]]
git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b"
uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
version = "0.1.8"
[[deps.Blink]]
deps = ["Base64", "Distributed", "HTTP", "JSExpr", "JSON", "Lazy", "Logging", "MacroTools", "Mustache", "Mux", "Pkg", "Reexport", "Sockets", "WebIO"]
git-tree-sha1 = "bc93511973d1f949d45b0ea17878e6cb0ad484a1"
uuid = "ad839575-38b3-5650-b840-f874b8c74a25"
version = "0.12.9"
[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.8+1"
[[deps.Cairo_jll]]
deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "a2f1c8c668c8e3cb4cca4e57a8efdb09067bb3fd"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.18.0+2"
[[deps.Calculus]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad"
uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
version = "0.5.1"
[[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "59939d8a997469ee05c4b4944560a820f9ba0d73"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.4"
[[deps.ColorSchemes]]
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "PrecompileTools", "Random"]
git-tree-sha1 = "4b270d6465eb21ae89b732182c20dc165f8bf9f2"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.25.0"
[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "b10d0b65641d57b8b4d5e234446582de5047050d"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.5"
[[deps.ColorVectorSpace]]
deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "Requires", "Statistics", "TensorCore"]
git-tree-sha1 = "a1f44953f2382ebb937d60dafbe2deea4bd23249"
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
version = "0.10.0"
weakdeps = ["SpecialFunctions"]
[deps.ColorVectorSpace.extensions]
SpecialFunctionsExt = "SpecialFunctions"
[[deps.Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "Reexport"]
git-tree-sha1 = "362a287c3aa50601b0bc359053d5c2468f0e7ce0"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.11"
[[deps.CommonSubexpressions]]
deps = ["MacroTools", "Test"]
git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7"
uuid = "bbf7d656-a473-5ed7-a52c-81e309532950"
version = "0.3.0"
[[deps.Compat]]
deps = ["TOML", "UUIDs"]
git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.15.0"
weakdeps = ["Dates", "LinearAlgebra"]
[deps.Compat.extensions]
CompatLinearAlgebraExt = "LinearAlgebra"
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.1.1+0"
[[deps.ConcurrentUtilities]]
deps = ["Serialization", "Sockets"]
git-tree-sha1 = "6cbbd4d241d7e6579ab354737f4dd95ca43946e1"
uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb"
version = "2.4.1"
[[deps.ConstructionBase]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "260fd2400ed2dab602a7c15cf10c1933c59930a2"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
version = "1.5.5"
[deps.ConstructionBase.extensions]
ConstructionBaseIntervalSetsExt = "IntervalSets"
ConstructionBaseStaticArraysExt = "StaticArrays"
[deps.ConstructionBase.weakdeps]
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[[deps.Contour]]
git-tree-sha1 = "439e35b0b36e2e5881738abc8857bd92ad6ff9a8"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.6.3"
[[deps.Crayons]]
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1"
[[deps.DataAPI]]
git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.16.0"
[[deps.DataFrames]]
deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "04c738083f29f86e62c8afc341f0967d8717bdb8"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.6.1"
[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.20"
[[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"
[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[deps.DelimitedFiles]]
deps = ["Mmap"]
git-tree-sha1 = "9e2f36d3c96a820c678f2f1f1782582fcf685bae"
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
version = "1.9.1"
[[deps.DiffResults]]
deps = ["StaticArraysCore"]
git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621"
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
version = "1.1.0"
[[deps.DiffRules]]
deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"]
git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272"
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
version = "1.15.1"
[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[deps.Distributions]]
deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"]
git-tree-sha1 = "9c405847cc7ecda2dc921ccf18b47ca150d7317e"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.109"
[deps.Distributions.extensions]
DistributionsChainRulesCoreExt = "ChainRulesCore"
DistributionsDensityInterfaceExt = "DensityInterface"
DistributionsTestExt = "Test"
[deps.Distributions.weakdeps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[deps.DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.9.3"
[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.6.0"
[[deps.DualNumbers]]
deps = ["Calculus", "NaNMath", "SpecialFunctions"]
git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566"
uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
version = "0.6.8"
[[deps.EpollShim_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "8e9441ee83492030ace98f9789a654a6d0b1f643"
uuid = "2702e6a9-849d-5ed8-8c21-79e8b8f9ee43"
version = "0.0.20230411+0"
[[deps.ExceptionUnwrapping]]
deps = ["Test"]
git-tree-sha1 = "dcb08a0d93ec0b1cdc4af184b26b591e9695423a"
uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4"
version = "0.1.10"
[[deps.Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "1c6317308b9dc757616f0b5cb379db10494443a7"
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
version = "2.6.2+0"
[[deps.FFMPEG]]
deps = ["FFMPEG_jll"]
git-tree-sha1 = "b57e3acbe22f8484b4b5ff66a7499717fe1a9cc8"
uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
version = "0.4.1"
[[deps.FFMPEG_jll]]
deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"]
git-tree-sha1 = "466d45dc38e15794ec7d5d63ec03d776a9aff36e"
uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5"
version = "4.4.4+1"
[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
[[deps.FillArrays]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "0653c0a2396a6da5bc4766c43041ef5fd3efbe57"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.11.0"
weakdeps = ["PDMats", "SparseArrays", "Statistics"]
[deps.FillArrays.extensions]
FillArraysPDMatsExt = "PDMats"
FillArraysSparseArraysExt = "SparseArrays"
FillArraysStatisticsExt = "Statistics"
[[deps.FiniteDiff]]
deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"]
git-tree-sha1 = "2de436b72c3422940cbe1367611d137008af7ec3"
uuid = "6a86dc24-6348-571c-b903-95158fe2bd41"
version = "2.23.1"
[deps.FiniteDiff.extensions]
FiniteDiffBandedMatricesExt = "BandedMatrices"
FiniteDiffBlockBandedMatricesExt = "BlockBandedMatrices"
FiniteDiffStaticArraysExt = "StaticArrays"
[deps.FiniteDiff.weakdeps]
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[[deps.FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "05882d6995ae5c12bb5f36dd2ed3f61c98cbb172"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.5"
[[deps.Fontconfig_jll]]
deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Zlib_jll"]
git-tree-sha1 = "db16beca600632c95fc8aca29890d83788dd8b23"
uuid = "a3f928ae-7b40-5064-980b-68af3947d34b"
version = "2.13.96+0"
[[deps.Format]]
git-tree-sha1 = "9c68794ef81b08086aeb32eeaf33531668d5f5fc"
uuid = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8"
version = "1.3.7"
[[deps.ForwardDiff]]
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions"]
git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad"
uuid = "f6369f11-7733-5829-9624-2563aa707210"
version = "0.10.36"
[deps.ForwardDiff.extensions]
ForwardDiffStaticArraysExt = "StaticArrays"
[deps.ForwardDiff.weakdeps]
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[[deps.FreeType2_jll]]
deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Zlib_jll"]
git-tree-sha1 = "5c1d8ae0efc6c2e7b1fc502cbe25def8f661b7bc"
uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7"
version = "2.13.2+0"
[[deps.FriBidi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "1ed150b39aebcc805c26b93a8d0122c940f64ce2"
uuid = "559328eb-81f9-559d-9380-de523a88c83c"
version = "1.0.14+0"
[[deps.FunctionalCollections]]
deps = ["Test"]
git-tree-sha1 = "04cb9cfaa6ba5311973994fe3496ddec19b6292a"
uuid = "de31a74c-ac4f-5751-b3fd-e18cd04993ca"
version = "0.5.0"
[[deps.Future]]
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
[[deps.GLFW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"]
git-tree-sha1 = "ff38ba61beff76b8f4acad8ab0c97ef73bb670cb"
uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
version = "3.3.9+0"
[[deps.GR]]
deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Preferences", "Printf", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "p7zip_jll"]
git-tree-sha1 = "ddda044ca260ee324c5fc07edb6d7cf3f0b9c350"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
version = "0.73.5"
[[deps.GR_jll]]
deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "FreeType2_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt6Base_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "278e5e0f820178e8a26df3184fcb2280717c79b1"