Skip to content

Commit e938b66

Browse files
authored
Merge pull request #253 from JuliaDynamics/edit_tutorial_contents
Edit tutorial contents
2 parents 5fc2a26 + 54c8e56 commit e938b66

21 files changed

+2228
-303
lines changed

docs/examples/getting_started_with_network_dynamics.jl

Lines changed: 219 additions & 72 deletions
Large diffs are not rendered by default.

docs/examples/heterogeneous_system.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#=
22
# Modeling a heterogeneous system
33
4-
This example can be dowloaded as a normal Julia script [here](@__NAME__.jl). #md
4+
This example can be downloaded as a normal Julia script [here](@__NAME__.jl). #md
55
6-
One of the main purposes of NetworkDynamics.jl is to facilitate
7-
modeling coupled systems with heterogenities. This means that
8-
components can differ in their parameters as well as in their dynamics.
6+
One of the main purposes of NetworkDynamics.jl is to facilitate the
7+
modeling systems whose components can differ in their parameters as well as their dynamics.
8+
These are known as Coupled systems with heterogeneities.
99
10-
## Heterogenous parameters
10+
## Heterogeneous parameters
1111
1212
We start by setting up a simple system of Kuramoto oscillators.
1313
=#

docs/localmake.jl

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ At the end of each run the user is prompted to rerun the make process. Using rev
1010
use the updated `*.md` and source files. This way the Julia session keeps alive and the
1111
individual builds are much faster.
1212
=#
13-
14-
#=
1513
using Pkg
14+
using Revise
15+
using LiveServer
16+
1617
Pkg.activate(@__DIR__)
17-
Pkg.instantiate()
18-
print("Do you want to update docs environment? [y/n] ")
18+
if VERSION v"1.11-"
19+
Pkg.develop(PackageSpec(path=dirname(@__DIR__))) # adds the package this script is called from
20+
end
21+
print("Do you want to update docs environment? [y/N] ")
1922
answer = readline()
2023
if !isempty(answer) && answer[1] == 'y'
2124
Pkg.update()
2225
end
23-
24-
using Revise
25-
using LiveServer
26-
using REPL.TerminalMenus
26+
Pkg.instantiate()
2727

2828
port = isempty(ARGS) ? 8000 : parse(Int, ARGS[1])
2929
@assert 8000 port 9000 "port has to be in range 8000..9000!"
3030

3131
@info "Start server..."
3232
@async serve(;dir=joinpath(@__DIR__, "build"), port)
3333

34-
menu = RadioMenu(["Run again!", "Quit!"])
35-
while true
34+
run = true
35+
while run
3636
revise()
3737
@info "Start building docs..."
3838
try
@@ -41,23 +41,22 @@ while true
4141
@info "make.jl error" e
4242
end
4343

44-
println("\nDocs are served at http://localhost:$port")
45-
46-
if request("What now?", menu) != 1
47-
break
44+
printstyled("\n\nDocs are served at http://localhost:$port\n\n", color=:blue, bold=true)
45+
println("Run again? Enter! Exit with 'q'.")
46+
if readline() == "q"
47+
global run = false
4848
end
4949
end
50-
=#
5150

5251

53-
using Pkg
54-
Pkg.activate(@__DIR__)
55-
using NetworkDynamics
56-
using LiveServer
52+
# using Pkg
53+
# Pkg.activate(@__DIR__)
54+
# using NetworkDynamics
55+
# using LiveServer
5756

58-
cd(pkgdir(NetworkDynamics))
57+
# cd(pkgdir(NetworkDynamics))
5958

60-
servedocs(
61-
literate_dir = joinpath("docs", "examples"),
62-
skip_dir = joinpath("docs", "src", "generated")
63-
)
59+
# servedocs(
60+
# literate_dir = joinpath("docs", "examples"),
61+
# skip_dir = joinpath("docs", "src", "generated")
62+
# )

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ NDI.get_electron_window()
1919

2020
links = InterLinks(
2121
"DiffEq" => "https://docs.sciml.ai/DiffEqDocs/stable/",
22-
"MTK" => "https://docs.sciml.ai/ModelingToolkit/stable/",
22+
"ModelingToolkit" => "https://docs.sciml.ai/ModelingToolkit/stable/",
2323
"SymbolicIndexingInterface" => "https://docs.sciml.ai/SymbolicIndexingInterface/stable/",
2424
"DiffEqCallbacks" => "https://docs.sciml.ai/DiffEqCallbacks/stable/",
2525
)

docs/src/assets/edgemodel-dark.svg

Lines changed: 281 additions & 0 deletions
Loading

docs/src/assets/edgemodel.svg

Lines changed: 281 additions & 0 deletions
Loading

docs/src/assets/edgemodel.tex

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
% \documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}
2+
\documentclass[tikz,convert=pdf2svg]{standalone}
3+
%\usetikzlibrary{...}% tikz package already loaded by 'tikz' option
4+
\usetikzlibrary{arrows, arrows.meta}
5+
% \tikzset{
6+
% >=stealth',
7+
% }
8+
\usepackage{amsmath,amssymb}
9+
\usepackage{ndtheme}
10+
11+
\begin{document}
12+
\begin{tikzpicture}[\ndtheme]
13+
\node[draw, minimum height=1.5cm](n){
14+
Edge Model
15+
};
16+
\draw[->](n.east)++(0,0.4)--++(1.0,0) node[right]{$y^{\mathrm e}_{\mathrm{src}}$}; \draw[->](n.east)++(0,-0.4)--++(1.0,0) node[right]{$y^{\mathrm e}_{\mathrm{dst}}$};
17+
18+
\draw[<-](n.west)++(0,0.4)--++(-1.0,0) node[left]{$y^{\mathrm v}_{i}=i^{\mathrm e}_{\mathrm{src}}$};
19+
\draw[<-](n.west)++(0,-0.4)--++(-1.0,0) node[left]{$y^{\mathrm v}_{j}=i^{\mathrm e}_{\mathrm{dst}}$};
20+
21+
\node[text width=3.5cm, align=center, font=\scriptsize] at ([xshift=-2.7cm, yshift=-1.2cm]n) {mapping of adjacent node outputs as edge inputs};
22+
\end{tikzpicture}
23+
\end{document}

docs/src/assets/makelatexfigs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,23 @@ if ! command_exists pdf2svg; then
1717
exit 1
1818
fi
1919

20-
latexmk -pdflua -shell-escape mathmodel.tex
20+
# List of figures to generate
21+
figures=(mathmodel edgemodel nodemodel)
22+
23+
# Generate light versions (default)
24+
echo "Generating light versions..."
25+
for fig in "${figures[@]}"; do
26+
latexmk -pdflua -shell-escape "${fig}.tex"
27+
done
28+
29+
# Generate dark versions
30+
echo "Generating dark versions..."
31+
for fig in "${figures[@]}"; do
32+
cp "${fig}.tex" "${fig}-dark.tex"
33+
NDTHEME=dark latexmk -pdflua -shell-escape "${fig}-dark.tex"
34+
rm "${fig}-dark.tex"
35+
done
36+
2137
latexmk -C
38+
# Clean up remaining temp files that latexmk -C might miss
39+
rm -f *.aux *.fdb_latexmk *.fls *.log *.pdf

0 commit comments

Comments
 (0)