Skip to content

Commit abc3af9

Browse files
Merge pull request #183 from SciML/rebuild/301112f1
Rebuild content
2 parents 94ab47f + 3d0f60f commit abc3af9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1779
-1498
lines changed

html/introduction/01-ode_introduction.html

Lines changed: 223 additions & 240 deletions
Large diffs are not rendered by default.

html/introduction/02-choosing_algs.html

Lines changed: 230 additions & 137 deletions
Large diffs are not rendered by default.

html/introduction/03-optimizing_diffeq_code.html

Lines changed: 275 additions & 227 deletions
Large diffs are not rendered by default.

html/introduction/04-callbacks_and_events.html

Lines changed: 121 additions & 111 deletions
Large diffs are not rendered by default.

html/introduction/05-formatting_plots.html

Lines changed: 83 additions & 78 deletions
Large diffs are not rendered by default.

markdown/introduction/01-ode_introduction.md

Lines changed: 198 additions & 253 deletions
Large diffs are not rendered by default.

markdown/introduction/02-choosing_algs.md

Lines changed: 214 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
author: "Chris Rackauckas"
3+
title: "Choosing an ODE Algorithm"
4+
---
5+
6+
17
While the default algorithms, along with `alg_hints = [:stiff]`, will suffice in most cases, there are times when you may need to exert more control. The purpose of this part of the tutorial is to introduce you to some of the most widely used algorithm choices and when they should be used. The corresponding page of the documentation is the [ODE Solvers](https://docs.juliadiffeq.org/dev/solvers/ode_solve/) page which goes into more depth.
28

39
## Diagnosing Stiffness
@@ -36,46 +42,46 @@ sol = solve(prob,Tsit5())
3642
retcode: MaxIters
3743
Interpolation: specialized 4th order "free" interpolation
3844
t: 999977-element Array{Float64,1}:
39-
0.0
45+
0.0
4046
4.997501249375313e-10
4147
5.4972513743128435e-9
42-
3.289919594544218e-8
43-
9.055581394883546e-8
48+
3.289919594544218e-8
49+
9.055581394883546e-8
4450
1.7309428803584187e-7
45-
2.79375393394586e-7
46-
4.149527171475212e-7
47-
5.807919390815544e-7
48-
7.81280701490125e-7
49-
50-
1.8457012081010522
51-
1.845702696026691
52-
1.8457041839548325
53-
1.8457056718857727
54-
1.845707159819413
55-
1.8457086477557534
56-
1.8457101356946952
57-
1.8457116236362385
58-
1.8457131115805805
51+
2.79375393394586e-7
52+
4.149527171475212e-7
53+
5.807919390815544e-7
54+
7.81280701490125e-7
55+
56+
1.8457012081010522
57+
1.845702696026691
58+
1.8457041839548325
59+
1.8457056718857727
60+
1.845707159819413
61+
1.8457086477557534
62+
1.8457101356946952
63+
1.8457116236362385
64+
1.8457131115805805
5965
u: 999977-element Array{Array{Float64,1},1}:
60-
[0.0, 2.0]
66+
[0.0, 2.0]
6167
[-0.0009987513736106552, 1.9999999999997504]
62-
[-0.010904339759596433, 1.9999999999699458]
63-
[-0.06265556194129239, 1.9999999989523902]
64-
[-0.1585948892562767, 1.9999999924944207]
65-
[-0.2700352862461109, 1.9999999746155703]
66-
[-0.3783197963325601, 1.9999999398563364]
67-
[-0.47467864703912216, 1.9999998815910678]
68-
[-0.5499302545937235, 1.999999796115446]
69-
[-0.6026934372089534, 1.9999996800439757]
70-
71-
[-0.7770871866226842, 1.8321769350351387]
72-
[-0.7770880934309836, 1.8321757783565626]
73-
[-0.7770890004563554, 1.832174621674691]
74-
[-0.7770899073362528, 1.832173464989294]
75-
[-0.7770908141915421, 1.832172308300448]
76-
[-0.777091721022237, 1.8321711516081531]
77-
[-0.7770926279492066, 1.832169994912486]
78-
[-0.7770935349724621, 1.8321688382134467]
68+
[-0.010904339759596433, 1.9999999999699458]
69+
[-0.06265556194129239, 1.9999999989523902]
70+
[-0.1585948892562767, 1.9999999924944207]
71+
[-0.2700352862461109, 1.9999999746155703]
72+
[-0.3783197963325601, 1.9999999398563364]
73+
[-0.47467864703912216, 1.9999998815910678]
74+
[-0.5499302545937235, 1.999999796115446]
75+
[-0.6026934372089534, 1.9999996800439757]
76+
77+
[-0.7770871866226842, 1.8321769350351387]
78+
[-0.7770880934309836, 1.8321757783565626]
79+
[-0.7770890004563554, 1.832174621674691]
80+
[-0.7770899073362528, 1.832173464989294]
81+
[-0.7770908141915421, 1.832172308300448]
82+
[-0.777091721022237, 1.8321711516081531]
83+
[-0.7770926279492066, 1.832169994912486]
84+
[-0.7770935349724621, 1.8321688382134467]
7985
[-0.7770944418503102, 1.8321676815108816]
8086
````
8187

@@ -96,46 +102,46 @@ sol = solve(prob,alg_hints = [:stiff])
96102
retcode: Success
97103
Interpolation: specialized 3rd order "free" stiffness-aware interpolation
98104
t: 694-element Array{Float64,1}:
99-
0.0
105+
0.0
100106
4.997501249375313e-10
101-
5.454105825317844e-9
107+
5.454105825317844e-9
102108
1.8954286226539402e-8
103-
4.149674379723465e-8
104-
7.308080698498873e-8
109+
4.149674379723465e-8
110+
7.308080698498873e-8
105111
1.1714649583268228e-7
106112
1.7481330012839592e-7
107113
2.4862371241875205e-7
108114
3.4025555832660864e-7
109-
110-
5.69767949075004
111-
5.748994165486137
112-
5.811844321155623
113-
5.886853430367259
114-
5.969502584336209
115-
6.05645855489726
116-
6.143414525458311
117-
6.230370496019361
118-
6.3
115+
116+
5.69767949075004
117+
5.748994165486137
118+
5.811844321155623
119+
5.886853430367259
120+
5.969502584336209
121+
6.05645855489726
122+
6.143414525458311
123+
6.230370496019361
124+
6.3
119125
u: 694-element Array{Array{Float64,1},1}:
120-
[0.0, 2.0]
126+
[0.0, 2.0]
121127
[-0.0009987513736106515, 1.9999999999997504]
122-
[-0.010819454588930516, 1.9999999999704143]
123-
[-0.036850919195836614, 1.999999999647449]
124-
[-0.07803540833511657, 1.999999998347307]
125-
[-0.13124866317048456, 1.9999999950290166]
126-
[-0.19755036285072544, 1.9999999877524572]
127-
[-0.272075415352352, 1.999999974149605]
128-
[-0.35045254633113243, 1.9999999510683737]
129-
[-0.4264538643666248, 1.9999999153142478]
130-
131-
[0.6849948021041035, -1.9679959070285558]
132-
[0.7068255882516246, -1.9322949901761672]
133-
[0.7369247908644185, -1.8869463160135977]
134-
[0.7789756893010558, -1.8301403490903476]
135-
[0.8358041460218815, -1.7634992825515126]
136-
[0.9131711695745722, -1.6876171241799416]
137-
[1.0200095610067244, -1.6038403486733988]
138-
[1.182122272069454, -1.5086434776790882]
128+
[-0.010819454588930516, 1.9999999999704143]
129+
[-0.036850919195836614, 1.999999999647449]
130+
[-0.07803540833511657, 1.999999998347307]
131+
[-0.13124866317048456, 1.9999999950290166]
132+
[-0.19755036285072544, 1.9999999877524572]
133+
[-0.272075415352352, 1.999999974149605]
134+
[-0.35045254633113243, 1.9999999510683737]
135+
[-0.4264538643666248, 1.9999999153142478]
136+
137+
[0.6849948021041035, -1.9679959070285558]
138+
[0.7068255882516246, -1.9322949901761672]
139+
[0.7369247908644185, -1.8869463160135977]
140+
[0.7789756893010558, -1.8301403490903476]
141+
[0.8358041460218815, -1.7634992825515126]
142+
[0.9131711695745722, -1.6876171241799416]
143+
[1.0200095610067244, -1.6038403486733988]
144+
[1.182122272069454, -1.5086434776790882]
139145
[1.3982811580024197, -1.4194614700844543]
140146
````
141147

@@ -154,46 +160,46 @@ sol = solve(prob)
154160
retcode: Success
155161
Interpolation: Automatic order switching interpolation
156162
t: 1927-element Array{Float64,1}:
157-
0.0
163+
0.0
158164
4.997501249375313e-10
159165
5.4972513743128435e-9
160-
3.289919594544218e-8
161-
9.055581394883546e-8
166+
3.289919594544218e-8
167+
9.055581394883546e-8
162168
1.7309428803584187e-7
163-
2.79375393394586e-7
164-
4.149527171475212e-7
165-
5.807919390815544e-7
166-
7.81280701490125e-7
167-
168-
6.204648226459174
169-
6.219556296846657
170-
6.233842035405188
171-
6.247504825256131
172-
6.260547615587699
173-
6.2729765212211905
174-
6.2848005774657025
175-
6.296031197826328
176-
6.3
169+
2.79375393394586e-7
170+
4.149527171475212e-7
171+
5.807919390815544e-7
172+
7.81280701490125e-7
173+
174+
6.204648226459174
175+
6.219556296846657
176+
6.233842035405188
177+
6.247504825256131
178+
6.260547615587699
179+
6.2729765212211905
180+
6.2848005774657025
181+
6.296031197826328
182+
6.3
177183
u: 1927-element Array{Array{Float64,1},1}:
178-
[0.0, 2.0]
184+
[0.0, 2.0]
179185
[-0.0009987513736106552, 1.9999999999997504]
180-
[-0.010904339759596433, 1.9999999999699458]
181-
[-0.06265556194129239, 1.9999999989523902]
182-
[-0.1585948892562767, 1.9999999924944207]
183-
[-0.2700352862461109, 1.9999999746155703]
184-
[-0.3783197963325601, 1.9999999398563364]
185-
[-0.47467864703912216, 1.9999998815910678]
186-
[-0.5499302545937235, 1.999999796115446]
187-
[-0.6026934372089534, 1.9999996800439757]
188-
189-
[1.1173199781760204, -1.5429755449491689]
190-
[1.1481789818936488, -1.526090225258629]
191-
[1.1805062564165951, -1.5094585545821166]
192-
[1.2143604506793437, -1.4931001271860491]
193-
[1.2498033047017658, -1.477032218841621]
194-
[1.286899775928202, -1.461269894062796]
195-
[1.3257186497126714, -1.4458259322647566]
196-
[1.3663322749653013, -1.4307111536240857]
186+
[-0.010904339759596433, 1.9999999999699458]
187+
[-0.06265556194129239, 1.9999999989523902]
188+
[-0.1585948892562767, 1.9999999924944207]
189+
[-0.2700352862461109, 1.9999999746155703]
190+
[-0.3783197963325601, 1.9999999398563364]
191+
[-0.47467864703912216, 1.9999998815910678]
192+
[-0.5499302545937235, 1.999999796115446]
193+
[-0.6026934372089534, 1.9999996800439757]
194+
195+
[1.1173199781760204, -1.5429755449491689]
196+
[1.1481789818936488, -1.526090225258629]
197+
[1.1805062564165951, -1.5094585545821166]
198+
[1.2143604506793437, -1.4931001271860491]
199+
[1.2498033047017658, -1.477032218841621]
200+
[1.286899775928202, -1.461269894062796]
201+
[1.3257186497126714, -1.4458259322647566]
202+
[1.3663322749653013, -1.4307111536240857]
197203
[1.3818948926590964, -1.4252572688140688]
198204
````
199205

@@ -262,7 +268,51 @@ using BenchmarkTools
262268

263269

264270
````
265-
791.900 μs (13116 allocations: 1.42 MiB)
271+
872.884 μs (13109 allocations: 1.42 MiB)
272+
retcode: Success
273+
Interpolation: Automatic order switching interpolation
274+
t: 1294-element Array{Float64,1}:
275+
0.0
276+
3.5678604836301404e-5
277+
0.0003924646531993154
278+
0.0032624077544510573
279+
0.009058075635317072
280+
0.01695646895607931
281+
0.0276899566248403
282+
0.041856345938267966
283+
0.06024040228733675
284+
0.08368539694547242
285+
286+
99.39403070915297
287+
99.47001147494375
288+
99.54379656909015
289+
99.614651558349
290+
99.69093823148101
291+
99.78733023233721
292+
99.86114450046736
293+
99.96115759510786
294+
100.0
295+
u: 1294-element Array{Array{Float64,1},1}:
296+
[1.0, 0.0, 0.0]
297+
[0.9996434557625105, 0.0009988049817849058, 1.781434788799208e-8]
298+
[0.9961045497425811, 0.010965399721242457, 2.146955365838907e-6]
299+
[0.9693591634199452, 0.08977060667778931, 0.0001438018342266937]
300+
[0.9242043615038835, 0.24228912482984957, 0.0010461623302512404]
301+
[0.8800455868998046, 0.43873645009348244, 0.0034242593451028745]
302+
[0.8483309877783048, 0.69156288756671, 0.008487623500490047]
303+
[0.8495036595681027, 1.0145425335433382, 0.01821208597613427]
304+
[0.9139069079152129, 1.4425597546855036, 0.03669381053327124]
305+
[1.0888636764765296, 2.052326153029042, 0.07402570506414284]
306+
307+
[12.999157033749652, 14.10699925404482, 31.74244844521858]
308+
[11.646131422021162, 7.2855792145502845, 35.365000488215486]
309+
[7.777555445486692, 2.5166095828739574, 32.030953593541675]
310+
[4.739741627223412, 1.5919220588229062, 27.249779003951755]
311+
[3.2351668945618774, 2.3121727966182695, 22.724936101772805]
312+
[3.310411964698304, 4.28106626744641, 18.435441144016366]
313+
[4.527117863517627, 6.895878639772805, 16.58544600757436]
314+
[8.043672261487556, 12.711555298531689, 18.12537420595938]
315+
[9.97537965430362, 15.143884806010783, 21.00643286956427]
266316
````
267317

268318

@@ -273,7 +323,51 @@ using BenchmarkTools
273323

274324

275325
````
276-
10.721 ms (74459 allocations: 3.11 MiB)
326+
9.639 ms (63542 allocations: 2.78 MiB)
327+
retcode: Success
328+
Interpolation: specialized 3rd order "free" stiffness-aware interpolation
329+
t: 2353-element Array{Float64,1}:
330+
0.0
331+
3.5678604836301404e-5
332+
0.0003924646531993154
333+
0.0015292937978620778
334+
0.003162305724282332
335+
0.005285973552599222
336+
0.008023688976652094
337+
0.01144101871159114
338+
0.0156693459080261
339+
0.020826710718121224
340+
341+
99.64643805711006
342+
99.69715002361579
343+
99.75331122793506
344+
99.79981678120402
345+
99.84132760768253
346+
99.88283843416104
347+
99.92434926063956
348+
99.96697093084641
349+
100.0
350+
u: 2353-element Array{Array{Float64,1},1}:
351+
[1.0, 0.0, 0.0]
352+
[0.9996434557625105, 0.0009988049817849047, 1.7814347887985208e-8]
353+
[0.9961045497425969, 0.0109653997212298, 2.146955365112677e-6]
354+
[0.9851473616483439, 0.04246652425810003, 3.21927130421189e-5]
355+
[0.9702414465725462, 0.08706126023105658, 0.00013525574346441506]
356+
[0.9522854546465404, 0.14396668240059424, 0.00036967772967708476]
357+
[0.9314326271963391, 0.21565548792970338, 0.0008289976215629184]
358+
[0.9088641247467208, 0.3027798780735744, 0.001632872227230375]
359+
[0.8859643488922837, 0.4074631051549474, 0.002954345942806542]
360+
[0.8650679703454024, 0.5313629257625292, 0.0050183974807311285]
361+
362+
[12.806695275278894, 12.494656408454457, 33.00345553979429]
363+
[11.743080430598853, 8.043506580216379, 34.89282227510988]
364+
[9.11982468203129, 3.968709691943006, 33.23949044247742]
365+
[6.836119847459929, 2.3677711311840715, 30.424290289803416]
366+
[5.229488956523552, 1.9977361551169743, 27.73491536637819]
367+
[4.156928665122608, 2.2016007548657157, 25.204702582122852]
368+
[3.5806565170126663, 2.724678757457538, 22.930442334447942]
369+
[3.4202075264870198, 3.4950829296305566, 20.89909215126914]
370+
[3.5509784304871257, 4.260058718117392, 19.561783277650832]
277371
````
278372

279373

@@ -330,22 +424,31 @@ DiffEqTutorials.weave_file("introduction","02-choosing_algs.jmd")
330424

331425
Computer Information:
332426
```
333-
Julia Version 1.3.0
334-
Commit 46ce4d7933 (2019-11-26 06:09 UTC)
427+
Julia Version 1.4.2
428+
Commit 44fa15b150* (2020-05-23 18:35 UTC)
335429
Platform Info:
336-
OS: Windows (x86_64-w64-mingw32)
337-
CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
430+
OS: Linux (x86_64-pc-linux-gnu)
431+
CPU: Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
338432
WORD_SIZE: 64
339433
LIBM: libopenlibm
340-
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
434+
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
341435
Environment:
342-
JULIA_EDITOR = "C:\Users\accou\AppData\Local\atom\app-1.42.0\atom.exe" -a
436+
JULIA_DEPOT_PATH = /builds/JuliaGPU/DiffEqTutorials.jl/.julia
437+
JULIA_CUDA_MEMORY_LIMIT = 536870912
438+
JULIA_PROJECT = @.
343439
JULIA_NUM_THREADS = 4
344440
345441
```
346442

347443
Package Information:
348444

349445
```
350-
Status `~\.julia\dev\DiffEqTutorials\Project.toml`
446+
Status `/builds/JuliaGPU/DiffEqTutorials.jl/tutorials/introduction/Project.toml`
447+
[6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf] BenchmarkTools 0.5.0
448+
[0c46a032-eb83-5123-abaf-570d42b7fbaa] DifferentialEquations 6.14.0
449+
[65888b18-ceab-5e60-b2b9-181511a3b968] ParameterizedFunctions 5.3.0
450+
[91a5bcdd-55d7-5caf-9e0b-520d859cae80] Plots 1.4.3
451+
[90137ffa-7385-5640-81b9-e52037218182] StaticArrays 0.12.3
452+
[c3572dad-4567-51f8-b174-8c6c989267f4] Sundials 4.2.3
453+
[37e2e46d-f89d-539d-b4ee-838fcccc9c8e] LinearAlgebra
351454
```

0 commit comments

Comments
 (0)