Code Monkey home page Code Monkey logo

star-sailor's Introduction

Star Sailor - Solar Sail Dynamics Simulator

This is a project to kick off my 4th year undergraduate thesis. The goal of this simulator is for me to develop an intuition for working with solar sails and to develop a tool that can be used to simulate the dynamics of a solar sail in a variety of scenarios. The code in here will be used later one to help me develop a steering law for trajectory optimization.

Getting Started

Star Sailor runs on PyPy, which speeds up regular Python code. I am using this to compare against my previous projects built on regular Python, ctypes, and cffi. However, the code should be drop-in compatible with regular Python 3.8+.

To install, simply run pip install git+https://github.com/itchono/star-sailor. This will install the package and all of its dependencies. To run the simulator, simply run python -m star-sailor.

If installing on PyPy, use PyPy 3.8, and add the flag --extra-index-url https://antocuni.github.io/pypy-wheels/manylinux2010/ to the pip install command.

Dynamics

Star sailor is a 2D simulator using Cowell's method of propagation with the following accelerations:

Solar Radiation Pressure

$$a_{\text{SRP}} = \left[2 P_{\text{Sun}} \cdot \frac{A}{m} \cdot \cos^2 \alpha \right] \hat{n}$$ where $P_{\text{Sun}}$ is the solar irradiance at 1 AU, $A$ is the area of the sail, $m$ is the mass of the sail, and $\alpha$ is the angle between the sail normal ($\hat{n}$) and the sun vector.

This is for an ideal sail, which is perfectly reflective.

Gravity

$$a_{\text{grav}} = -\frac{\mu}{r^3} \boldsymbol{r}$$ where $\mu$ is the gravitational parameter of the central body, and $\vec{r}$ is the position vector of the spacecraft relative to the central body.

This is for a spherical central body (i.e. without J2 effects).

Integration

Time integration is done using the Dormand-Prince 8(7) method with a variable step size. The error tolerance is set to $10^{-12}$. The integration is done using the SciPy library. However, I am also looking at making my own integrator using extrapolation methods.

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.