Assignment given 07 April 2009


This assignment was given on 07 April 2009. The work is due 14 April 2009.


For this week's assignment, we will compute approximate solutions of the boundary value problem

        - a(x) * u''(x) - a'(x) * u'(x) + c(x) * u(x) = f(x)
      
where a(x), c(x) and f(x) are functions that we know, and, at the endpoints:
        u(0) = u(1) = 0.
      

We are going to choose values of a(x), c(x) and f(x) in such a way that the exact answer is always

        uexact(x) = x * ( 1 - x ) * exp ( x )
      

We will be interested in the error between our approximate solution u(x) and the exact solution. Our measure for the error will be simple. If we are using n nodes, then the error will be the maximum of the absolute value of the difference between the exact solution and our approximate values.

That is, we compare our computed values U(i) to the exact solution evaluated at each node X(I):

        error = max ( 1 <= I <= N ) | u(i) - uexact ( x(i) ) |
      

Problema(x)c(x)f(x)
1a(x) = 1c(x) = 0f(x) = x * ( x + 3 ) * exp ( x )
2a(x) = 1c(x) = 2f(x) = x * ( 5 - x ) * exp ( x )
3a(x) = 1c(x) = 2 * xf(x) = - x * ( 2 x^2 - 3 x - 3 ) * exp ( x )
4a(x) = 1 + x^2c(x) = 0f(x) = ( x + 3 x^2 + 5 x^3 + x^4 ) * exp ( x )

Question 1: When we approximate the solution of the boundary value problem, we can expect that the error is roughly proportional to some power of h, the spacing between the nodes. Use the finite element program to solve problem 1.

You can get a copy of the finite element program at http://www.sc.fsu.edu/~burkardt/m_src/fem1d_bvp_linear/fem1d_bvp_linear.m and you can find examples of how to run the program and define the A, C and F functions in http://www.sc.fsu.edu/~burkardt/m_src/fem1d_bvp_linear/fem1d_bvp_linear_test.m

Use a number of nodes n = 11, 101, and 1001, so that h is 1/10, 1/100 and 1/1000. Compute the maximum errors in each solution, and call them E1, E2 and E3.

Turn in the following information (five numbers, and no more than 10 words!):

  1. What are the values of E1, E2 and E3 that you find?
  2. What are the ratios E2/E1 and E3/E2?
  3. If the error is proportional to h, then your ratios should be about 1/10. If the error is proportional to h^2, your ratios will be about 1/100. What did you find?

Question 2: You have written a program for the finite difference approximation of solutions to the boundary value problem which used a backward difference to approximate u'(x).

Use your backward difference finite difference program to solve problem 3. Use a number of nodes n = 11, 101, and 1001, so that h is 1/10, 1/100 and 1/1000. Compute the maximum errors in each solution, and call them F1, F2 and F3.

Turn in the following information (five numbers, and no more than 10 words!):

  1. What are the values of F1, F2 and F3 that you find?
  2. What are the ratios F2/F1 and F3/F2?
  3. If the error is proportional to h, then your ratios should be about 1/10. If the error is proportional to h^2, your ratios will be about 1/100. What did you find?

Question 3: You have written a program for the finite difference approximation of solutions to the boundary value problem which used a central difference to approximate u'(x).

Use your central difference finite difference program to solve problem 3. Use a number of nodes n = 11, 101, and 1001, so that h is 1/10, 1/100 and 1/1000. Compute the maximum errors in each solution, and call them G1, G2 and G3.

Turn in the following information (five numbers, and no more than 10 words!):

  1. What are the values of G1, G2 and G3 that you find?
  2. What are the ratios G2/G1 and G3/G2?
  3. If the error is proportional to h, then your ratios should be about 1/10. If the error is proportional to h^2, your ratios will be about 1/100. What did you find?


Last revised on 07 April 2009.