solving partial differential equations scaling means that we introduce dimensionless independent and dependent variableshere denoted by barun uu uc xn xc tn tc where uc is characteristic size of the temperatureu is some reference temperaturewhile xc and tc are characteristic time and space scales hereit is natural to choose as the initial conditionand set uc to the stationary (endtemperature then un oe starting at and ending at as the length is xc while choosing tc is more challengingbut one can argue for tc = the resulting equation for un reads @un @ un @tn @xn xn note that in this equationthere are no physical parametersin other wordswe have found model that is independent of the length of the rod and the material it is made of (!we can easily solve this equation with our program by setting xd and td it turns out that the total simulation time (to "infinity"can be taken as when we have the solution xn tn/the solution with dimension kelvinreflecting the true temperature in our mediumis given by tv= xtd uc / =lthrough this formula we can quickly generate the solutions for rod made of aluminumwoodor rubber it is just matter of plugging in the right value figure shows four snapshots of the scaled (dimensionlesssolution nxn tnthe power of scaling is to reduce the number of physical parameters in problemand in the present casewe found one single problem that is independent of the material (vand the geometry (lvectorization occasionally in this bookwe show how to speed up code by replacing loops over arrays by vectorized expressions the present problem involves loop for computing the right-hand sidefor in range( )rhs[ (beta/dx** )*( [ + * [iu[ - ] ( [ ]tthis loop can be replaced by vectorized expression with the following reasoning we want to set all the inner points at oncerhs[ : - (this goes from index up tobut not includingnas the loop index runs from to - the [ + term will cover all the inner values displaced one index to the right (compared to : - ) [ :nsimilarlyu[ - corresponds to all inner values displaced one index to the leftu[ : - finallyu[ihas the same indices as rhsu[ : - the vectorized loop can therefore be written in terms of slices