Tutorials for learning neural closure models for various discretized PDEs, including
- the viscous Burgers equations in 1D
- the incompressible Navier-Stokes equations in 2D
The tutorials are provided as Julia scripts. Markdown and Jupyter notebook versions are auto-generated from the Julia source files using Literate.jl.
Burgers | Navier-Stokes |
---|---|
Source file | Source file |
Markdown | Markdown |
Notebook | Notebook |
See the script make.jl
for converting the script to markdown or
notebook.
It is recommended to start with the Burgers tutorial. The tutorial includes some exercises, but you do not need to know Julia to do them. Setting up the tutorial environment may take a few minutes. With the default parameters, the tutorial should run in about a minute on a modern laptop (including training).
To run the tutorials locally, you need to install Julia on your machine. An editor such as VSCode can also be useful. Proposed workflow:
-
Install Julia from one of the two options:
- the official Juliaup version manager. This is the preferred way, as you will get notified about updates to Julia. It requires typing a line into your command line. See the Juliaup README for installation instructions.
- the official downloads page (select the binary for your platform)
Do not install Julia from your platform's package manager (e.g.
apt
on Ubuntu), as these versions may have flaws). -
Install VSCode
-
Install the Julia extension for VSCode. This gives syntax highlighting, code execution with
Shift
+Enter
etc. -
Clone the repository in VSCode:
-
Create a new window:
Ctrl
/Cmd
+Shift
+N
-
Open the Source control side panel with
Ctrl
/Cmd
+Shift
+G
-
Click the button
Clone Repository
. If you do not see this button, there should be an instruction there instead to first install Git. -
Paste the following URL:
https://github.com/agdestein/NeuralClosure/
-
Select a location for where you want the folder
-
Open the cloned repository
-
-
Activate the project: A notification should pop up asking you about the environment. If not, click on the
v1.9
environment symbol in the bottom bar of VSCode, or, alternatively, open the command palette (Ctrl
/Cmd
+Shift
+P
), start typingjulia
, and selectJulia: Change current environment
. Set the environment toNeuralClosure
. -
In the file explorer (
Ctrl
/Cmd
+Shift
+E
), you should see the files. Opentutorials/burgers.ipynb
. You can skip the Colab section. Start with uncommenting and executing the cell withPkg.instantiate()
, which will install the local dependencies. Execute the notebook one cell at the time withShift
+Enter
. Output and plots should appear below each cell.
Note: If you do not like the notebook format, you can alternatively open the
source script tutorials/burgers.jl
or the markdown file
tutorials/burgers.md
. Both can be executed interactively one Julia line at
the time with Shift
+ Enter
. Then a separate Julia REPL will pop up, and
plots will appear in a separate plot pane. To visualize the LaTeX equations,
open the markdown file and press Ctrl
/Cmd
+ Shift
+ V
to render the
markdown (with equations) in a new pane.
If you do not want to install Julia locally, you can run it on a Google cloud machine instead. This requires a Google account. Steps:
- Open Google Colab
- Sign in to your Google account.
- Click on
File > Upload Notebook > GitHub
and paste the following url:Selecthttps://github.com/agdestein/NeuralClosure/
tutorials/burgers.ipynb
. - Follow the Colab instructions in the top of the notebook.