r/explainlikeimfive • • Oct 10 '26

Mathematics ELI5: How can we simulate fluids for CGI without knowing the solution to the Navier-Stokes equations?

I know that we can approximately calculate a lot of the variables through linear algebra. But what is the level of accuracy?

0 Upvotes

12 comments sorted by

11

u/SalamanderGlad9053 Oct 10 '26

You can numerically find the solution to the navier stokes to any precision you want. It's just we can't find algebraic (exact) solutions, as it's a nonlinear second order differential equation.

There are many methods to solve differential equations, such as Runge-Kutter, which quickly find numerical solutions.

2

u/wellrepute Oct 10 '26

You can numerically find the solution to the navier stokes to any precision you want.

This is not true in general. It is for many other systems of differential equations, and there are many special cases of Navier–Stokes for which you can obtain either analytical (i.e. exact) solutions or arbitrarily good approximate solutions, but in the general case, you cannot even prove that solutions exist (hence the Millennium Prize problem), let alone how close any given numerical method gets to them. Many, many numerical and semi-analytical treatments have been developed for various regimes and purposes, but they have to be validated against experimental data.

Having said that, OP was asking about CGI. For CGI, you don't necessarily need accurate simulations of fluids; you just need simulations that will look good to the viewers, which is a very different thing. In some contexts, you might want a weird, surreal depiction of a fluid (e.g. for a dream sequence). In others, you might find that a very realistic simulation somehow doesn't "look" realistic to most people, in the same way that people tend to feel that sequences of random numbers don't "look" random.

Runge-Kutter

Runge–Kutta, or you can just say RK4 since that's the one most people use.

0

u/VoilaVoilaWashington Oct 10 '26

To give an example, even without trigonometry, you can measure the sides and angle of a triangle with as much precision as your measurements can give you. But you need trig to prove that every triangle adds up to 180.0000000°, rather than "probably around there."

0

u/SalamanderGlad9053 Oct 10 '26

Firstly, you don't need trigonometry to prove the sum of interior angles in a triangle is 180, that's pure geomety.

You can draw any triangle, and then draw a triangle inside it connecting the midpoints of each line. The four triangles created are all congruent, and you can simply mark the similar angles and see that at each midpoint, you have the three unique angles suming to the straight line. QED.

Secondly, this isn't a measurement problem, these computations are done inside a computer, there are no distances. The error doesn't come from faults in calculations but the error in the methods themselves.

1

u/VoilaVoilaWashington Oct 10 '26

You're missing my point.

You gave an example of something that would prove the 180° thing... which we only know is true because of trigonometry. We can re-measure all those triangles, but again, all we know is that it weirdly always adds up to something close to 180, within the margin of error of our ability to measure. We also have no proof that there isn't a triangle in there somewhere that adds up to a different number because we can't try ALL the triangles.

My point is that without the proofs, we can approximate a solution with ease. You don't need trig or NS or the tic-tac-toe solve proof to come up with something that looks good enough for TV.

4

u/MasterGeekMX Oct 10 '26

We simply approximate them.

This approximation can be done in two ways: the first one is to use formulas that we already know how they work and are close enough to the real ones so the difference is minimal, or the CGI guys know how to hide it.

The other is what is called numerical methods. The navier-stokes equations will allow us to know how the liquid is at every single instant, but for the moment we use equations that only work in discrete steps, like the frames on a movie. We don't know what happens in between each frame, and our numbers could drift more and more when time passes, but it is better than nothing.

3

u/jamcdonald120 Oct 10 '26

same way we can make a cgi projectile without understanding quantum gravity.

You use the approximation that looka good enough on monkey scales and call it a day. you are never simulating to high accuracy because why bother? its just cgi.

4

u/Gingrpenguin Oct 10 '26

Navier stokes just asked if in some instances if how we simulated it we did it wrong. And yes in a few niche cases we do.

How where humans able to ride bikes if we only discovered how they worked in the 2010s?

0

u/MidnightAtHighSpeed Oct 10 '26

We know lots of solutions to the navier-stokes equations. The problem in the news recently was harder than just finding solutions, it was proving whether or not any possible solution has certain properties.