Starting from:

$25

MTP290 - Assignment - 3 - Solved

1.    (5 points) Consider the initial value problem:

 .

Use the Runge-Kutta method of order 4 to obtain an approximation upto y(2) using stepsize h = 0.01. Plot the solution in x ∈ [1,2].

2.    (5 points) Write a matlab code to solve the folowing boundary value problem

−u00 + p(x)u0 + q(x)u = f(x), 0 ≤ x ≤ 1,

u(0) = g0, u(1) = g1,

where p, q, and f are known functions. Chose the known functions to generate a result. (Do not use examples from tutorial in order to ignore similarity).

3.    (10 points) Write a program to evaluate  using the

(a)   Trapezoidal rule

(b)   Simpson’s rule

(c)    composite trapezoidal and composite simpson rule for n = 10

(d)   Use two point Gauss-Legendre quadrature to evaluate the given integral. Comparewith the results obtained in (a), (b) and (c).

4.    (i) (2.5 points) Solve the following linear system by Gauss-Seidel method, with tolerance = 10−4 in the l∞ norm. Choose initial guess as x1 = 1/2 = x2

10x1 + x2 =         11 x1 + 10x2 =  11.

(ii)(2.5 points) Solve the following linear system by Gauss Jacobi method and choose initial guess as x1 = x2 = x3 = 0

4x1 + x2 − x3
=
3
2x1 + 7x2 + x3
=
19
x1 − 3x2 + 12x3
=
31.
Instructions:

More products