Write matlab code to solve tridiagonal linear systems, i.e., systems of the form Ar b where...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write matlab code to solve tridiagonal linear systems, i.e., systems of the form Ar b where A is tridiagonal. This code must be in the form of a function. The inputs to the function should be in the form of vectors for the diagonal, lower-diagonal and upper-diagonal elements of the matrix and the vector right-hand side of the equation. Write a script that calls the function, and which also checks its output by computing Ar – b, where A is in its matrix form. Apply your code to solve Ar = b, and check the solution (by computing the Euclidean norm of Aâ – b where â is your computed solution), where 2 10 0 2 6 3 0 2 0 1 6 0 0 2 8 0 0 0 -2 0 0 0 3 A = and b = -1 9 -3 1 8 6. Write matlab code to solve tridiagonal linear systems, i.e., systems of the form Ar b where A is tridiagonal. This code must be in the form of a function. The inputs to the function should be in the form of vectors for the diagonal, lower-diagonal and upper-diagonal elements of the matrix and the vector right-hand side of the equation. Write a script that calls the function, and which also checks its output by computing Ar – b, where A is in its matrix form. Apply your code to solve Ar = b, and check the solution (by computing the Euclidean norm of Aâ – b where â is your computed solution), where 2 10 0 2 6 3 0 2 0 1 6 0 0 2 8 0 0 0 -2 0 0 0 3 A = and b = -1 9 -3 1 8 6.
Expert Answer:
Answer rating: 100% (QA)
1save the below code in matrixm function xcalculatexab axb xinverseab ... View the full answer
Related Book For
Posted Date:
Students also viewed these mechanical engineering questions
-
Q3) Write MatLab code to select random matrrix of order 3x3 and find its solution by Matrixinverse(10) Q4) Why these commands are used in Matlab1. subplot (m, n, p)2. text (x,y,'text')3. zeros(m,n)4....
-
Matrix Vector Form write each system in Problem 1-3 in matrix vector form. Then write the augmented matrix of the system? 1. x + 2y = 1 2x - y = 0 3x + 2y = 1 2. i1 + 2i2 + i3 + 3i4 = 2 I1 - 3i2 +...
-
A tricirculant matrix is tridiagonal except for its (1. n) and (u. 1) entries. Tricirculant matrices arise in the numerical solution of periodic boundary value problems and in spline interpolation....
-
The following appliances are connected to a single 120 V, 15 A circuit in a kitchen: a 330 W blender, a 1000 W coffeepot, a 150 W coffee grinder, and a 750 W microwave oven. If these are all turned...
-
Is the enthalpy change of the reaction H2O() ( H2O(g) zero or nonzero? Use data in Table 7.2 to determine the answer.
-
The molar mass of oxygen \((32 \mathrm{~g})\) is slightly greater than that of nitrogen \((14 \mathrm{~g})\). But in a tank, the molecules of oxygen have the same rms speed as the molecules of...
-
An experiment is conducted with \(k=5\) treatments, one covariate \(x\), and \(n=6\). Calculations result in the sums of squares error \(S S E_{x}=14.4, S S E_{t r}=4.69\), and \(S S E_{t r,...
-
Colaw Company bottles and distributes No-FIZZ, a fruit drink. The beverage is sold for 50 cents per 16-ounce bottle to retailers, who charge customers 70 cents per bottle. For the year 2012,...
-
A physics student stands on a cliff overlooking a lake and decides to throw a golf ball to her friends in the water below. She throws the golf ball with a velocity of 22.5m/s at an angle of 32.5...
-
Preparing the Olney Company's Employee Payroll Register for the pay period ending January 8th, 20--. In previous chapters, gross wages were computed for each employee and using this data, FICA...
-
You acquire a real estate building for all cash and it generates 8% unlevered cash on cash return. You decide to get 50% debt on the property at 7% interest rate and 25 year amortization. What will...
-
Why is a call provision advantageous to a bond issuer?
-
Indicate whether each of the following statements is true or false by writing T or F i n t he a nswer c olumn. Since most forms of gambling are illegal, most forms of online gambling are also illegal.
-
Why is NOPAT a better performance measure than net income?
-
What is a discount bond? A premium bond?
-
Indicate whether each of the following statements is true or false by writing T or F i n t he a nswer c olumn. In order to violate the Computer Fraud and Abuse Act, the individual must act with...
-
Let UCR be open and let g: U Rn be smooth. Prove that if WEN (Rn) then g* (dw) = dg* (w).
-
A crop-dusting plane flies over a level field at a height of 25 ft. If the dust leaves the plane through a 30 angle and hits the ground after the plane travels 75 ft, how wide a strip is dusted? See...
-
Use the finite element method to approximate the solution to the boundary value problem Carefully explain how you are setting up the problem. Plot the resulting solutions and compare your answer with...
-
Find the general real solution to the following systems of differential equations: (a) (b) (c) (d) (e) = 4X1 + 3X2 X2 = 3X1-4X2 ,-- = 3x1-8x2 + 2x3 x2 =-u + 2x2 + 2x3 x3 = x1-4x2 + 2x3
-
Find the first and second derivatives of the functions a. b. c. 0. otherwise 0. otherwise 0. otherwise
-
The hangers support the joist in such a way that the four nails on each hanger can be assumed to support an equal portion of the load. If the joist is subjected to the loading shown, determine the...
-
The 60 mm x 60 mm oak post is supported on the pine block. If the allowable bearing stresses for these materials are oak = 43 MPa and pine 25 MPa, determine the greatest load P that can be...
-
The hangers support the joist in such a way that the four nails on each hanger can be assumed to support an equal portion of the load. Determine the smallest diameter of the nails at A and B to the...
Study smarter with the SolutionInn App