Git Product home page Git Product logo

frispy's Introduction

TRAVIS COVERALLS LICENSE

FrisPy

Documentation for FrisPy package can be found here on RTD.

This repository contains a physical model for a flying disc. Using this code, one can simulate trajectories of discs with varying initial conditions, while also changing the underlying physical model. This is useful for analyzing the mechanics of a disc in terms of its design, as well as creating simulated throws for things like disc launchers or other helpful tools.

This is a pure Python rebuild of the old FrisPy code, which included a version of the integrator written in C for speed. Find the fast C simulation in the Frisbee_Simulator repository.

The earliest implementation of this model that I could find was by Sara Ann Hummel for their 2003 Masters thesis for UC Davis. You can find the document in full on this page.

Installation

The easiest way to install this package is with pip. The PyPI package can be viewed here.

pip install frispy

For developers

Development should be performed using poetry to handle the development environment. Once poetry is installed, you can install the environment, which will include frispy:

poetry install

All proceeding instructions assume you entered your virtual environment using poetry shell, otherwise prepend poetry run to all instructions.

If you intend to open a pull request, please make sure pre-commit is installed before committing to your branch:

pre-commit install

This will ensure that the code you submit is PEP8 compliant. Otherwise, CI checks will fail before merging can be completed.

Verify your installation by running:

pytest

Please report any problems you encounter on the issues page. Thank you!

frispy's People

Contributors

crzdg avatar tmcclintock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

frispy's Issues

Create docs

Use the basic sphinx build and host on either RTD or github pages.

Here is the TODO checklist:

  • create docs on readthedocs -- done, docs are found here
  • link the docs from the readme.rst page
  • link readme.rst to the index.rst page
  • translate README.md into rst
  • add a page describing the mathematics
  • add a page on the Model object and how to set your own values to try different flights
  • generate figures in a notebook and add them to the docs
  • use autoapi to split up the submodules more nicely

Cannot import disc from the top level namespace

The example notebooks suggest you can do something like

>>> from frispy import Disc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Disc' from 'frispy' (/home/jakeb/development/phase_c/venv/lib/python3.10/site-packages/frispy/__init__.py)

However, as Disc is not imported into the init.py file, this causes an error. Instead, you have to do >>> from frispy.disc import Disc

Eom + disc refactor

EOM should have instantaneous coordinate attributes. Everything can be computed off of setters.

Attribute Sara Hummel

Sara Hummel's original 2003 thesis on the topic (found here) is where I first found the ODEs. I attributed her in the other repo, and in the earlier version of this code, but I need to re-add the attributes in in the README and other places.

Create automated plotting routines

This should be straight forward. Things like labels and units should be standardized. Shortcut routines for plotting angles in a circular plot. Automatic rescaling. Etc.

InitialConditions object

The initial conditions of the disc are being passed in via a dictionary to the Disc's constructor. This isn't ideal because we can't pass in just a few ICs at a time (for instance just the velocity). This issue proposes implementing the InitialConditions class and making the Disc composed of an optional InitialConditions as an argument.

Make instantiation easier

After gathering some user feedback, instantiating the Disc is annoying, since creating it with one or two initial conditions changed (like z and vx, for instance) requires writing out the whole dict of initial coordinates. This should be streamlined.

roll our own RK4 solver

Or RK5. doesn't matter. scipy's solver is slow, so anything will do.

AC:

  • let the solver be passable
  • demonstrate that our own is faster

Unexpected behaviour with 0 horizontal velocity

Hi,

I've been playing around with some different initial conditions and am a bit confused why when throwing the frisbee vertically upwards with no spin it doesn't fall directly downwards.

Initial conditions:
Disc(vx = 0.00001, vz = 20, dgamma=0))

Output:
image

I also tried to plot the velocities.

image

It looks like rather than going straight up and back down again the frisbee has tilted to the right and sped up in that direction which confuses me as I can't understand why the disc would tilt that way. I also don't understand why vz appears to not go below 0 despite the disc appearing to fall in the visualisation.

Do you have any idea what might be causing this? Could it be an error in the underlying model, or is it some sort of artifact from the simulation?

Any help would be appreciated, thanks!

Figure out how to speed up the integrator

The default settings on the scipy integrator are suuuuper slow to converge. It takes upwards of 30 seconds to do so with the default throw. It is also very dependent on the initial velocity of the disc. Figure this out so that it isn't so crappy. It may be that the calculation has to be rephrased.

Unable to download version 1.1.0 with pip

Hey Tom it's McCann! Awesome repo. I ran into an issue today adding this module to a CI pipeline.

Steps to reproduce:

  1. python -m venv tempvenv
  2. source ./tempvenv/Scripts/activate
  3. pip install frispy
    Error output
    "ModuleNotFoundError: No module named 'numpy'"
    image

This error occurs even if numpy is installed :/

I think the problem is that we have import frispy inside setup.py. Is that intended?

Separate disc physical attributes and the actual environment

The Environment class contains constants used in computing the forces and torques. These include the disc's "immutable" physical characteristics like its mass, moments of inertia, and area as well as actual environmental factors like air density and force of gravity.

The first group is different than the second group and should be separated, so that Environment really only contains the environment. The former should become attached to the Disc.

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.