This program is a simulator (numerical solver) for three types of differential equations, the heat equation, the wave equation and the wave equation with damping. By considering the case with one spatial variable, the program creates a Hermite spline interpolation from user inputted vertices. It then models the numerical solution (e.g. heat distribution, wave) and visualizes the results using Fourier series coefficients.
Visualizing heat distribution over time.
Observing wave propagation over time.
Seeing how damping influences wave behavior over time.
Simply clone this repository.
Steps:
- Go to the Releases page of this repository.
- Download the latest release ZIP file (e.g.,
Heat-Wave-Equation-Simulator-v1.0.0.zip). - Extract the contents of the ZIP file to a directory of your choice.
For the heat equation, we assume the spatial variable
Similarly, for the wave eqaution, we assume the spatial variable
The program uses Hermite spline interpolation to create a smooth curve through a series of user-defined points. Each segment between points is interpolated using cubic polynomials, this allows for continuity and that the boundary conditions are met, for the heat equation, this means that the temperatures are zero and for the wave equation we have a fixed zero displacement.
The differential equations are solved using Fourier series representations, where the solutions are expressed as a sum of sine functions with coefficients determined by the initial polynomial from the spline interpolation. The program calculates these coefficients and uses them to simulate the evolution of the differential equations over time.
Classes implementing this interface ('HeatSimulation', 'WaveSimulation', 'WaveDampingSimulation') are meant to setup the simulation by constructing the polynomial from the Hermite spline interoploation and derive the corresponding Fourier coefficients. Thereafter it will put this information in a Graph object that is now ready for simulating the corresponding differential equation.
Classes implementing this interface ('GraphHeat', 'GraphWave', 'GraphWaveDamping') represents the solution of the their corresponding differential equation using the Fourier series coefficients. By supplementing a given time, the graph can update its vertices (points (x,y) representing the fourier series function) for visualization.
The java code relies on the javax.swing package for graphical rendering and requires the EJML Java library (version 0.43) for matrix calculations.
For a more in-depth look at this project, please refer to mariusnaasen.com/projects/heat-wave-equation-simulator.
Marius H. Naasen, originally created August 2021.


