Double Pendulum implementation in Python, now with added pendulums and trails :D

Overview

Double Pendulum Using Curses in Python.

Build with <3 Made with python 

Code style: black   Twitter   PyPI version

A nice relaxing double pendulum simulation using ASCII, able to simulate multiple pendulums at once, and provide tracing of pendulums as well as providing some system information. If you spot any bugs or features that need adding (especially with the specs), just open an issue :)

Demo Gif

Features

  • As mentioned, able to simulate multiple pendulums at once.
  • Able to specify the weight and mass of pendulums to create different butterfly effects.
  • Uses equations from here.
  • If -s is used, it grabs system specs and displays them.(hi r/unixporn)
  • Obviously a lot could be done to it (see below the Args), Any contributions are appreciated)

Quickstart:

Dependencies: Python 3.2+,curses (standard on UNIX) or relevent windows port, psutils if you want to use -s

Github

  • Clone using https://github.com/Nekurone/double-pendulum-ascii.git or download the zip.
  • Extract if necessary and head inside the folder.
  • python3 pendulum.py [args]

Pip

  • python3 -m pip install double-pendulum (or pip install double-pendulum)
  • double-pendulum [args]

Args

Visuals

Maths and Pendulum settings

Window settings

Visuals

--help (-h)

Spits out a fairly standard argparse help message. Note this is printed out when the program is run anyway.
type: None, default: None setting in example: -h

--trace (-t)

Enables 'tracing', a faint line behind the pendulums that fades.
type: bool, default: off, setting in example: -t

--traceDrop (-tD)

Controls the rate at which the trace from -t fades. Higher is faster fading.
type: float, default: 1.0, setting in example: -t -tD 0.5

--specs (-t)

Enables showing system info, note this feature is still a WIP, any bugs or issues just let me know.
type: bool, default: off, setting in example: -s

Maths and Pendulum Settings

--pendulum (-p)

Number of pendulums to simulate at once. Combine with the gravity settings and some speed settings for some really pretty visuals.
type: int, default: 1, setting in example: -p 300

--speed (-sP)

Multiplier for speed of simulation. Around 0.5-1.5 is a good range
type: float, default: 1.0, setting in example: -sP 3.0

--gravity(-g)

Controls the strength of gravity, note, this directly affects the speed of the simulation. So slowing down is recommended.
type: float, default: 9.81, setting in example: -g 1

--mass (-m)

Controls the mass of the pendulums, useful mostly for butterfly effects
type: float, default: 100.0, setting in example: -m 300 -sP 0.2

--length (-l)

Controls the length of the arms of the pendulums, useful mostly for butterfly effects
type: float, default: 250.0, setting in example: -l 150 -sP 0.3

todo: Window settings

If you have any suggestions, or anything you'd like to add (or, more likely you found a bug) just open a PR :)

Comments
  • Add WM feature

    Add WM feature

    I use i3wm, and it seems that theres only a DE function, which returns Generic Mabye change the line to WM/DE: or make a seperate line stating the wm currently running

    opened by Rstar284 2
  • Remove title() on info values

    Remove title() on info values

    in pendulum.py we have stdscr.addstr(i+3,(len(x)+1),': {0}'.format(sys_specs[x].title())) on line 330, this has proved unpopular and will be changed to stdscr.addstr(i+3,(len(x)+1),': {0}'.format(sys_specs[x]))

    opened by Nekurone 0
  • Username not showing up

    Username not showing up

    When i was observing your code, i saw a function get_user(), and it seems its not being used anywhere in the code, thus not showing the {username}@{hostname} line image

    opened by Rstar284 0
  • Clean up variable names.

    Clean up variable names.

    Speaks for itself, variables are mostly 1 letter temp variables right now and all over the show. Implementing them with actual, readable names would improve readability.

    good first issue 
    opened by Nekurone 0
  • Move drawing functions to new file

    Move drawing functions to new file

    Improving readability is a big part of this project, as ideally I'd like it to become a reference for some of the more jank solutions when working with curses, moving the draw functions out of pendulum.py would improve that

    enhancement 
    opened by Nekurone 0
  • Add more variables to the parser

    Add more variables to the parser

    Variables such as epsilon, both masses and both length rather than them being equal to mass and length respectively,

    Would allow more functionality for chaos effects without code editing.

    good first issue 
    opened by Nekurone 0
Releases(v1.2)
Owner
Nekurone
Nekurone
A python library for writing parser-based interactive fiction.

