Settings

Theme

Simulation class: 2D wave equations (in browser)

encinographic.blogspot.com

52 points by jedp · 13 comments

Reader

8 threads
gballan

Love it. Perhaps you'll like this nonlinear wave equation (in browser) http://puzlet.com/m/b00f0 .

SeanDav

I wondered what language it was written in and found out after a little research: http://processing.org/

VMG

I loved playing around with this kind of water simulation when I was younger, the basic principle behind it is very simple. Spent many hours optimizing C++ and OpenGL code.

I still haven't figured out though how to stop wave reflection at the edges though...

  • chengsun

    The trick is to perform damping around the edges in a hidden border around the heightmap. Say you wanted to simulate a 500x500 heightmap. You would actually calculate the results for a 700x700 heightmap, (which contains a hidden border of width 100 around each edge). The hidden edges are slowly damped away by multiplying by a factor interpolated between 1 (on the inner edge of the visible part of the heightmap) 0 (on the very outside of the heightmap).

    This works remarkably well; you can see this approach in action in http://www.falstad.com/ripple/ for instance. Source code is included on the page.

    • VMG

      Thanks for the answer, I actually tried something like that but it never worked out completely. There always was a small residual amount of noise that prevented simulating a true infinite pool. I tried to come up with the necessary equations for the pool margins so that I wouldn't need a hack, but couldn't figure it out. One of those days I will!

oofabz

If you like wave equations, you might also enjoy EmeWave:

http://psych.colorado.edu/~oreilly/emewave.html

The movies at the bottom of the page are great, and if you want to see how it's done, his papers give a thorough and rigorous explanation that is easy to translate into code.

noobermin

This is just pure awesome. It is so awesome, that I was jealous of the author for not being able to do this first, I almost didn't upvote it out of that jealously--it's that good. Keep up the good work!

(I'm working on hacking together sims myself but for a larger project--I'm part of a computation group at some state uni modeling HED plasmas.)

quarterwave

Very nice! I assume clicking inside the panel is like throwing a pebble in a pond? Is this correct?

  • acadien

    Yes it is very similar, it sets the value at that grid point to its maximum height. This causes the neighboring grid cells to react accordingly (Laplacian in space), giving the rippling effect.

kybernetyk

Nice. Reminds me of old school demo effects.

jhurliman

Amazing!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection