Code Monkey home page Code Monkey logo

daddy's Introduction

DADDy

A constrained Differential Algebra-based Differential Dynamic programming solver.

Requirements

To use the DADDy code, you need a C++11 compiler.

The code was mainly tested on Unix distributions but could be adapted with very little effort.

The only dependency on this code is with the DACE, which can be found at: https://github.com/dacelib/dace. At installation on the DACE do not forget to use the AlgebraicMatrix<T> class in the CMakeLists.txt. Moreover, we recommend commenting the 189th line of the file dace/interfaces/cxx/DACEException.cpp to avoid useless and frequent warnings.

Setting up DADDy

We recommend using CMake to use DADDy and build the test cases. To use the DADDy library, simply clone this repository:

git clone https://github.com/ThomasClb/DADDy.git

Then create a build directory run cmake, and then compile the test_cases:

cd DADDy
mkdir build
cd build
cmake ../script/test_cases/
make

You might need to locate the DACE for cmake if it was not installed using:

sudo make install

Running the test cases

Nine test cases are given.

In the DADDy folder run:

./build/test_case <test_case ID> <parameters> 

Leaving the parameters field empty will return an error message that will inform you on what are the available options.

These parameters consist of 9 arguments:

  • Test case ID.
  • The address of the SpacecraftParameter. (They consist of the dynamical system, followed by the thrust-to-mass ratio of the spacecraft)
  • The DDP method to use. (recommended 3)
  • The number of trajectory segments N?
  • The time of flight in days.
  • Perform fuel optimal optimisation. (1=True, 0=False)
  • Perform solution polishing with Newton method. (1=True, 0=False)
  • Save the data. (1=True, 0=False)
  • Verbosity. (0=Full, 1=Medium, 2=None, 3=Benchmark)

For instance

  • The double integrator problem from [Lantoine and Russell 2012]:
     ./build/test_case 0 ./data/spacecraft_parameters/double_integrator_1e3.dat 3 11 0 0 0 1 0
    
  • The energy optimal Earth-Mars transfer from [Lantoine and Russell 2012]:
     ./build/test_case 1 ./data/spacecraft_parameters/tbp_SUN_5e-4.dat 3 40 348.79 0 1 1 0
    
  • The fuel optimal Earth-Mars transfer from [Lantoine and Russell 2012]:
     ./build/test_case 1 ./data/spacecraft_parameters/tbp_SUN_5e-4.dat 3 40 348.79 1 1 1 0
    
  • The fuel optimal Halo L2 to Halo L1 transfer from [Aziz et al. 2019]:
     ./build/test_case 5 ./data/spacecraft_parameters/cr3bp_EARTH_MOON_5e-4.dat 3 110 20 1 1 1 0
    

The results are saved in ./data/datasets.

Reading the source code of the test cases is highly recommended to understand how they work and how to use DADDy.

Visualisation

The visualisation of the results is done using Python 3. Just run:

./source/visualization/main.py <test_case ID> <parameters>

Where the parameters are:

  • Test case ID.
  • The thrust-to-mass ratio in N/kg. (string)
  • The time of flight in days. (integer)
  • The DDP method used.

For instance

  • The double integrator problem from [Lantoine and Russell 2012] with DDP method 3:
     ./source/visualisation/main.py 0 1e3 0 3
    
  • The fuel optimal Earth-Mars transfer from [Lantoine and Russell 2012] with DDP method 3:
     ./source/visualisation/main.py 1 5e-4 348 3
    
  • The fuel optimal Halo L2 to Halo L1 transfer from [Aziz et al. 2019] with DDP method 3:
     ./source/visualisation/main.py 5 5e-4 20 3
    

The results are saved in ./data/plots.

daddy's People

Contributors

thomasclb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.