Git Product home page Git Product logo

center_of_mass_visualisation's Introduction

CENTER OF MASS VISUALISATION

I. Info

This project visualizes the motion of particles in one Cartesian axis and the center of mass in both Cartesian axes.

The program includes:

๐Ÿ”น masses of the particles,

๐Ÿ”น constant forces that interact with particles,

๐Ÿ”น initial positions of the particles,

๐Ÿ”น initial velocity,

๐Ÿ”น number of iterations,

๐Ÿ”น time of the process.

Initial data is stored in init_data.txt. Output can be found in output.txt file.

If you want to skip physics stuff and math explanation of the topic than skip to installation.

II. Theoretical explanation and problem

The problem is to find final coordinates of the center of the mass after some seconds.

a) Center of mass equation

If we want to find coordinates of the center of the mass we would use this equation:

Center of mass equation

source: http://hyperphysics.phy-astr.gsu.edu/hbase/cm.html

b) Dynamic equation of motion

In the book I gave as a source, you can find an analytical solution to this problem, but I wanted to do it numerically. So I used Newton's second law of motion.

II Newtons law

The acceleration is the second derivative of the position, so I changed a to the second derivative.

Force is the force that acts on the selected particle in the plane.

The solution is the function x(t).

This is the answer to how my program works. It solves this second derivative, calculates the positions of the particles based on the calculated function, and from this it calculates the position of the center of mass.

III. Installation

The program is a simulation, not a library, so you can download it right away and use it.

IV. Instructions

PRESS 'Q' TO EXIT

If you just want to see the solution to the problem and its visualization:

๐Ÿ”น enable the executable file

๐Ÿ”น view the visualization,

๐Ÿ”น run output.txt. There you can see the final position of the particles and the center of mass.

If you want to play with the simulation:

๐Ÿ”น boot up init_data.txt,

๐Ÿ”น read the rules,

๐Ÿ”น stick to the rules!

๐Ÿ”น add/remove particles,

๐Ÿ”น save init_data.txt,

๐Ÿ”น run executable file and after visualization output.txt.

Screenshot of program

center_of_mass_visualisation's People

Contributors

equerm8 avatar

Watchers

 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.