Here is my solution: x[1] = (y[1] – c[3] * x[3]) / a[1]; x[2] = (y[2] – c[4] * x
ID: 3839516 • Letter: H
Question
Here is my solution:
x[1] = (y[1] – c[3] * x[3]) / a[1];
x[2] = (y[2] – c[4] * x[4]) / a[2];
for(i = 3; i <= n–2; i++){
x[i+1] = (y[i+1] - b[i+1] * x[i+1] – c[i+1] * x[i+2]) / a[i+1];
}//endfor
x[n-1] = (y[n-1] – b[n-3] * x[n-3]) / a[n-1];
x[n] = (y[n] – b[n-2] * x[n-2]) / a[n];
I'm having trouble with the statement inside the for loop. I can't seem to trace it carefully. Can someone tell me what needs to be fixed inside that for loop?
2) Write an algorithm to apply a single iteration of Gauss-Seidel to an nxn pentadiagonal system of the following form: a 0 c a yn-1 n-1 n-2 Assume that ai is never zero and that n 3Explanation / Answer
x[1] = (y[1] – c[3] * x[3]) / a[1];
x[2] = (y[2] – c[4] * x[4]) / a[2];
for(i = 3; i <= n–2; i++){
x[i] = (y[i] - b[i-2] * x[i-2] – c[i+1] * x[i+1]) / a[i];
}//endfor
x[n-1] = (y[n-1] – b[n-3] * x[n-3]) / a[n-1];
x[n] = (y[n] – b[n-2] * x[n-2]) / a[n];
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.