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/tutorial.jl
+22-8Lines changed: 22 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,11 @@
3
3
# This page serves as a short but to-the-point introduction to the **DynamicalSystems.jl**
4
4
# library. It outlines the core components, and how they establish an interface that
5
5
# is used by the rest of the library. It also provides a couple of usage examples
6
-
# to connect the various packages of the library together.
6
+
# to connect the various subpackages of the library together.
7
+
# This is not an in-depth tutorial, and the individual subpackages of the library have
8
+
# their own in-depth tutorials and documentation (see the top bar of the online documentation).
7
9
8
-
# Going through this tutorial should take you about 20 minutes.
10
+
# Going through this tutorial should take you about 20-30 minutes.
9
11
10
12
# !!! note "Also available as a Jupyter notebook"
11
13
# This tutorial is also available online as a [Jupyter notebook](https://github.com/JuliaDynamics/DynamicalSystems.jl/blob/gh-pages/dev/tutorial.ipynb).
@@ -17,7 +19,8 @@
17
19
# using Pkg; Pkg.add("DynamicalSystems")
18
20
# ```
19
21
20
-
# This installs several packages for the Julia language. These are the sub-modules/packages
22
+
# This installs several packages for the Julia language.
23
+
# Some of these are the sub-modules/packages
21
24
# that comprise **DynamicalSystems.jl**, see [contents](@ref contents) for more.
22
25
# All of the functionality is brought into scope when doing:
23
26
@@ -227,7 +230,7 @@ end
227
230
228
231
# One must be aware whether this is possible for their system and choose a solver that is better suited to tackle stiff problems. If not, a solution may diverge and the ODE integrator will throw an error or a warning.
229
232
230
-
# Many of the problems in DifferentialEquations.jl are suitable for dealing with stiff problems. We can create a stiff problem by using the well known Van der Pol oscillator _with a timescale separation_:
233
+
# Many of the solvers in DifferentialEquations.jl are suitable for dealing with stiff problems. We can create a stiff problem by using the well known Van der Pol oscillator _with a timescale separation_:
231
234
232
235
# ```math
233
236
# \begin{aligned}
@@ -238,7 +241,7 @@ end
238
241
239
242
# with $\mu$ being the timescale of the $y$ variable in units of the timescale of the $x$ variable. For very large values of $\mu$ this problem becomes stiff.
240
243
241
-
# Let's compare
244
+
# Let's compare the default solver `Tsit5` with a stiff solver `Rodas5P`:
242
245
243
246
using OrdinaryDiffEq: Tsit5, Rodas5P
244
247
@@ -280,11 +283,15 @@ step!(lorenz96, 100.0) # progress for `100.0` units of time
280
283
281
284
current_state(lorenz96)
282
285
283
-
# we can also restart the system at a different state using `set_state!`
286
+
# or a particular state variable
287
+
288
+
observe_state(lorenz96, 2)
289
+
290
+
# We can also alter the system state using `set_state!`
284
291
285
292
set_state!(lorenz96, rand(6))
286
293
287
-
#or we can alter system parameters given the index of the parameter and the value to set it to
294
+
#Similarly, we can alter system parameters given the index of the parameter and the value to set it to
288
295
289
296
set_parameter!(lorenz96, 1, 9.6) # change first parameter of the parameter container
290
297
current_parameters(lorenz96)
@@ -294,7 +301,14 @@ current_parameters(lorenz96)
294
301
# ## [Using dynamical systems](@id using)
295
302
296
303
# Now, as an end-user, you are most likely to be giving a `DynamicalSystem` instance to a library function.
297
-
# For example, you may want to compute the Lyapunov spectrum of the Lorenz96 system from above,
304
+
# For example, you may want to obtain the Poincare section of a continuous time system,
305
+
# which is something already available in [`DynamicalSystemsBase`](@ref):
306
+
307
+
plane = (1, 0.0)
308
+
pmap =poincaresos(lorenz96, plane, 10000.0)
309
+
scatter(pmap[:, 2], pmap[:, 3])
310
+
311
+
# Or, you may want to compute the Lyapunov spectrum of the Lorenz96 system from above,
298
312
# which is a functionality offered by [`ChaosTools`](@ref).
299
313
# This is as easy as calling the `lyapunovspectrum` function with `lorenz96`
0 commit comments