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
An example of Connecting a MySQL Database with Python Code

An example of Connecting And Query Data a MySQL Database with Python Code And How to install Table of contents General info Technologies Setup General

Mohammad Hosseinzadeh 1 Nov 23, 2021
Create Arrays (Working with For Loops)

DSA with Python Create Arrays (Working with For Loops) CREATING ARRAYS WITH USER INPUT Array is a collection of items stored at contiguous memory loca

1 Feb 08, 2022
python scripts - mostly automation scripts

python python scripts - mostly automation scripts You can set your environment in various ways bash #!/bin/bash python - locally on remote host #!/bi

Enyi 1 Jan 05, 2022
Streamlit Component, for a Chatbot UI

st-chat Streamlit Component, for a Chat-bot UI, example app authors - @yashppawar & @YashVardhan-AI Installation Install streamlit-chat with pip pip i

Yash AI 99 Jan 07, 2023
Skip spotify ads by automatically restarting application when ad comes

SpotiByeAds No one likes interruptions! Don't you hate it when you're listening to your favorite jazz track or your EDM playlist and an ad for Old Spi

Partho 287 Dec 29, 2022
💘 Write any Python with 9 Characters: e,x,c,h,r,(,+,1,)

💘 PyFuck exchr(+1) PyFuck is a strange playful code. It uses only nine different characters to write Python3 code. Inspired by aemkei/jsfuck Example

Satoki 10 Dec 25, 2022
Apilytics for Python - Easy API analytics for Python backends

apilytics-python Installation Sign up and get your API key from https://apilytics.io - we offer a completely free trial with no credit card required!

Apilytics 6 Sep 29, 2022
A carrot-based color palette you didn't know you needed.

A package to produce a carrot-inspired color palette for python/matplotlib. Install: pip install carrotColors Update: pip install --upgrade carrotColo

10 Sep 28, 2021
📜Generate poetry with gcc diagnostics

gado (gcc awesome diagnostics orchestrator) is a wrapper of gcc that outputs its errors and warnings in a more poetic format.

Dikson Santos 19 Jun 25, 2022
Drug Discovery App Using Lipinski's Rule-of-Five.

Drug Discovery App A Drug Discovery App Using Lipinski's Rule-of-Five. TAPIWA CHAMBOKO 🚀 About Me I'm a full stack developer experienced in deploying

tapiwa chamboko 3 Nov 08, 2022
Easy installer for running Amazon AVS Device SDK on Raspberry Pi

avs-device-sdk-pi Scripts to enable Alexa voice activation using Picovoice Porcupine If you like the work, find it useful and if you would like to get

4 Nov 14, 2022
Viewflow is an Airflow-based framework that allows data scientists to create data models without writing Airflow code.

Viewflow Viewflow is a framework built on the top of Airflow that enables data scientists to create materialized views. It allows data scientists to f

DataCamp 114 Oct 12, 2022
The Great Autoencoder Bake Off

The Great Autoencoder Bake Off The companion repository to a post on my blog. It contains all you need to reproduce the results. Features Currently fe

Tilman Krokotsch 61 Jan 06, 2023
Exploring basic lambda calculus in Python

Lambda Exploring basic lambda calculus in Python. In this repo I have used the lambda function built into python to get a more intiutive feel of lambd

Bhardwaj Bhaskar 2 Nov 12, 2021
Online HackerRank problem solving challenges

LinkedListHackerRank Online HackerRank problem solving challenges This challenge is part of a tutorial track by MyCodeSchool You are given the pointer

Sefineh Tesfa 1 Nov 21, 2021
Python script which synchronizes the replica-directoty with the original-one.

directories_synchronizer Python script which synchronizes the replica-directoty with the original-one. Automatically detects all changes when script i

0 Feb 13, 2022
Today I Commit (1일 1커밋) 챌린지 알림 봇

Today I Commit Challenge 1일1커밋 챌린지를 위한 알림 봇 config.py github_token = "github private access key" slack_token = "slack authorization token" channel = "

sunho 4 Nov 08, 2021
Buggy script to play with GPOs

GPOwned /!\ This is a buggy PoC I made just to play with GPOs in my lab. Don't use it in production! /!\ The script uses impacket and ldap3 to update

45 Dec 15, 2022
Explore related sequences in the OEIS

OEIS explorer This is a tool for exploring two different kinds of relationships between sequences in the OEIS: mentions (links) of other sequences on

Alex Hall 6 Mar 15, 2022
OnTime is a small python that you set a time and on that time, app will send you notification and also play an alarm.

OnTime Always be OnTime! What is OnTime? OnTime is a small python that you set a time and on that time, app will send you notification and also play a

AmirHossein Mohammadi 11 Jan 16, 2022