程序代写 CS代考 加微信: cstutorcs
322 SPECIAL MATRICES AND GAUSS-SEIDEL
11.5 Perform the same calculations as in Example 11.2, but for the symmetric system
[ 6 1 5 5 5 ] {a 0 } { 1 5 2 . 6 } 15 55 225 a1 = 585.6
55 225 979 a2 2488.8
In addition to performing the Cholesky decomposition, employ it to solve for the a’s.
11.6 Perform a Cholesky decomposition and then use the result to solve the following symmetric system by hand:
[8 20 15]{x1} {100} 20 80 50 x2 = 250 15 50 60 x3 100
11.7 Compute the Cholesky decomposition of [100 0 0]
[A]= 0 25 0 0 0 16
Do your results make sense in terms of Eqs. (11.3) and (11.4)? 11.8 Use the Gauss-Seidel method to solve the tridiagonal system from Prob. 11.1 (εs = 5%). Use overrelaxation with λ = 1.2.
11.9 Recall from Prob. 10.8, that the following system of equations is designed to determine concentrations (the c’s in g/m3) in a series of coupled reactors as a function of amount of mass input to each reactor (the right-hand sides are in g/day):
15c1 −3c2 −c3 =3300 −3c1 + 18c2 − 6c3 = 1200 −4c1 − c2 + 12c3 = 2400
tolerance of εs = 5%. If necessary, rearrange the equations to achieve convergence.
2×1 −6×2 −x3 =−38 −3×1 −x2 +7×3 =−34 −8×1 +x2 −2×3 =−20
11.14 Redraw Fig. 11.5 for the case where the slopes of the equa- tions are 1 and −1. What is the result of applying Gauss-Seidel to such a system?
11.15 Of the following three sets of linear equations, identify the set(s) that you could not solve using an iterative method such as Gauss-Seidel. Use the number of iterations that are necessary to show that your solution does not converge. Clearly state your con- vergence criteria (how you know it is not converging).
Solve this problem with the Gauss-Seidel method to εs = 5%. 11.10 Repeat Prob. 11.9, but use Jacobi iteration.
11.11 Use the Gauss-Seidel method to solve the following system until the percent relative error falls below εs = 5%:
10x +2x −x =22 123
−3×1 −6×2 +2×3 =−14 x1 +x2 +5×3 =14
11.12 Use the Gauss-Seidel method (a) without relaxation and (b) with relaxation (λ = 0.95) to solve the following system to a tolerance of εs = 5%. If necessary, rearrange the equations to achieve convergence.
−3×1 +x2 +15×3 =44 6×1 −2×2 +x3 =5
5×1 +10×2 +x3 =28
11.13 Use the Gauss-Seidel method (a) without relaxation and (b) with relaxation (λ = 1.2) to solve the following system to a
11.17 Given the pair of nonlinear simultaneous equations: f(x, y) 5 4 2 y 2 2×2
2 g(x,y)582y 24x
(a) Use the Excel Solver to determine the two pairs of values of x and y that satisfy these equations.
(b) Using a range of initial guesses (x = −6 to 6 and y = −6 to 6), determine which initial guesses yield each of the solutions. 11.18 An electronics company produces transistors, resistors, and
computer chips. Each transistor requires four units of copper, one unit of zinc, and two units of glass. Each resistor requires three,
9x + 3y + z = 13 −6x + 8z = 8 2x + 5y − z = 6
x + y + 6z = 8
x + 5y − z = 5 4x + 2y − 2z = 4
−3x + 4y + 5z = 6 −2x + 2y − 4z = −3
2y − z = 1
11.16 Use the software package of your choice to obtain a solution, calculate the inverse, and determine the condition number (without scaling) based on the row-sum norm for
[1 4 9]{x1}{14} 4 9 16 x2 = 29
9 16 25 x3 50 1 4 9 16 x
[ ]{ } { }
4 9 16 25 x2 = 54
9 16 25 36 x3 86
16 25 36 49 x4 126
In both cases, the answers for all the x’s should be 1.
three, and one units of the three materials, respectively, and each computer chip requires two, one, and three units of these materials, respectively. Putting this information into table form, we get:
on Fig. 11.3. Test your program by duplicating the results of Example 11.2.
11.26 Develop a user-friendly program in either a high-level or a macro language of your choice for the Gauss-Seidel method based on Fig. 11.6. Test your program by duplicating the results of Example 11.3.
11.27 As described in Sec. PT3.1.2, linear algebraic equations can arise in the solution of differential equations. For example, the following differential equation results from a steady-state mass balance for a chemical in a one-dimensional canal:
0 = D d2c − U dc − kc dx2 dx
where c = concentration, x = distance, D = diffusion coefficient, U = fluid velocity, and k = a first-order decay rate. Convert this differential equation to an equivalent system of simultaneous alge- braic equations. Given D = 2.5, U = 0.75, k = 0.15, c(0) = 75 and c(10) = 25, solve these equations from x = 0 to 10 with Δx = 2, and develop a plot of concentration versus distance.
11.28 A pentadiagonal system with a bandwidth of five can be expressed generally as
Transistors Resistors Computer chips
Copper Zinc
4 1 2 3 3 1 2 1 3
Supplies of these materials vary from week to week, so the com- pany needs to determine a different production run each week. For example, one week the total amounts of materials available are 960 units of copper, 510 units of zinc, and 610 units of glass. Set up the system of equations modeling the production run, and use Excel, MATLAB, or Mathcad to solve for the number of transistors, resis- tors, and computer chips to be manufactured this week.
11.19 UseMATLABorMathcadsoftwaretodeterminethespectral condition number for a 10-dimensional Hilbert matrix. How many digits of precision are expected to be lost due to ill-conditioning? Determine the solution for this system for the case where each ele- ment of the right-hand-side vector {b} consists of the summation of the coefficients in its row. In other words, solve for the case where all the unknowns should be exactly 1. Compare the resulting errors with those expected based on the condition number.
11.20 Repeat Prob. 11.19, but for the case of a six-dimensional Vandermonde matrix (see Prob. 10.17) where x1 = 4, x2 = 2, x3 = 7, x4 =10,×5 =3,andx6 =5.
11.21 Given a square matrix [A], write a single-line MATLAB command that will create a new matrix [Aug] that consists of the original matrix [A] augmented by an identity matrix [I].
11.22 Write the following set of equations in matrix form:
55=5×3 −7×2
4×2 +6×3 +30=0
x1 −7×3 =40−2×2 +5×1
Use Excel, MATLAB, or Mathcad to solve for the unknowns. In addition, compute the transpose and the inverse of the coefficient matrix.
11.23 In Sec. 9.2.1, we determined the number of operations re- quired for Gauss elimination without partial pivoting. Make a simi- lar determination for the Thomas algorithm (Fig. 11.2). Develop a plot of operations versus n (from 2 to 20) for both techniques. 11.24 Develop a user-friendly program in either a high-level or a macro language of your choice to obtain a solution for a tridiagonal system with the Thomas algorithm (Fig. 11.2). Test your program by duplicating the results of Example 11.1.
11.25 Develop a user-friendly program in either a high-level or a macro language of your choice for Cholesky decomposition based
e2 f2 g2 h2
[d3 e3 f3 g3 h3 ]x3 r3
… .=. ….. …..
defg n−1 n−1 n−1 n−1
xr n−1 n−1
dn en fn xn rn
Develop a program to efficiently solve such systems without pivoting in a similar fashion to the algorithm used for tridiagonal matrices in Sec. 11.1.1. Test your program for the following case:
−1 −2 12 −5 −3 15
]{2} {} x5 5
8 −2 −1 −2 9 −4 −1 −3 7
0 −4 −2 0 0 −7
0 0 x1 5 −1 0 x 2
11.29 Besides solving simultaneous equations, linear algebra has many other applications in engineering and science. An example from computer graphics involves rotating an object in Euclidean space. The following rotation matrix can be employed to rotate a group of points counter clockwise through an angle θ about the origin of a Cartesian coordinate system:
R=[cosθ −sinθ] sin θ cos θ
x3 = 0 x4 1
CS Help, Email: tutorcs@163.com
Code Help, Add WeChat: cstutorcs