MATLAB Mathematics - SERC - Index of
MATLAB Mathematics - SERC - Index of MATLAB Mathematics - SERC - Index of
6 Sparse Matrices of the rows and columns of the adjacency matrix, which can have a significant effect on both the time and storage requirements for sparse matrix computations. Graphing Using Adjacency Matrices The MATLAB gplot function creates a graph based on an adjacency matrix and a related array of coordinates. To try gplot, create the adjacency matrix shown above by entering A = [0 1 0 1; 1 0 1 0; 0 1 0 1; 1 0 1 0]; The columns of gplot’s coordinate array contain the Cartesian coordinates for the corresponding node. For the diamond example, create the array by entering xy = [1 3; 2 1; 3 3; 2 5]; This places the first node at location (1,3), the second at location (2,1), the third at location (3,3), and the fourth at location (2,5). To view the resulting graph, enter gplot(A,xy) The Bucky Ball One interesting construction for graph analysis is the Bucky ball. This is composed of 60 points distributed on the surface of a sphere in such a way that the distance from any point to its nearest neighbors is the same for all the points. Each point has exactly three neighbors. The Bucky ball models four different physical objects: • The geodesic dome popularized by Buckminster Fuller • The C 60 molecule, a form of pure carbon with 60 atoms in a nearly spherical configuration • In geometry, the truncated icosahedron • In sports, the seams in a soccer ball The Bucky ball adjacency matrix is a 60-by-60 symmetric matrix B. B has three nonzero elements in each row and column, for a total of 180 nonzero values. This matrix has important applications related to the physical objects listed earlier. For example, the eigenvalues of B are involved in studying the chemical properties of C 60 . 6-18
Adjacency Matrices and Graphs To obtain the Bucky ball adjacency matrix, enter B = bucky; At order 60, and with a density of 5%, this matrix does not require sparse techniques, but it does provide an interesting example. You can also obtain the coordinates of the Bucky ball graph using [B,v] = bucky; This statement generates v, a list of xyz-coordinates of the 60 points in 3-space equidistributed on the unit sphere. The function gplot uses these points to plot the Bucky ball graph. gplot(B,v) axis equal 0.8 0.6 0.4 0.2 0 −0.2 −0.4 −0.6 −0.8 −1 −0.5 0 0.5 1 It is not obvious how to number the nodes in the Bucky ball so that the resulting adjacency matrix reflects the spherical and combinatorial symmetries of the graph. The numbering used by bucky.m is based on the pentagons inherent in the ball’s structure. 6-19
- Page 208 and 209: 5 Differential Equations vectorized
- Page 210 and 211: 5 Differential Equations There is a
- Page 212 and 213: 5 Differential Equations 3 Solve on
- Page 214 and 215: 5 Differential Equations hold off T
- Page 216 and 217: 5 Differential Equations Note The d
- Page 218 and 219: 5 Differential Equations legend('An
- Page 220 and 221: 5 Differential Equations Here, v(1-
- Page 222 and 223: 5 Differential Equations solution v
- Page 224 and 225: 5 Differential Equations Note The D
- Page 226 and 227: 5 Differential Equations After disc
- Page 228 and 229: 5 Differential Equations The output
- Page 230 and 231: 5 Differential Equations 2 Code the
- Page 232 and 233: 5 Differential Equations Note See t
- Page 234 and 235: 5 Differential Equations The exampl
- Page 236 and 237: 5 Differential Equations and the ri
- Page 238 and 239: 5 Differential Equations u1(x,t) 1
- Page 240 and 241: 5 Differential Equations Selected B
- Page 242 and 243: 6 Sparse Matrices Function Summary
- Page 244 and 245: 6 Sparse Matrices Function Summary
- Page 246 and 247: 6 Sparse Matrices This matrix requi
- Page 248 and 249: 6 Sparse Matrices S = (3,1) 1 (2,2)
- Page 250 and 251: 6 Sparse Matrices Now F = full(S) d
- Page 252 and 253: 6 Sparse Matrices Importing Sparse
- Page 254 and 255: 6 Sparse Matrices west0479 west0479
- Page 256 and 257: 6 Sparse Matrices The find Function
- Page 260 and 261: 6 Sparse Matrices The vertices of o
- Page 262 and 263: 6 Sparse Matrices 0 10 20 30 40 50
- Page 264 and 265: 6 Sparse Matrices 0 500 1000 1500 2
- Page 266 and 267: 6 Sparse Matrices simply sparse(m,n
- Page 268 and 269: 6 Sparse Matrices Similarly, S(:,p)
- Page 270 and 271: 6 Sparse Matrices The following MAT
- Page 272 and 273: 6 Sparse Matrices 0 Original 0 Reve
- Page 274 and 275: 6 Sparse Matrices QR Factorization
- Page 276 and 277: 6 Sparse Matrices shows that A has
- Page 278 and 279: 6 Sparse Matrices Functions for Ite
- Page 280 and 281: 6 Sparse Matrices set up the five-p
- Page 282 and 283: 6 Sparse Matrices Manipulating Spar
- Page 284 and 285: 6 Sparse Matrices Selected Bibliogr
- Page 286 and 287: Index comparing sparse and full mat
- Page 288 and 289: Index H hb1dae demo 5-35 hb1ode dem
- Page 290 and 291: Index nonstiff ODE examples rigid b
- Page 292 and 293: Index LU factorization 6-30 minimum
- Page 294: Index twobvp demo 5-63 two-dimensio
6 Sparse Matrices<br />
<strong>of</strong> the rows and columns <strong>of</strong> the adjacency matrix, which can have a significant<br />
effect on both the time and storage requirements for sparse matrix<br />
computations.<br />
Graphing Using Adjacency Matrices<br />
The <strong>MATLAB</strong> gplot function creates a graph based on an adjacency matrix<br />
and a related array <strong>of</strong> coordinates. To try gplot, create the adjacency matrix<br />
shown above by entering<br />
A = [0 1 0 1; 1 0 1 0; 0 1 0 1; 1 0 1 0];<br />
The columns <strong>of</strong> gplot’s coordinate array contain the Cartesian coordinates for<br />
the corresponding node. For the diamond example, create the array by entering<br />
xy = [1 3; 2 1; 3 3; 2 5];<br />
This places the first node at location (1,3), the second at location (2,1), the<br />
third at location (3,3), and the fourth at location (2,5). To view the resulting<br />
graph, enter<br />
gplot(A,xy)<br />
The Bucky Ball<br />
One interesting construction for graph analysis is the Bucky ball. This is<br />
composed <strong>of</strong> 60 points distributed on the surface <strong>of</strong> a sphere in such a way that<br />
the distance from any point to its nearest neighbors is the same for all the<br />
points. Each point has exactly three neighbors. The Bucky ball models four<br />
different physical objects:<br />
• The geodesic dome popularized by Buckminster Fuller<br />
• The C 60 molecule, a form <strong>of</strong> pure carbon with 60 atoms in a nearly spherical<br />
configuration<br />
• In geometry, the truncated icosahedron<br />
• In sports, the seams in a soccer ball<br />
The Bucky ball adjacency matrix is a 60-by-60 symmetric matrix B. B has three<br />
nonzero elements in each row and column, for a total <strong>of</strong> 180 nonzero values.<br />
This matrix has important applications related to the physical objects listed<br />
earlier. For example, the eigenvalues <strong>of</strong> B are involved in studying the chemical<br />
properties <strong>of</strong> C 60 .<br />
6-18