---
title: "Conjugate gradient numerical (3,0,2 system)"
subject: "Computational Techniques in Civil Engineering"
chapter: 2
key: "semester_8/computational_techniques_in_civil_engineering:cg-numerical-3-0-2"
source: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/cg-numerical-3-0-2
site: BCT Engineering
---

# Conjugate gradient numerical (3,0,2 system)

Computational Techniques in Civil Engineering · Chapter 2: Solutions of linear equations

- Asked in: 2071 Bhadra, 5 marks
- Video: [How to Solve Systems of Equations Using Gaussian and Gauss-Jordan Elimination](https://www.youtube.com/watch?v=YYEDnPOaUp0) — Tambuwal Maths Class
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/cg-numerical-3-0-2
- Whole chapter: https://www.bctengineer.com/md/semester_8/computational_techniques_in_civil_engineering/chapter-2

## Question

Solve the given system of equations using the conjugate gradient method.

$$
\begin{bmatrix} 3 & 0 & 2 \\ 0 & 1 & 1 \\ 2 & 1 & 3 \end{bmatrix}\begin{Bmatrix} x_1 \\ x_2 \\ x_3 \end{Bmatrix} = \begin{Bmatrix} 1 \\ 0 \\ -1 \end{Bmatrix}
$$

## Short answer

Applying the conjugate gradient method from the zero vector, the solution after three iterations is x1=2, x2=2.5, x3=-2.5, with zero residual. The intermediate vectors are (1,0,-1), then (2,2,-2), then the final values.

## Answer

$A=\begin{bmatrix}3&0&2\\0&1&1\\2&1&3\end{bmatrix}$ is symmetric and positive definite (leading minors $3,\ 3,\ 2>0$). $b=\{1,0,-1\}^T$. Take $x_0=0$: $r_0=b$, $d_0=r_0=\{1,0,-1\}^T$.

#### Iteration 1
$$
\begin{aligned}
Ad_0&=\{1,\,-1,\,-1\}^T\\
\alpha_0&=\frac{r_0^Tr_0}{d_0^TAd_0}=\frac{2}{2}=1\\
x_1&=\{1,\,0,\,-1\}^T\\
r_1&=r_0-\alpha_0Ad_0=\{0,\,1,\,0\}^T\\
\beta_0&=\frac{1}{2}=0.5,\quad d_1=r_1+\beta_0d_0=\{0.5,\,1,\,-0.5\}^T
\end{aligned}
$$

#### Iteration 2
$$
\begin{aligned}
Ad_1&=\{0.5,\,0.5,\,0.5\}^T\\
\alpha_1&=\frac{1}{0.5}=2\\
x_2&=\{2,\,2,\,-2\}^T\\
r_2&=\{-1,\,0,\,-1\}^T\\
\beta_1&=\frac{2}{1}=2,\quad d_2=\{0,\,2,\,-2\}^T
\end{aligned}
$$

#### Iteration 3
$$
\begin{aligned}
Ad_2&=\{-4,\,0,\,-4\}^T\\
\alpha_2&=\frac{2}{8}=0.25\\
x_3&=\{2,\,2.5,\,-2.5\}^T\\
r_3&=\{0,\,0,\,0\}^T
\end{aligned}
$$

**Answer: $x_1=2,\ x_2=2.5,\ x_3=-2.5$.** Check: $3(2)+2(-2.5)=1$, $2.5-2.5=0$, $2(2)+2.5-7.5=-1$.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. With x0 = 0 and b = {1, 0, -1}, what are r0 and d0?
   A. r0 = 0, d0 = b
   B. r0 = b = {1, 0, -1}, d0 = r0
   C. r0 = A b, d0 = b
   D. r0 = {1, 0, 1}, d0 = {0, 0, 0}
   Answer: B. r0 = b - A x0 = b when x0 = 0, and the first direction is d0 = r0 = {1, 0, -1}. (Key point: Starting values)

2. For d0 = {1, 0, -1}, A d0 = {1, -1, -1}. What is alpha_0?
   A. 0.5
   B. 2
   C. 1
   D. 0.25
   Answer: C. r0^T r0 = 2 and d0^T A d0 = 1(1) + 0 + (-1)(-1) = 2, so alpha_0 = 2/2 = 1. (Key point: First step length)

3. What is the converged solution after three iterations (residual zero)?
   A. x = {2, 2, -2}
   B. x = {1, 0, -1}
   C. x = {0.5, 1, -0.5}
   D. x = {2, 2.5, -2.5}
   Answer: D. After the third step x3 = {2, 2.5, -2.5} and r3 = 0, matching the n = 3 steps CG needs. It checks in the original equations. (Key point: Final result)

## Close variants set in other exams

- [Conjugate gradient numerical (2,-1 system)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acg-numerical-three-unknowns-a) — Computational Techniques in Civil Engineering, chapter 2, asked 2×

## Related in Computational Techniques in Civil Engineering

- [Conjugate gradient numerical (5 iterations)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acg-numerical-3-0-1) — Computational Techniques in Civil Engineering, chapter 2
- [Conjugate gradient three iterations (10,-6,0)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acg-three-iterations-a) — Computational Techniques in Civil Engineering, chapter 2
- [Conjugate gradient method and algorithm](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acg-method-algorithm) — Computational Techniques in Civil Engineering, chapter 2, asked 2×
- [CG algorithm; Gauss-Seidel numerical](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acg-algorithm-gauss-seidel-numerical) — Computational Techniques in Civil Engineering, chapter 2
- [Why conjugate gradient over Gaussian methods](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acg-vs-gaussian) — Computational Techniques in Civil Engineering, chapter 2
- [Linear solution techniques; CG two iterations](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Asolution-techniques-cg-numerical-two-iter) — Computational Techniques in Civil Engineering, chapter 2

## Related in other subjects

- [Conjugate beam: slope and deflection at free end C](https://www.bctengineer.com/question.md?key=semester_4%2Ftheory_of_structures_i%3Aconjugate-udl-15-3kn-2076b) — Theory of Structures I, chapter 4, asked 2×
- [Conjugate beam: slope and deflection at free end C](https://www.bctengineer.com/question.md?key=semester_4%2Ftheory_of_structures_i%3Aconjugate-udl-2knm-10kn-5kn-2068) — Theory of Structures I, chapter 4, asked 2×
- [Conjugate beam: slope and deflection at free end](https://www.bctengineer.com/question.md?key=semester_4%2Ftheory_of_structures_i%3Aconjugate-beam-24kn-10knm) — Theory of Structures I, chapter 4
- [Conjugate beam: overhanging beam free end](https://www.bctengineer.com/question.md?key=semester_4%2Ftheory_of_structures_i%3Aconjugate-overhang-300-150) — Theory of Structures I, chapter 4
