CHE110_VBANumInt

CHE110_VBANumInt - Rose-Hulman Institute of Technology...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Rose-Hulman Institute of Technology Department of Chemical Engineering CHE 110 - Introduction to Programming & Problem Solving Spring 2006 Workshop 1: Creating a Customized VBA Worksheet Function to Perform Numerical Integration Using the Trapezoidal Rule Background The trapezoidal rule for numerical integration discussed in Week 2 is summarized below. () ( ) f o x n1 i1 i i x ii 1 i fx fxd x x 2 xx x , n number of discrete points + = + + ≈Δ Δ= = 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x f(x) trapezoidal rule x 0 x 1 x 2 x 3 x 4 x 5 Objective Develop a customized VBA worksheet function named trapezoid that will accept as input cell ranges containing an arbitrary number of discrete values for x and f(x). The function should return a single number representing , where the integration limits x f o x x x o and x f represent the corresponding range of x values.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online