questions about this progr wer the foll function problem2_79 2 clo 3 n = 3; 4...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
questions about this progr wer the foll function problem2_79 2 clo 3 n = 3; 4 x zeros (n, 1); 3A[3 10 -5; -4 1 2; 1 1 -4]; 6 b[-2; 1; 0]; 7 Rnorm (A+x-b); sk=0; 9 fprintf('k \t err ') 10 fprintf( 2d \t while R > le-7 for i = 1:n end s = 0; 6.4e ',k,R). for 1:n end ss+A(i,j) *x(5); x(i)x(i) +0.8 (b(i)-s)/A(i, 1); R = norm (A+x-b); 12 13 14 15 16 17 18 19 20 21 22 23 24 25 and 26 end 27 if R-1 k = k + 1; fprintf('82d \t 86.4e ',k,R) if k > 50 fprintf( 'Did not converge. ') R = -1; fprintf( 'The converged result is: ') for i 1:n fprintf(8.6f ',x(i)) 28 29 30 31 end R 12 end (a) What mathematical problem does this program solve? (b) What numerical method does this program use? (c) What is the initial condition used to start the numerical method? (d) What is the criteria for convergence? (e) What is the reason you might choose the value 0.8 in line 17? (f) What is the significance of changing line 17 to: x(i)= x(i)+ (b(i)-s)/A(i,i); (g) What happens if you change line 17 to: x(i)= x(i)+ 2.5*(b(i)-s)/A(i.i); (h) If we forget to include line 13, the program does not work. Explain the problem with this bug. (i) How would you modify the mathematical problem from part (a) (with the same initial guess) to ensure that this numerical method will converge? Explain the reason behind your answer. Your answer can be in words, and you do not need to rewrite the program. questions about this progr wer the foll function problem2_79 2 clo 3 n = 3; 4 x zeros (n, 1); 3A[3 10 -5; -4 1 2; 1 1 -4]; 6 b[-2; 1; 0]; 7 Rnorm (A+x-b); sk=0; 9 fprintf('k \t err ') 10 fprintf( 2d \t while R > le-7 for i = 1:n end s = 0; 6.4e ',k,R). for 1:n end ss+A(i,j) *x(5); x(i)x(i) +0.8 (b(i)-s)/A(i, 1); R = norm (A+x-b); 12 13 14 15 16 17 18 19 20 21 22 23 24 25 and 26 end 27 if R-1 k = k + 1; fprintf('82d \t 86.4e ',k,R) if k > 50 fprintf( 'Did not converge. ') R = -1; fprintf( 'The converged result is: ') for i 1:n fprintf(8.6f ',x(i)) 28 29 30 31 end R 12 end (a) What mathematical problem does this program solve? (b) What numerical method does this program use? (c) What is the initial condition used to start the numerical method? (d) What is the criteria for convergence? (e) What is the reason you might choose the value 0.8 in line 17? (f) What is the significance of changing line 17 to: x(i)= x(i)+ (b(i)-s)/A(i,i); (g) What happens if you change line 17 to: x(i)= x(i)+ 2.5*(b(i)-s)/A(i.i); (h) If we forget to include line 13, the program does not work. Explain the problem with this bug. (i) How would you modify the mathematical problem from part (a) (with the same initial guess) to ensure that this numerical method will converge? Explain the reason behind your answer. Your answer can be in words, and you do not need to rewrite the program.
Expert Answer:
Answer rating: 100% (QA)
a This program solves a system of linear equations using the GaussSeidel iterative method b The prog... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
Answer the following questions about this program: (a) What mathematical problem does this program solve? (b) What numerical method does this program use? (c) What is the initial condition used to...
-
(10 points) Given that ry + xy = 1. 1. Find a solution of the differential equation that satisfies the initial condition y(1) = 10. Answer: y = 2. Find a solution of the differential equation that...
-
It is proposed to use water instead of refrigerant-134a as the working fluid in air-conditioning applications where the minimum temperature never falls below the freezing point. Would you support...
-
Air at 327C, 400 kPa with a volume flow 1 m3/s runs through an adiabatic turbine with exhaust pressure of 100 kPa. Neglect kinetic energies and use constant specific heats. Find the lowest and...
-
a. Use the method of Lagrangian multipliers to solve Problem 12. b. Do you get the same response as you do without using this method? c. What does equal? What does this mean?
-
Find the solution of Example 13.1 using the following two-term approximation for \(x(t)\) : \[\underset{\sim}{x}(t)=A_{0} \sin \omega t+A_{3} \sin 3 \omega t\] Data From Example 13.1:- Using a...
-
1. Did the Hyatts accept the list of contract terms included in the computer box? Why or why not? What is the name used for this type of e-contract? 2. Suppose that the Hyatts experienced trouble...
-
The comparative balance sheets (2021, 2020) and the income statement (2021) for Company A are shown below. Additional information from the accounting records follow the statements. Prepare the...
-
Which one of the following conformations of cyclohexane is chiral (a) Boat (b) Twist boat (c) ) Rigid (d) Chair
-
What is the relationship of technology to the information system architecture?
-
What are some constraints in user interface design?
-
Comment on the statement that the essential purpose of the user interface is to enable the user and the system to exchange messages. Provide two examples.
-
How and why does the architecture of the information system differ from software architecture?
-
What is consistency in user interface design? What problems might lack of consistency cause?
-
The definition a probability is stated as A measure of the likelihood that an event in the future will happen; it can only assume a value between 0 and 1; inclusive. Explain the meaning of the 0 and...
-
Danielle has an insurance policy with a premium of $75 per month. In September she is in an accident and receives a bill worth $2990 for the repair of her own property. Her deductible is $250 and her...
-
The speed of molecules according to kinetic theory is given by the Boltzmann distribution function \(f\). Thus \(f(c) d c\) represents the probability that \(c\) lies between \(c\) and \(c+d c\) and...
-
What is the relation between the square of the mean velocity and the mean of the velocity squared in the context of the Boltzmann distribution?
-
The distribution of the energy of the molecules is also of importance in the kinetics of chemical reactions. The fraction of molecules with energy in the range between \(E\) and \(E+d E\) is given...
Study smarter with the SolutionInn App