Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 3 KB

README.md

File metadata and controls

67 lines (44 loc) · 3 KB

Embody

.NET Build and Test GitHub issues GitHub Nuget

Embody is an F# library that allows you to easily define, execute, and validate $n$-body simulations.

Summary

Embody started out as an interactive .NET notebook where you could simulate and evaluate $n$-body systems (most notably, the Earth-Moon-Sun system, and Jupiter with its myriad of moons). The notebook kept on growing, so ultimately most of the code was moved into a separate package.

Currently, Embody is a single package that tackles a couple different responsibilities, including: vector operations, numerical integration, and plot visualisation.

Getting started

The standard way of working with the library is via interactive .NET notebooks.

Prerequisites

First notebook

In order to create a blank notebook:

  1. Press Ctrl + Shift + P in VS Code editor.

  2. Select the ".NET Interactive: Create new blank notebook" option.

  3. Select "Create as .dib".

  4. Select "F#".

  5. 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.

  6. 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
  7. 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.

Future plans / TODOs

  • 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).