Code Monkey home page Code Monkey logo

double-pendulum's Introduction

Double Pendulum

This repo contains the code for creating an animation of a Double Pendulum using Manim Community Edition

Usage

This guide assumes you have a resonably new version of python3 and pip installed.

To get started, we have to first install the necessary dependencies.

But before that we have to create and activate a virtual environment. See this for more information.

Once the virtualenv has been created, we can now proceed to install everything.

The requirements.txt contains all the dependencies. So install it using the following commands in the terminal:

  1. cd path/to/folder/

  2. pip install -r requirements.txt

Now check if manim is installed:

  • manim --version

If the command throws no errors then manim has been installed successfully.

Now to compile the code use these commands:

  • manim -pqh doublePend.py DoublePendulum

Here -pqh tells manim to render it in high quality (-ql flag) and to preview (-p flag) it after compilation.

Click here to see what CLI flags can be used to change render quality.

Configuring the initial conditions of pendulum


The following quantities can be configured in the __init__ function of the DoublePendulum class:

  • masses of the balls,
  • lengths of the rigid massless rods
  • acceleration due to gravity
  • initial angles
  • factor that determines energy dissipation
  • frame rate of the video
  • how long the animation should run
  • seconds history of the trail

double-pendulum's People

Contributors

hbarua05 avatar

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.