remarks running the simulation with : results in constant solution as while one might expect from "physics of diffusionthat the solution should approach zero the reason is that we apply neumann conditions as boundary conditions one can then easily show that the area under the curve remains constant integrating the pde gives @ dx @ @ dx @ using the gauss divergence theorem on the integral on the right-hand and moving the time-derivative outside the integral on the left-hand side results in @ xt/dx @du @ (recall that @ =@ at the end points the result means that udx remains constant during the simulation giving the pde an interpretation in terms of heat conduction can easily explain the resultwith neumann conditions no heat can escape from the domain so the initial heat will just be evenly distributedbut not leak outso the temperature cannot go to zero (or the scaled and translated temperature uto be precisethe area under the initial condition is so with sufficiently fine meshu regardless of exercise vectorize function for computing the area of polygon vectorize the implementation of the function for computing the area of polygon in exercise make test function that compares the scalar implementation in exercise and the new vectorized implementation for the test cases used in exercise pn hint notice that the formula xn yn xi yi is the dot product of two vectorsx[:- and [ :]which can be computed as numpy dot( [:- ] [ :])or more explicitly as numpy sum( [:- ]* [ :]filenamepolyarea_vec py exercise explore symmetry one can observe (and also mathematically provethat the solution xtof the problem in exercise is symmetric around xtd xtin such casewe can split the domain in two and compute in only one halfoe or oe at the symmetry line we have the symmetry boundary condition @ =@ reformulate the problem in exercise such that we compute only for oe display the solution and observe that it equals the right part of the solution in exercise filenamesymmetric_gaussian_diffusion py