About IntFicPy A python library for writing parser-based interactive fiction. Currently in early development. IntFicPy Docs Parser-based interactive f

Rita Lester 31 Nov 23, 2022
A dead-simple service that notifies you when something goes down.

Totmannschalter Totmannschalter (German for dead man's switch) is a simple service that notifies you when it has not received any message from a servi

1 Dec 20, 2021
Simple control of Thorlabs Elliptec devices from Python.

Elliptec Simple control of Thorlabs Elliptec devices. No docs yet » Get started · Report a bug · Request a feature About The Project ThorLabs Elliptec

David Roesel 8 Sep 22, 2022
An example project that shows how to check if a certain macro is active in a file.

PlatformIO Check Compiler Flags Example Description Demonstrates the usage of an extra script and a special compilter invocation to get the active mac

Maximilian Gerhardt 1 Oct 28, 2021
A curated list of awesome things related to Pydantic! 🌪️

Awesome Pydantic A curated list of awesome things related to Pydantic. These packages have not been vetted or approved by the pydantic team. Feel free

Marcelo Trylesinski 186 Jan 05, 2023
GEGVL: Google Earth Based Geoscience Video Library

Google Earth Based Geoscience Video Library is transforming to Server Based. The

3 Feb 11, 2022
This application is made solely for entertainment purposes

Timepass This application is made solely for entertainment purposes helps you find things to do when you're bored ! tells jokes guaranteed to bring on

Omkar Pramod Hankare 2 Nov 24, 2021
pythonOS: An operating system kernel made in python and assembly

pythonOS An operating system kernel made in python and assembly Wait what? It uses a custom compiler called snek that implements a part of python3.9 (

Abbix 69 Dec 23, 2022
Yet another Python Implementation of the Elo rating system.

Python Implementation - Elo Rating System Yet another Python Implementation of the Elo rating system (how innovative am I right?). Only supports 1vs1

Kraktoos 5 Dec 22, 2022
Declarative and extensible library for configuration & code separation

ClassyConf ClassyConf is the configuration architecture solution for perfectionists with deadlines. It provides a declarative way to define settings f

83 Dec 07, 2022
Simple application that does transformation with HPF and LPFs.

Simple application that applies Butterworth, Gaussian & Ideal kernels on HPF and LPFs -aka Frequency Domain Filtering- Upload image from sidebar, set

Merve Noyan 3 Jul 06, 2022
Pdraw - Generate Deterministic, Procedural Artwork from Arbitrary Text

pdraw.py: Generate Deterministic, Procedural Artwork from Arbitrary Text pdraw a

Brian Schrader 2 Sep 12, 2022
🏆 A ranked list of awesome Python open-source libraries and tools. Updated weekly.

Best-of Python 🏆 A ranked list of awesome Python open-source libraries & tools. Updated weekly. This curated list contains 230 awesome open-source pr

Machine Learning Tooling 2.7k Jan 03, 2023
Push Prometheus metrics to VictoriaMetrics or other exporters

Push metrics from your periodic long-running jobs to existing Prometheus/VictoriaMetrics monitoring system.

olegm 14 Nov 04, 2022
Projeto job insights - Projeto avaliativo da Trybe do Bloco 32: Introdução à Python

Termos e acordos Ao iniciar este projeto, você concorda com as diretrizes do Código de Ética e Conduta e do Manual da Pessoa Estudante da Trybe. Boas

Lucas Muffato 1 Dec 09, 2021
Python Script to add OpenGapps, Magisk, libhoudini translation library and libndk translation library to waydroid !

Waydroid Extras Script Script to add gapps and other stuff to waydroid ! Installation/Usage "lzip" is required for this script to work, install it usi

Casu Al Snek 331 Jan 02, 2023
Oblique Strategies for Python

Oblique Strategies for Python

Łukasz Langa 3 Feb 17, 2022
Uma versão em Python/Ursina do aplicativo Real Drum (android).

Real Drum Descrição Esta é uma versão alternativa feita em Python com a engine Ursina do aplicatio Real Drum (presente no Google Play Store). Como exe

hayukimori 5 Aug 20, 2022
OTP-Bomber - An otp from MPL ID app, which can be spammed

OTP-Bomber An otp from MPL ID app, which can be spammed Note: Only available on

5 Oct 29, 2022
A simple flashcard app built as a final project for a databases class.

CS2300 Final Project - Flashcard app 'FlashStudy' Tech stack Backend Python (Language) Django (Web framework) SQLite (Database) Frontend HTML/CSS/Java

Christopher Spencer 2 Feb 03, 2022