Web GL Ocean Simulation
81–90 of 138 posts
Re: Web GL Ocean Simulation
#82Earlier quoted context omitted.
I'm not implying yours are not unstable, it's just there is a chance it might be. Typically exact formulas exhibit such properties. LU decomposition is numerically stable, for the most part. You can run into problems with floating point arithmetic if you're not careful. This just has to do with the way you solve the problem. By breaking up the matrix into an upper and lower triangular part and solving the resulting t…
Wait, no, LU decomposition is not stable unless you're doing pivoting. And if you're doing pivoting, then it very much stops looking like an "exact formula", because it'll get filled up by ifs and variable renamings, etc. There's plenty of cases in graphics and simulation where solving even a 4x4 matrix needs careful numeric consideration (see this paper about tetrahedral mesh simplification, section III.D, page 7: h…
And good recommendation by Strang. I believe he has some fantastic MIT OpenCourse lectures on numerical linear algebra as well.
Re: Web GL Ocean Simulation
#83Re: Web GL Ocean Simulation
#84Earlier quoted context omitted.
Look into something like Octave, where matrices are first-order data types, and you'll know exactly what he means.
Had a look. Still think JS is fine.
There is a larger upfront cost to learning the right language for the right job. However, many people opt to try to fit a square peg into a round hole.
Re: Web GL Ocean Simulation
#85Where would one start if they wanted to learn the math needed to achieve something like this?
http://matrixanalysis.com/DownloadChapters.html
Here is a link I found yesterday which gets you solving the 2D NS equations.
http://lorenabarba.com/blog/cfd-python-12-steps-to-navier-st...
I've take a quick look through it and it seems pretty good. It introduces many of the most important ideas of solving PDEs. Obviously there are huge tomes on various techniques to solve the Navier-Stokes equations but this link, I think, does a pretty good elementary introduction. A more comprehensive treatment would require a more thorough background in mathematics (e.g. I wrote a 2D NS solver using the vorticity formulation and FFTs but to understand the equivalence requires a greater background).
As for the cool visualisation, I cannot help you. I don't know any fancy graphics programming since I normally use the built-in plotting tools of Python and Matlab.
Re: Web GL Ocean Simulation
#86The code is quite cool to look at. Love seeing the extensive use of matrices and mathematics to create such a beautiful and mesmerizing display. If anyone is interested in playing around with it, I threw it up at JSFiddle here: http://jsfiddle.net/zyAzg/ Excellent demo.
Great demo, well written code. Though reading through it also highlights that JS is not a great language for linear algebra. But I don't think anyone is really suggesting otherwise.
I thought the only consideration would be speed? The algebra is mainly looping. Isn't that way most languages try to handball algebra to LAPACK/BLAS?
Re: Web GL Ocean Simulation
#87Earlier quoted context omitted.
Unless you like econometrics: then X are data, betas and gammas and sigmas are unknown (oh my!). Jargon is fun, unless I want to communicate across fields :/.
Well today I learned. I never knew that. Stupid mathematics and its inconsistent notation.
Re: Web GL Ocean Simulation
#88Earlier quoted context omitted.
"JS is not a great language for linear algebra." what does that even mean? It's a general purpose language. It all boils down to how you want to use it, like any other general purpose language. A lot of times in cases like this, people choose not to make it look pretty and easy to read to gain performance. This simulation is very CPU intensive, trying to have pretty code and speed is going to be tough.
Look into something like Octave, where matrices are first-order data types, and you'll know exactly what he means.
Then again, I might be biased there since I've spent a decent chunk of time porting MATLAB/Octave code to Python/Numpy so that we could get it into production in a robust way..
Re: Web GL Ocean Simulation
#89Re: Web GL Ocean Simulation
#90This runs at about 7 frames per second in Chrome on my 10-month-old 13" Macbook Pro at work. Are people with better graphics cards seeing 60 (or even 30) fps? I'd love to be able to see this in all its glory.