EveryCircuit
Contact
Reviews
Home
jason9
modified 2 years ago

Finite Volume Method

4
13
208
01:10:27
This is an electronic analogue of the Finite Volume Method for integrating differential equations. In this case it’s simulating a very simple advection equation with diffusion. You can think of it as simulating the flow of dye through a constant velocity stream. The voltage of each capacitor represents the quantity of dye at that point. Due to the simple flux (dye flow rate) determination method (taking the flux between each volume to be the average of the values of the two volumes) the advection alone is unstable. As such, I have added 500Ω resistors to add diffusion to the advection. The value 500Ω is a critical value and increasing the resistance beyond that reveals the instability. With no resistors at all (infinite resistance, no diffusion) and the switch closed only every other capacitor becomes charged. Reducing the resistance from infinity (adding diffusion) counteracts this instability and works to balance the charges on the capacitors. At 500Ω exactly it completely eliminates the instability. Any more resistance and the capacitors won’t all have the same charge during steady-state operation.
published 2 years ago
592azy2circuitdude
2 years ago
Very interesting demonstration. I've never heard of the Finite Volume Method before, even though I took differential equations. Does integrating/simulating a differential equation mean the same thing as solving? If so, where in your circuit is the solution? Is it the amount charge (Q(t)) in the first capacitor?
jason9
2 years ago
This is numerical integration, which is basically an approximate way of solving which is used for simulation. Specifically, the actual numerical integrator is EC’s own simulation engine. This circuit is just a re-implementation of the Finite Volume Method for a specific differential equation into circuit form. Also, this isn’t an ordinary differential equation but a partial differential equation. It has two dimensions: space and time. In order to be simulated, space and time must be discretized. EC handles the time discretization automatically. For this circuit, I have discretized space into nine discrete numbers. The nine capacitors’ voltages at each point in time represent the values of the differential equation at each of the nine points in space at that point in time. The Finite Volume Method concerns how to discretize space for a set of partial differential equations so that it may be represented as a set of ordinary differential equations concerning the evolution of the value at the individual discretized points in space. The equation being simulated in this circuit, where f(x, t) is the value at location x and time t, is df/dt + df/dx = 0. In other words, the derivative at a location with respect to time is equal to the negative of the derivative with respect to space at that location and time. If you think it through, you can see that any patterns in space will move rightward at constant velocity without changing shape. However, the circuit does not quite show this behavior. That is because, in order to counteract instabilities from the version of the Finite Volume Method I used here, I added diffusion. That makes the equation df/dt + df/dx - (d^2)f/(dx)^2 = 0. Now any patterns in space move rightward at constant velocity while also smoothing out.
jason9
2 years ago
https://en.wikipedia.org/wiki/Partial_differential_equation
jason9
2 years ago
https://en.wikipedia.org/wiki/Finite_volume_method
592azy2circuitdude
2 years ago
Thanks, Jason. I knew I could count on you for an in-depth explanation 😄. I'm trying to absorb all the information, but now I understand why this was unfamiliar to me since I only took ordinary differential equations, and this is a partial differential equation. I understand how the voltage would change with time, but how does it change with distance? The capacitor voltages look to me like a time delay, not a voltage traveling through distance. Can you help me understand the distance element?
jason9
2 years ago
The partial differential equation essentially models a wave moving through space in a single direction (from left to right). The capacitors represent the various locations in space that are being simulated. As such, any signals that appear on one capacitor are (ideally, in the absence of diffusion) mirrored exactly by the capacitor to its right, just delayed slightly in time. This makes any patterns move rightward at constant velocity. The delay between a signal showing up at one spot and the same signal appearing at another spot is thus proportional to the distance between those locations.
jason9
2 years ago
Imagine the set of capacitors as an oscilloscope and the voltage of the leftmost capacitor is set to that of the voltage probe. The pattern that then shows up on the line of capacitors is the same pattern an oscilloscope will show. At least, in the absence of diffusion. Because diffusion is required for stability, in reality the signal is blurred and attenuated (essentially put through a low-pass filter) as it travels to the right.
592azy2circuitdude
2 years ago
I get the distance concept now! The time delay is like a propagation delay as the wave travels.
592azy2circuitdude
2 years ago
Now I'm trying to figure out diffusion.... Is that kinda like the voltage is weakened as it travels along? Using your example of dye, the first capacitor would have a higher concentration than the last?
jason9
2 years ago
The diffusion is the voltage spreading out as it moves along. Using the dye analogy, this is like sharp bands of dye blending and blurring together into a uniform pattern as they diffuse through the smoothly flowing water. If we remove the advection component entirely and simulated only diffusion, then that would consist of simply a line of a capacitors with each pair of adjacent capacitors being connected through a resistor. Diffusion is a very general phenomenon and happens in countless systems. For example, diffusion of momentum in a fluid is called viscosity. Diffusion of heat in a material is called thermal conductivity. Diffusion of dye or other dissolved substances in water is called, well, diffusion. It boils down to the flow of some quantity being proportional to the gradient of that same quantity over space. Any time that condition is met, that is diffusion, regardless of what quantity is being diffused, be it velocity, heat, or dye.
592azy2circuitdude
2 years ago
Ok, that makes sense to me. I think I've satisfied my curiosity now 😅. Thanks a million.
jason9
2 years ago
No problem.
Redstone_guy
1 year ago
This is a lot to take in

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy