Simpson for odd number of subintervals

7 次查看(过去 30 天)
Hello I want to know whether it is possible to use simpson rule for the case of odd number of subintervals, if yes, How ?! Thank you all !

回答(1 个)

David Goodmanson
David Goodmanson 2017-12-30
编辑:David Goodmanson 2017-12-30
Hi Djamel.
One approach is to use the usual Simpson's rule for all but three (consecutive) intervals and use Simpson's 3/8 rule for what is left over. Assume n points 1:n with n even, so there are an odd number of intervals. You can use the usual Simpson's rule on points 1 to n-3 (even number of intervals) and the 3/8 rule at the end. For equally spaced intervals of width h,
Integral = (3*h/8)*(f(n-3) + 3*f(n-2) + 3*f(n-1) + f(n))
Or you could put the 3/8 rule section at the beginning, or somewhere in the middle.
  4 个评论
Djamel HAMMOUDI
Djamel HAMMOUDI 2017-12-31
Thank you David, I had a look to 3/8 simpson rule. it looks better. i ll use it. Thank you so much.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by