solving partial differential equations exercise compute temperature variations in the ground the surface temperature at the ground shows daily and seasonal oscillations when the temperature rises at the surfaceheat is propagated into the groundand the coefficient in the diffusion equation determines how fast this propagation is it takes some time before the temperature rises down in the ground at the surfacethe temperature has then fallen we are interested in how the temperature varies down in the ground because of temperature oscillations on the surface assuming homogeneous horizontal properties of the groundat least locallyand no variations of the temperature at the surface at fixed point of timewe can neglect the horizontal variations of the temperature then one-dimensional diffusion equation governs the heat propagation along vertical axis called the surface corresponds to and the axis point downwards into the ground there is no source term in the equation (actuallyif rocks in the ground are radioactivethey emit heat and that can be modeled by source termbut this effect is neglected hereat some depth we assume that the heat changes in vanishso @ =@ is an appropriate boundary condition at we assume simple sinusoidal temperature variation at the surface td ta sin where is the periodtaken here as hours ( sthe coefficient may be set to = time is then measured in seconds set appropriate values for and ta ashow that the present problem has an analytical solution of the form xtd be rx sin ! rx/for appropriate values of abrand bsolve this heat propagation problem numerically for some days and animate the temperature you may use the forward euler method in time plot both the numerical and analytical solution as initial condition for the numerical solutionuse the exact solution during program developmentand when the curves coincide in the animation for all timesyour implementation worksand you can then switch to constant initial conditionu for this latter initial conditionhow many periods of oscillations are necessary before there is good (visualmatch between the numerical and exact solution (despite differences at )filenameground_temp py exercise compare implicit methods an equally stablebut more accurate method than the backward euler schemeis the so-called -step backward schemewhich for an ode utcan be expressed by unc un un unc tnc