Embody is an F# library that allows you to easily define, execute, and validate
Embody started out as an interactive .NET notebook where you could simulate and evaluate
Currently, Embody is a single package that tackles a couple different responsibilities, including: vector operations, numerical integration, and plot visualisation.
The standard way of working with the library is via interactive .NET notebooks.
- VS Code
- .NET 6 SDK
- .NET Interactive Notebooks extension
In order to create a blank notebook:
-
Press
Ctrl + Shift + P
in VS Code editor. -
Select the ".NET Interactive: Create new blank notebook" option.
-
Select "Create as .dib".
-
Select "F#".
-
The notebook should open. Type the following line into the code block:
#r "nuget: Embody"
and then press
Shift + Enter
or press "Execute cell".In general, you should specify a package version after the package name, like this:
#r "nuget: Embody, 0.2.0"
. For the most recent version, please check the "Script & Interactive" tab at the Package page. -
After the package is imported, you can perform a simple vector arithmetic to verify if the package works. Type the following code into the second code block:
open Embody.LinearAlgebra let a = vector3 0.1 0.2 0.3 let b = vector3 1.0 2.0 3.0 a + b
After executing the cell, you should see the following output:
x y z 1.1 2.2 3.3 -
Congratulations! You've successfully created a .NET interactive notebook, and imported the Embody package. The next step would be to define an
$n$ -body system. Example(s) can be found here.
- Documentation page.
- Theoretical background behind implemented numerical methods and orbital simulations.
- Performance optimization.
- Memory usage consideration (it is currently a bit too easy to have all your RAM consumed by a long-running simulation).