資源簡介
數(shù)值分析數(shù)值積分-復(fù)合梯形方法的matlab實現(xiàn)
代碼片段和文件信息
%復(fù)合梯形公式
a?=?1;b?=?3;
m?=?5000;
h?=?(b-a)/m;
x?=?a:h:b;
y?=?(100./(x.^2)).*(sin(10./x));
Im?=?h/2*(y(1)+y(m+1)+2*sum(y(2:m)));
%變步長梯形公式
n?=?1;
h1?=?b-a;
x1?=?[ab];
y1?=?(100./(x1.^2)).*(sin(10./x1));
s1?=?h1/2*(y1(1)+y1(2));
for?i?=?1:10000
????n?=?2*n;
????h2?=?h1/2;
????h1?=?h2;
????x1?=?a:h2:b;
????y1?=?(100./(x1.^2)).*(sin(10./x1));
????s2?=?s1/2?+?h2*sum(y1(2:2:n));
????if?abs(s2-s1)0.5*10^(-6)
????????break;
????end
????s1?=?s2;
end
s1
n
i
????
????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????537??2011-11-14?01:05??E6_韓明崗\O_R.m
?????文件?????????509??2011-11-10?11:34??E6_韓明崗\fuhe_tixing.m
?????目錄???????????0??2011-11-14?12:31??E6_韓明崗\
- 上一篇:SDAE代碼 matlab版本
- 下一篇:BUCK電路的simuli
nk仿真
評論
共有 條評論