http://qs1969.pair.com?node_id=11138362


in reply to PDEs oo

Do you want to share the code?

Here's the 2d version, in C/OpenMP and wrapped in Perl;

2dheat.pl

If you want to do this in pure Perl, this can be done rather easily. You're computing a "stencil" (pattern) over space, from the previous timestep. You iterate timesteps until the points in space cease to change by some difference (epsilon). You can also do this in PDL. Other relevant terms: Jacobi, Gauss-Seidel, SOR.