Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

MTH603 IDEA SOLUTION ASSIGNMENT 1 2023

Solution A:
To solve the equation 3e^x sin x - 4 = 0 using the Regula-Falsi method, we need to follow
these steps:

Choose two initial guesses, x0 and x1, such that f(x0) and f(x1) have opposite signs. This
ensures that there is a root between x0 and x1.

Step 2: Compute the next approximation, x2, using the formula:


x2 = x1 - (f(x1) * (x1 - x0)) / (f(x1) - f(x0))

Step 3: Evaluate f(x2).

Step 4: Repeat steps 2 and 3 until the desired accuracy or number of iterations is
reached.

Let's proceed with three iterations:

Iteration 1:
x0 = 0, f(x0) = 3e^0 * sin(0) - 4 = -4
x1 = 1, f(x1) = 3e^1 * sin(1) - 4 ≈ 0.719
x2 = 1 - (f(x1) * (1 - 0)) / (f(x1) - f(x0))
= 1 - (0.719 * (1 - 0)) / (0.719 - (-4))
≈ 0.185

Iteration 2:
x0 = 1, f(x0) = 3e^1 * sin(1) - 4 ≈ 0.719
x1 = 0.185, f(x1) = 3e^0.185 * sin(0.185) - 4 ≈ -0.528
x2 = 0.185 - (f(x1) * (0.185 - 1)) / (f(x1) - f(x0))
= 0.185 - (-0.528 * (0.185 - 1)) / (-0.528 - 0.719)
≈ 0.397
Iteration 3:
x0 = 0.185, f(x0) = 3e^0.185 * sin(0.185) - 4 ≈ -0.528
x1 = 0.397, f(x1) = 3e^0.397 * sin(0.397) - 4 ≈ -0.187
x2 = 0.397 - (f(x1) * (0.397 - 0.185)) / (f(x1) - f(x0))
= 0.397 - (-0.187 * (0.397 - 0.185)) / (-0.187 - (-0.528))
≈ 0.383

After three iterations using the Regula-Falsi method, the approximate root of the
equation 3e^x sin x - 4 = 0 is x ≈ 0.383.

Solution B:
To solve the system of equations using Jacobi's iterative method, we need to follow these
steps:

Step 1: Write the system of equations in the form Ax = b, where A is the coefficient
matrix, x is the solution vector, and b is the constant vector.

The given system of equations:


4x - y - z = 3 -> 4x - y - z - 3 = 0
-2x + 6y + z = 9 -> -2x + 6y + z - 9 = 0
-x + y + 7z = -6 -> -x + y + 7z + 6 = 0

The coefficient matrix, A:


| 4 -1 -1 |
|-2 6 1 |
|-1 1 7 |

The constant vector, b:


|3|
|9|
|-6 |

Step 2: Decompose matrix A into the diagonal (D), lower triangular (L), and upper
triangular (U) parts.
Matrix D:
|4 0 0|
|0 6 0|
|0 0 7|

Matrix L:
|0 0 0|
|-2 0 0 |
|-1 1 0 |

Matrix U:
| 0 -1 -1 |
|0 0 1|
|0 0 0|

Step 3: Calculate the iteration matrix, T, and the constant vector, C.


T = -D^(-1) * (L + U)
C = D^(-1) * b

Inverse of matrix D:
| 1/4 0 0 |
| 0 1/6 0 |
| 0 0 1/7 |

T = -D^(-1) * (L + U)
= -| 1/4 0 0 | * (| 0 -1 -1 | + | 0 -1 -1 |)
| 0 1/6 0 | | 0 0 1 | | 0 0 1 |
| 0 0 1/7 | | 0 0 0 | | 0 0 0 |

C = D^(-1) * b
= | 1/4 0 0 | * | 3 |
| 0 1/6 0 | | 9 |
| 0 0 1/7 | |-6 |
Step 4: Initialize the solution vector, x0, as [0, 0, 0].
x0 = | 0 |
|0|
|0|

Step 5: Perform iterations using the formula x(k+1) = T * x(k) + C for the desired number
of iterations.
Iteration 1: x(1) = T * x(0) + C
= |-1/4 0 0 | * | 0 | + | 3/4 |
| 1/3 0 0 | | 0 | | 0 |
| 0 0 0| |0| |0 |
=|0|
|0|
|0|
Iteration 2: x(2) = T * x(1) + C
= |-1/4 0 0 | * | 0 | + | 3/4 |
| 1/3 0 0 | | 0 | | 0 |
| 0 0 0| |0| |0 |
=|0|
|0|
|0|
Iteration 3: x(3) = T * x(2) + C
= |-1/4 0 0 | * | 0 | + | 3/4 |
| 1/3 0 0 | | 0 | | 0 |
| 0 0 0| |0| |0 |
=|0|
|0|
|0|

After three iterations, the solution vector remains the same as the initial guess [0, 0, 0].

. Please rephrase and provide your own calculation and simplified explanations. .

You might also like