AI + Physics: Using Neural Networks to Simulate Fluid Motion

In the months of March and April in 2023, there was a semi-viral tik tok chain of videos where fluids were simulated to find their ways through mazes and videos of simulations of similar liquids. This sparked a manifold of questions of how they work which I will discuss in this post. 

Within the past few years, scientists have been using Artificial Intelligence to simulate fluid and object motion. These simulations show intense detail and are almost an exact replica of what happens in the real world. 

These programs are trained through Neural Networks (NN) to their desired result. Neural Networks work by taking input data, making a prediction about that data, comparing the prediction to the desired output, and then adjusting itself to do better. 

In this case, the program is shown a wide range of videos of smoke, fluid, and other object simulations so it can learn and predict the outcomes when presented with an initial state. 

The programs end up performing sensational simulations; however, we already know how to solve for how fluids and objects will behave. So, this begs the question, why do we perform these simulations if we can already do them?

ai in physics

Why Would These Simulations Be Beneficial?

Why do we use these simulations to find something we already know? Well, in short, it saves time. 

Most of the time, these Neural Networks only need to be shown one video of how the fluid moves. In other words, training for the Neural Networks only has to be done once. This allows for results of how the fluid moves in as low as a matter of seconds. 

In this case, the program only has to be shown one video of how the fluid interacts with itself and the objects around it to have the ability to predict what will happen in a new scenario. This direction is faster than calculating the interactions of the fluid and comes with extremely high quality results. 

In general, these simulations have the ability to train off one instance and are then able to comprehend multiple different outcomes. This saves time and resources. 

How Does The Program Learn Without Equations?

Nonetheless, this program of Neural Networks is not able to just learn by seeing a video. 

That would be like showing a student a video of water running and asking them to predict what will happen when the water hits a wall. The student may have a general idea, but it will be drastically different than the real world scenario. 

Along with showing the Neural Network a video of how the fluid works, the program also tells the computer how the particles in the fluid are intertwined and how they interact with each other. 

This combination of showing how the fluid works and telling how the particles move, allows for extremely high accuracy in these simulations. The program can learn how to predict movements of sand, “goop,” water, smoke, and other liquids. 

Interested in our online AI coding program for middle & high school students? Enter your email below for program enrollment, updates & more!

   

The Problems of Learning Without Explicit Equations

Even though the simulation has an extremely high accuracy and incredible detail, it does not come without its potential problems and issues. Determining interactions of fluids without equations can and will lead to some gray area. 

Generalization

In this case, this is called generalization. Without explicit equations of how the liquids work, the program is forced to generalize aspects of the fluid’s movement.  

The more different that the video the program was trained on is compared to the instance it is being asked to predict, the more generalized the prediction will be. 

For example, if you show this program a video of a liquid being dropped from a high distance and then ask it to predict what will happen if the liquid goes through a maze, the predicted scenario will be generalized and therefore slightly different from what happens in the real world. 

Furthermore, the more time a simulation is played, the more likely there will be an error in the simulation.

Additionally, it is worth noting that the way the particles are described to interact with each other does not contribute to generalization. The way the particles are defined in the simulation is the same as how the particles react in real world scenarios. 

Applications of These Simulations

Different Starting Shapes

The simulation can accurately describe instances when the program is initially shown a video of different starting shapes of a liquid. For example, the program has the ability to accurately describe how liquids in the shape of stars can interact with each other even when the program is trained on a very different starting shape. 

Size of Training Domain

Also, this program can learn from a video of how a very small amount of particles can interact with each other and apply their knowledge to an extensive set of particles with extreme accuracy. 

For example, a video that shows how one thousand particles interact with each can teach a program to predict how thirty thousand particles will interact with each other. 

Training with Objects in The Domain

Furthermore, this program is able to predict how a fluid will interact with itself even when trained on a video of the fluid interacting with a barrier in water. 

In other words, when shown a video of how a fluid interacts with an object, the program can still accurately predict how it will interact with itself without the object. 

These simulations can also be trained on several ramps and still have the ability to comprehend how the fluid will evolve in many different scenarios. 

Conclusion of Physics Liquid Simulations

These simulations save the time needed to calculate interactions between particles and do so with incredible accuracy. 

However, if you are interested in the mathematical sense of how these interactions work, you can look at the Navier-Stokes equations. These are the equations the simulation was derived from. 

Lastly, if you wish to take a deeper look into this subject area yourself, you can watch a YouTube video by Two Minute Papers explaining the subject or read the paper he discusses in the video (Learning to Simulate Complex Physics with Graph Networks).

All of which I highly recommend watching or reading. 

YouTube Video: https://www.youtube.com/watch?v=2Bw5f4vYL98.

Paper and Simulations: https://arxiv.org/abs/2002.09405 or https://sites.google.com/view/learning-to-simulate/home#h.p_hjnaJ6k8y0wo.

Interested in our online AI coding program for middle & high school students? Enter your email below for program enrollment, updates & more!

   

About Inspirit AI

AI Scholars Live Online is a 10 session (25-hour) program that exposes high school students to fundamental AI concepts and guides them to build a socially impactful project. Taught by our team of graduate students from Stanford, MIT, and more, students receive a personalized learning experience in small groups with a student-teacher ratio of 5:1.

By Taytum N., Inspirit AI Ambassador

Previous
Previous

Prevalence of ChatGPT: Using Generative AI in School

Next
Next

The Importance of Standing Out—Why and How