MSIN0180 Computing Project 2023
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
MSIN0180 Computing Project 2023
There are two pages in this coursework specification.
Outline: This is a numerical computing task to use linear systems to solve a di§erential equation. The model problem is
d2 y dy
dx2 dx
y (a) = ); and y (b) = + are called boundary conditions. Using numerical approximations for each derivative term in (1) this can be expressed as a matrix inversion problem of the form
Ax = b: (2)
Suppose a = x0 < x1 < x2 < !!! < xn ! 1 < xn = b represents a regular partition of the interval [a;b] : This
means xi = a + ih; where i = 0; 1; 2;:::;n and h = : The points
x1 = a + h; x2 = a +2h;:::;xn ! 1 = a +(n " 1) h
are called interior mesh points of the interval [a;b] : We can approximate the derivative terms using
dy dx d2 y |
# (y (x + h) " y (x " h)) # (y (x " h) " 2y (x)+ y (x + h)) : |
dx2 |
Part 1.
Let
yi = y (xi ) ; Pi = P (xi ) ; Qi = Q(xi ); fi = f (xi )
and if and in (1) are replaced by (3) and (4) ; show that
!1+ Pi " yi+1 +#"2+ h2 Qi $yi + !1 " Pi " yi ! 1 = h f2i ; i = 1;:::;n " 1: (5)
Part 2. We know the boundary conditions are
yn = y (xn ) = y (b) = +: (7)
Show that (5) ; (6) and (7) can be expressed as a linear system and give the forms of A; x and b for an arbitrary value n:
Part 3. Equation (5) is an example of a di§erence equation. Use the method you have developed in Part 1. with conditions (6) and (7) ; and n = 10, to solve the following di§erential equation problem
d2 y dy
dx2 dx
The coe¢cients in (5) must be generated inside your computer program using appropriate control structures. Your java program must use Gaussian elimination to solve the resulting linear system and output your results in two columns (xi ;yi ) ; include a screen shot of the results as they appear on your screen. Your program
should be documented clearly. Your computer code should be documented and included as an appendix. Repeat the exercise for n = 50; 100: What do you notice?
Part 4. Plot a graph using Excel, of your results for varying n.
Mark Scheme and Submission Details
Your submitted work should be a report consisting of
Part 1 [7 Marks]
Part 2 [8 Marks]
Part 3 [65 Marks]
Part 4 [5 Marks]
Conclusion to summarise the problem and discuss any interesting observations or problems encountered [15 Marks]
2023-03-10