フィルターのクリア

Richardson extrapolation for Simpson's rule -code matlab

2 ビュー (過去 30 日間)
Mauricio
Mauricio 2012 年 11 月 21 日
I need you to help me with the code for the Richardson extrapolation for Simpson's rule
Does anyone could help me with this code please?

回答 (1 件)

bym
bym 2012 年 11 月 23 日
Simpson's rule is a Richardson extrapolation of the trapezoidal rule, the following should get you started:
clc;clear
yLow = sin(0:pi/10:pi);
yHigh = sin(0:pi/20:pi);
iL = pi/10*trapz(yLow);
iH = pi/20*trapz(yHigh);
format long
re = (4*iH-iL)/3; % Richardson extrapolation
err = [iL (iL-2)/2; ...
iH (iH-2)/2; ...
re (re-2)/2];
fprintf('Estimate\t\terror\n')
fprintf('%1.10f\t%1.10f\n',err')
Estimate error
1.9835235375 -0.0082382312
1.9958859727 -0.0020570136
2.0000067844 0.0000033922

カテゴリ

Help Center および File ExchangeNumerical 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