Ch E 310 - Fall 10 - Lecture 21

# Ch E 310 - Fall 10 - Lecture 21 - Lecture 21 November 9...

This preview shows pages 1–6. Sign up to view the full content.

Lecture 21 – November 9, 2010 Agenda: Numerical differentiation Derivatives of unequally spaced data Numerical differentiation in MATLAB Integrating ordinary differential equations (ODEs) Euler’s Method In-class 9 (due Friday)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Differentiating Unequally Spaced Data If the spacing between data points is not equal, we can fit a Lagrange interpolating polynomial to adjacent points and differentiate analytically; second order form: where x is where you choose to evaluate the derivative This works anywhere in the range of x 0 to x 2 It has the same accuracy as the centered finite difference equation regardless of our choice of x            1 2 0 2 1 0 2 2 1 0 1 2 0 1 2 0 1 0 2 1 0 2 2 2 x x x x x x x x f x x x x x x x x f x x x x x x x x f x f
Differentiating Unequally Spaced Data Example: Fourier’s law of heat transfer in a soil system q = heat flux (W/m 2 ), k = thermal diffusivity (3.5×10 -7 m 2 /s), r = density (1800 kg/m 3 ), C p = heat capacity (840 J/kg· C) Calculate the heat flux into the soil at the air-soil interface given the following temperature data measured below ground ( z = soil depth): z = 0.00 cm ( x 0 ) T = 13.5 C ( f ( x 0 )) z = 1.25 cm ( x 1 ) T = 12.0 C ( f ( x 1 )) z = 3.75 cm ( x 2 ) T = 10.0 C ( f ( x 2 ))   0 0 p z dT q z k C dz   soil air z

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Differentiating Unequally Spaced Data 8 9 10 11 12 13 14 15 0 0.5 1 1.5 2 2.5 3 3.5 4 temperature (C) depth (cm) Temperature profile: Use a Lagrange interpolating polynomial to estimate the thermal gradient: q ( z = 0) = (-3.5×10 -7 m 2 /s)(1800 kg/m 3 )(840 J/kg· C)(-133.3 C/m) = 70.56 W/m 2            C/cm 333 . 1 25 . 1 75 . 3 0 75 . 3 25 . 1 0 0 2 0 . 10 75 . 3 25 . 1 0 25 . 1 75 . 3 0 0 2 0 . 12 75 . 3 0 25 . 1 0 75 . 3 25 . 1 0 2 5 . 13 1 0 x f dz dT z
Numerical Derivatives in MATLAB MATLAB has two key built-in functions for evaluating derivatives diff gives differences over intervals gradient centered version of diff If you use diff to operate on a vector of length n , the output is a vector of length n – 1 with differences between elements; this can be used with finite difference formulas Example: use diff to estimate the derivative of f ( x ) = 0.2 + 25 x – 200 x 2 + 675 x 3 – 900 x 4 + 400 x 5 from x = 0 to 0.8

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/21/2011 for the course CH E 310 taught by Professor Staff during the Spring '08 term at Iowa State.

### Page1 / 25

Ch E 310 - Fall 10 - Lecture 21 - Lecture 21 November 9...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online