Re: Finding derivatives of a list?
- To: mathgroup at smc.vnet.net
- Subject: [mg40840] Re: [mg40816] Finding derivatives of a list?
- From: Selwyn Hollis <selwynh at earthlink.net>
- Date: Mon, 21 Apr 2003 06:59:04 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
The "usual" second-order accurate formula, (y[[i+1]] - 2 y[[i]] + y[[i-1]])/h^2, is easy to apply with ListCorrelate. For example: h=.1; vals = Table[Sin[x], {x, 0, 1, h}] {0, 0.0998334, 0.198669, 0.29552, 0.389418, 0.479426, 0.564642, 0.644218, 0.717356, 0.783327, 0.841471} ListCorrelate[{1, -2, 1}/h^2, vals] {-0.0997502, -0.198504, -0.295274, -0.389094, -0.479026, -0.564172, -0.643681, -0.716758, -0.782674} ----- Selwyn Hollis http://www.math.armstrong.edu/faculty/hollis On Saturday, April 19, 2003, at 11:02 PM, AES/newspost wrote: > Specific problem is how to generate a list of values of the second > derivative of a relatively smooth function at a set of equally spaced > points, when the function itself is known only as a list of numerical > values at those same points? > > -- > "Power tends to corrupt. Absolute power corrupts absolutely." > Lord Acton (1834-1902) > "Dependence on advertising tends to corrupt. Total dependence on > advertising corrupts totally." (today's equivalent) >