User:Egm6341.s10.Team4.roni/HW6/6.10

= Problem 10: Trapezoidal Rule Error Computation =

Given
Kessler's Paper, MatLab code and Result Table.

Patch Kessler Code for Trapezoidal Rule Error 5-9 problem given in Page [[media:Egm6341.s10.mtg30.djvu|30-2]]

 Matlab Code: 

Find
Run Kessler's Code line by line to reproduce his table. Complete HW 5-9 Refer Lecture slide [[media:Egm6341.s10.mtg30.djvu|30-2]] Produce (P2,P3) (P4,P5) (P6,P7)and put comments in his code

Solution
but denominator is obviously wrong this denominator should have turned to be 3 newpd =  360; pd =     6   360 (All wrong! Algorithm does not work)

Table 1 shows the results from running Kessler's Code



Table 2 shows the results from running Team4 Code



 Team4 Trapezoidal rule Error (alternative to to Kessler code)

 Matlab Code: 

Discussion:

Under Kessler's code, the program computes P(2k) for n=1 to any n number selected. From the paper we can see that (P3=P5=P7=0 at t=1). So we can use this equality to compute the C coefficients.

Kessler's code starts missing the correct C coefficients from C6 as shown in Table 1. Although the decimal value of C6-C9 is shown correctly in Table 1, The program can't not compute it correctly since it is derived from the numerator and the incorrect denominator. Team4 algorithm is based on decimal calculation of the C coefficients and therefore all coefficients are accurate to C9. Kessler's Algorithm start breaking down due to inaccuracies when calculating the C coefficients as fraction. Team4 algorithm allows the user to convert the decimal to fraction after the computation of the coefficients. The loss of accuracy in the fraction calculation from C7 in Team4 code is due to numerical errors of using single precision variables and functions.

Kessler's code in the paper took 0.102152 seconds to compute coefficients for n=1 to 8 The code developed by Team4 is much faster.021921 seconds for n=2 to 9 and does the work accurately for the decimal terms. Fraction terms are accurate up to C6 and P10. Those are shown in table 2 and could be improved if Double Precision is used to find the C coefficients and the factorial terms.

Author
Solved and typed by - --Egm6341.s10.Team4.roni 04:08, 7 April 2010 (UTC)

Proof read by -