You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/basics.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,27 +3,32 @@
3
3
```@meta
4
4
CurrentModule = CoherentStructures
5
5
```
6
+
6
7
## Definition of vector fields
7
8
8
9
`CoherentStructures.jl` is set up for handling two- and three-dimensional dynamical
9
10
systems only. For such low-dimensional flows it is advantageous (for top
10
11
performance) to obey the following syntax:
11
-
```
12
+
13
+
```julia
12
14
function vectorfield2d(u, p, t)
13
15
du1 =...# equation for $\dot{x}$
14
16
du2 =...# equation for $\dot{y}$
15
17
return StaticArrays.SVector{2}(du1, du2)
16
18
end
17
19
```
20
+
18
21
and correspondingly for three-dimensional ODEs:
19
-
```
22
+
23
+
```julia
20
24
function vectorfield3d(u, p, t)
21
25
du1 =...# equation for $\dot{x}$
22
26
du2 =...# equation for $\dot{y}$
23
27
du3 =...# equation for $\dot{z}$
24
28
return StaticArrays.SVector{3}(du1, du2, du3)
25
29
end
26
30
```
31
+
27
32
In a companion package [`StreamMacros.jl`](https://github.com/CoherentStructures/StreamMacros.jl), there are convenience macros to define two-dimensional velocity
28
33
and vorticity fields from stream functions.
29
34
@@ -70,25 +75,31 @@ tensor_invariants
70
75
For computing distances w.r.t. standard metrics, there exists the excellent
71
76
[`Distances.jl`](https://github.com/JuliaStats/Distances.jl) package. For example,
72
77
the Euclidean distance between two points is computed by any of the last two lines:
73
-
```
78
+
79
+
```julia
74
80
using Distances
75
81
x, y = rand(3), rand(3)
76
82
Euclidean()(x, y)
77
83
euclidean(x, y)
78
84
```
85
+
79
86
Other metrics of potential interest include `Haversine(r)`, the geodesic
80
87
distance of two points on the sphere with radius `r`, and `PeriodicEuclidean(L)`,
81
88
the distance on a torus or cylinder. Here, `L` is a vector containing the period
82
89
of each dimension, `Inf` for non-periodic dimensions.
90
+
83
91
```@docs
84
92
Distances.Euclidean
85
93
Distances.Haversine
86
94
Distances.PeriodicEuclidean
87
95
```
96
+
88
97
In `CoherentStructures.jl`, there is one more metric type implemented:
98
+
89
99
```@docs
90
100
STmetric
91
101
```
102
+
92
103
This is a spatiotemporal metric that operates on trajectories in the format of
93
104
vectors of static vectors, i.e., `Vector{<:SVector}`. Each vector element
94
105
corresponds to the state vector. The `STmetric` then computes the
0 commit comments