Skip to content

Commit 284e08c

Browse files
committed
small improvements in main tutorial
1 parent b7948b9 commit 284e08c

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicalSystems"
22
uuid = "61744808-ddfa-5f27-97ff-6e42cc95d634"
33
repo = "https://github.com/JuliaDynamics/DynamicalSystems.jl.git"
4-
version = "3.6.2"
4+
version = "3.6.3"
55

66
[deps]
77
Attractors = "f3fd9213-ca85-4dba-9dfd-7fc91308fec7"

docs/src/tutorial.jl

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# This page serves as a short but to-the-point introduction to the **DynamicalSystems.jl**
44
# library. It outlines the core components, and how they establish an interface that
55
# 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).
79

8-
# Going through this tutorial should take you about 20 minutes.
10+
# Going through this tutorial should take you about 20-30 minutes.
911

1012
# !!! note "Also available as a Jupyter notebook"
1113
# 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 @@
1719
# using Pkg; Pkg.add("DynamicalSystems")
1820
# ```
1921

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
2124
# that comprise **DynamicalSystems.jl**, see [contents](@ref contents) for more.
2225
# All of the functionality is brought into scope when doing:
2326

@@ -227,7 +230,7 @@ end
227230

228231
# 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.
229232

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_:
231234

232235
# ```math
233236
# \begin{aligned}
@@ -238,7 +241,7 @@ end
238241

239242
# 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.
240243

241-
# Let's compare
244+
# Let's compare the default solver `Tsit5` with a stiff solver `Rodas5P`:
242245

243246
using OrdinaryDiffEq: Tsit5, Rodas5P
244247

@@ -280,11 +283,15 @@ step!(lorenz96, 100.0) # progress for `100.0` units of time
280283

281284
current_state(lorenz96)
282285

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!`
284291

285292
set_state!(lorenz96, rand(6))
286293

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
288295

289296
set_parameter!(lorenz96, 1, 9.6) # change first parameter of the parameter container
290297
current_parameters(lorenz96)
@@ -294,7 +301,14 @@ current_parameters(lorenz96)
294301
# ## [Using dynamical systems](@id using)
295302

296303
# 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,
298312
# which is a functionality offered by [`ChaosTools`](@ref).
299313
# This is as easy as calling the `lyapunovspectrum` function with `lorenz96`
300314

0 commit comments

Comments
 (0)