Giter Club home page Giter Club logo

particle-simulation's Introduction

Hi, I'm Devin!

I'm interested in a lot of things, but especially computer architecture and all that low-level stuff that is often overlooked.

I like coming up with brand new ideas for low-level projects and implementing them, usually involving both software and hardware.

particle-simulation's People

Contributors

sgnull avatar

Watchers

 avatar

particle-simulation's Issues

FPS Counter

Having an FPS Counter somewhere on screen would be really helpful as a basic performance metric.

Wrap Around Causes Big Performance Hit

Had some bugs with drawing, so I tried turning wrap around off, and the performance difference was visible. I don't have any hard numbers on this yet, I just know that it's pretty bad.

This is a particularly interesting issue for me, though, because IIRC wrap-around was a natural consequence of the physics calculations the last time I tried this project, not some conditional distance vector alteration. Perhaps this is related to issue #9

Inverted Normal Force

It seems like, from the simulations I've ran, that the normal force actually pulls particles in instead of pushing them away. This should be a simple fix.

Collision causes jittery, fast-moving particles.

Something is definitely wrong with the component force equations, because collisions do not work like they should. Collisions cause particles to jitter a lot, move really fast, then eventually separate.

Drawing Particles Significantly Impacts Performance

Solving this would solve issue #3. The impact is extremely significant; drawing results in over a 100% increase in simulation times. There are two options:

  • Replace graphics.py
  • Reduce the pixels graphics.py has to update

First I'm going to try the latter, then possibly work on the former. One alternative to graphics.py is pygame, but I've heard of bad performance from that package too.

Switch to Numpy

Switching to Numpy would allow for easier vector math, making force calculations much more elegant. It might also result in them being faster.

Seperate & Optimize interact_with_particle()

Separating the interact_with_particle function from the Particle object would hopefully allow for some optimization. Instead of calling this function twice for both particles in the pie slice, just call it once on both particles and handle both of their interactions at once. The only difference between their calculations is the direction of the distance_vector and the net force.

This is related to issue #3

Low Performance from Bad FPS Limiter

As of right now, the simulation can run with about 20-30 particles before some serious lag sets in. This is not a huge issue at the moment, as this is sufficient for testing purposes, but it will be eventually. We're shooting for 500+ particles here.

I suspect the problem lies with the graphics.py package, so I will need to look for a better package to use for this project.

Particle Interactions Don't Wrap Around

Basically title. The particle interactions don't take into account the wrap-around setting. This seems to be resulting in particles gathering at the corners of the screen.

Simulation Struggles With <200 Particles

With physics implemented, it is time to address the elephant in the room. The performance was known to be poor from the beginning, but with the addition of physics this has become far more pronounced. This more than likely comes down to optimizations, but it could also have something to do with the graphics.py package.

To be more specific: 200 particles now seriously lags the simulation.

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.