A model of the temperature of a thin metal plate builds two coordinate arrays: and

PHYSICS · Subjective · Fermi University Physics · Computational Physics · Scientific programming for physicists · Scientific programming for physicists

Computational Physics, Ch Arrays: a field is a rectangle of numbers

Problem

A model of the temperature of a thin metal plate builds two coordinate arrays: x = np.linspace(0, 0.2, 41).reshape(41, 1)\texttt{x = np.linspace(0, 0.2, 41).reshape(41, 1)} and y = np.linspace(0, 0.5, 101).reshape(1, 101)\texttt{y = np.linspace(0, 0.5, 101).reshape(1, 101)}, with xx and yy in metres. It then computes T = 300 + 50*x*y\texttt{T = 300 + 50*x*y} with TT in kelvin. (a) State the shape of T\texttt{T} and the total number of temperature values it holds. (b) Say whether building T\texttt{T} requires NumPy to first make a full (41,101)(41,101) copy of x\texttt{x} and a full (41,101)(41,101) copy of y\texttt{y}, or whether it manages without copying either one.

Browse the problem library