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
inverted pendulum fuzzy control python code (python 2.7.18)

inverted-pendulum-fuzzy-control- inverted pendulum fuzzy control python code (python 2.7.18) We have 3 general functions for 3 main steps: fuzzificati

arian mottaghi 4 May 23, 2022
In this repo i inherit the pos module and added QR code to pos receipt

odoo-pos-inherit In this repo i inherit the pos module and added QR code to pos receipt 1- Create new Odoo Module using command line $ python odoo-bin

null 5 Apr 9, 2022
This is an API to get user details for competitive coding platforms - Codeforces, Codechef, SPOJ, Interviewbit. More Platform will be Added Soon.

Competitive-Programming-Score-API An API to get user details for competitive coding platforms - Codeforces, Codechef, SPOJ, Interviewbit Platforms Ava

Aaditya Prakash 3 Jan 17, 2022
Recreating my first CRUD in python, but now more professional

Recreating my first CRUD in python, but now more professional

Ricardo Deo Sipione Augusto 2 Nov 27, 2021
Fonts used to be an install-and-forget thing, but many of are now updated regularly.

Your font manager. Fonts used to be an install-and-forget thing, but many of are now updated regularly. fontman helps you keep track of the fonts you

Nico Schlömer 20 Feb 7, 2022
Bots in moderation and a game (for now)

Tutorial: come far funzionare il bot e durarlo per 24/7 (o quasi...) Ci sono 17 passi per seguire: Andare sul sito Replit https://replit.com/ Vedrete

ZacyKing 1 Dec 27, 2021
Improved version calculator, now using while True and etc

CalcuPython_2.0 Olá! Calculadora versão melhorada, agora usando while True e etc... melhorei o design e os carai tudo (rode no terminal, pra melhor ex

Scott 2 Jan 27, 2022
Your Google Recon is Now Automated

GRecon : GRecon (Greei-Conn) is a simple python tool that automates the process of Google Based Recon AKA Google Dorking The current Version 1.0 Run 7

adnane-tebbaa 189 Dec 21, 2022
Now you'll never be late for your Webinars or Meetings on the GoToWebinar Platform

GoToWebinar Launcher : Now you'll never be late for your Webinars or Meetings on the GoToWebinar Platform About Are you popular for always being late

Jay Thorat 6 Jun 7, 2022
vFuzzer is a tool developed for fuzzing buffer overflows, For now, It can be used for fuzzing plain vanilla stack based buffer overflows

vFuzzer vFuzzer is a tool developed for fuzzing buffer overflows, For now, It can be used for fuzzing plain vanilla stack based buffer overflows, The

Vedant Bhalgama 5 Nov 12, 2022
Python implementation of an automatic parallel parking system in a virtual environment, including path planning, path tracking, and parallel parking

Automatic Parallel Parking: Path Planning, Path Tracking & Control This repository contains a python implementation of an automatic parallel parking s

null 134 Jan 9, 2023
Implementation of the Angular Spectrum method in Python to simulate Diffraction Patterns

Diffraction Simulations - Angular Spectrum Method Implementation of the Angular Spectrum method in Python to simulate Diffraction Patterns with arbitr

Rafael de la Fuente 276 Dec 30, 2022
Python implementation of the ASFLIP advection method

This is a python implementation of the ASFLIP advection method . We would like to hear from you if you appreciate this work.

Raymond Yun Fei 133 Nov 13, 2022
A Gura parser implementation for Python

Gura parser This repository contains the implementation of a Gura format parser in Python. Installation pip install gura-parser Usage import gura gur

JWare Solutions 19 Jan 25, 2022
A python implementation of differentiable quality diversity.

Differentiable Quality Diversity This repository is the official implementation of Differentiable Quality Diversity.

ICAROS 41 Nov 30, 2022
Reference python implementation of Chia pool operations for pool operators

This repository provides a sample server written in python, which is meant to server as a basis for a Chia Pool. While this is a fully functional implementation, it requires some work in scalability and security to run in production.

Chia Network 451 Dec 13, 2022
A fast python implementation of DTU MVS 2014 evaluation

DTUeval-python A python implementation of DTU MVS 2014 evaluation. It only takes 1min for each mesh evaluation. And the gap between the two implementa

null 82 Dec 27, 2022
Demo of a WAM Prolog implementation in Python

Prol: WAM demo This is a simplified Warren Abstract Machine (WAM) implementation for Prolog, that showcases the main instructions, compiling, register

Bruno Kim Medeiros Cesar 62 Dec 26, 2022
Python implementation of Newton's Fractal

Newton's Fractal Animates Newton's fractal between two polynomials of the same order. Inspired by this video by 3Blue1Brown. Example fractals can be f

Jaime Liew 10 Aug 4, 2022