7. The Second Dimension
Society for Industrial and Applied Mathematics eBooks · 2010
7.1 From Here to There Transition Matrices 7.2 Contours and Cross Sections Visualizing F(x,y) 7.3 Cool It! Simulation on a Grid As we have said before, the ability to reason at the array level is very important in computational science. This is challenging enough when the arrays involved are linear, i.e., one-dimensional. Now we consider the two-dimensional array using this chapter to set the stage for more involved applications that make use of this structure. The term “matrix” will be used interchangeably with “two-dimensional array.” To get acquainted with double subscripts and the jargon of rows and columns, we consider a modeling problem in which a matrix interacts with a sequence of vectors. The matrix entries are probabilities that reflect the chance migration of populations from one island to another in an archipelago. The vector entries are island populations. The resulting simulation predicts how the populations vary with time, a type of probabilistic modeling that is ubiquitous in science. We will explore the possibility that the population distribution across the islands settles down to a steady state. Next we turn to the problem of visualizing a function of two variables. Contour plots and cross sections are key and each requires the systematic sampling of the underlying function. In programming terms, our task is to extend our ability to work with linspace and plot. Matlab has tools to support this endeavor. Lastly we take up the matter of simulation on a two-dimensional grid. This will provide yet another snapshot of the boundary between the continuous and the discrete. We simulate the cooling of a rectangular plate, something that requires discretization in both space and time. There are Δx's, Δy's, and ΔT's. The lessons learned in this chapter apply even more dramatically when the scene shifts to higher dimensions, e.g., the visualization of a function f(x,y,z) or the cooling of a solid object. The “curse of dimensionality” underlies many of the current challenges in computational science.