LAB ASSIGNMENT 4 Notes to the TA: Demonstrate calculation of an integral by the trapezoidal rule, Simpson’s 1/3rd rule, and Richardson extrapolation using an Excel spreadsheet for a simple function like f(x) = x2. Numerical Integration Methods 1. Consider a function 0.2 25 200 675 900 400 . a. Plot the function on an Excel graph between x = 0 and x = 0.8. b. Evaluate the integral analytically (verify your answer: 1.640533). c. Estimate the integral of the above function using the trapezoidal rule with n = 2. Calculate the absolute error and relative error using your result from the analytical method. c. Repeat for n = 4, 8, 10, 12 and find errors. Reproduce the following table: n h Integral 4 8 10 12 0.2000 0.1000 0.0800 0.0667 1.485 1.601 1.615 1.623 Error, % 9.49 2.42 1.55 1.08 e. Estimate the integral of the above function f(x) using the Simpson’s 1/3rd rule with n = 10 (which corresponds to h = 0.08). Calculate the absolute and relative error using your result from the analytical method. 2. Use the trapezoidal results from the above problem for n = 4 and n = 8, and hand calculate the integral of the above function using the Richardson Extrapolation method. Calculate the absolute and relative error using your result from the analytical method. 3. Concrete retaining wall problem (Example modified from Larson’s book): A 9 inch thick retaining wall (see Figure 1 for the shape) needs to be constructed. Estimate the amount of concrete needed to construct this wall. The height and the depth (below the ground level) estimated at selected points are given in the spreadsheet below. 1 Figure 1 Schematic diagram of the form Figure 2 Dimension data entered into an Excel spreadsheet. The solution to this problem involves the following steps: 1. 2. 3. 4. 5. Enter the dimension data (show in Fig 2) into a worksheet. Calculate the surface area of the upper portion (above ground) of the wall. Calculate the surface area of the lower portion (below ground) of the wall. Calculate the total surface area of the retaining wall. Multiply by the depth (9 inches) to find the required volume. Lab instructor’s notes Step 1: Set up the spreadsheet as shown in Figure 2. In the above table, YU represents the height above X-axis and YL represents the values below the X-axis. 2 Step 2: Calculate the surface area of the upper portion of the form: The area of the upper portion of the form is calculated using trapezoidal rule as shown in figure 3 Figure 3 Calculating the upper area using the trapezoidal rule Calculate the area for the remaining segments by copying the formula to the remaining cells. The total area of the upper portion is given by the sum of all the trapezoids. Figure 4 Calculating the sum of the trapezoids to find the total upper area Step 3: Similarly, calculate the total area for the lower portion of the form. Step 4: The total surface area of the form can be calculated by summing the area upper and lower portions. Figure 5 shows the total surface area of the form. 3 Figure 5 Total surface area of the form Step 5: The volume of the form can be computed by multiplying the surface area of the form with the depth of the form. It is given that the depth of the form is about 9 inches or (9/12) feet. Figure 6 shows the final volume of the form. Figure 6 Total volume of the form. 4. Develop a visual basic code for implementing the trapezoidal rule and solve problem 3 in the homework assignment using your code. 4
© Copyright 2026 Paperzz