A code that solve 2D partial differential equations with C++ and plot the whole thing with matplotlib (Python)
- conduction [heat equation]
- wave [wave equation]
C++ for the calculation,
Python (with matplotlib) for the plotting
- clone the repo :
git clone https://github.com/nobody48sheldor/2D-PDE-solver-cpp
- [Linux / BASH]
- for linux users run the
compile-script.sh
sh compile-script.sh
- [Windows / Mac] for ohters (manually)
- compile the
sovler.cpp
- run the compiled file
-
You can edit the line that is used to calculate the next point to solve a lot of 2D-partial-differential equation or even contribute, it is fully open source.
-
It has been made so that it doesn't take too much RAM while beeing user friendly for contributing and using.
- I am a highschool student so it may not be the best way to make this kind of program since I am not that experienced.
- The boundaries conditions are that the function must be 0 at the boundaries, this is done by setting the F(x, y, t) at the boundaries such that F(x, y, t + dt) = F(x, y, t), which imply that this boundaries condition must be true at t = 0, in other words the initial condition must obey the boundaries conditions, I hope a contributor find some way to "disable" the necessarity of boundaries conditions.
- You can contribute to the code and add some differents initial conditions or differential equation and more like complexity improuvement.