simpson法求积分
更新时间:2024-03-16 08:45:01 阅读量: 综合文库 文档下载
求积分方程的离散解并比较它与真解之间的误差。用n?4的复化Simpson公式求积分方程4x3?5x2?2x?5?8(x?1)21?(01?x)y(t)dt?y(x)1?t1比较。2(x?1)
的近似解,然后用三次样条函数近似y(x)的离散近似解,并在区间?0,1?的一些点上与真解
y(x)?主程序为: clear;clc; n=4;a=0;b=1; syms x t
f=(4*x^3+5*x^2-2*x+5)/(8*(x+1)^2); g=1/(1+t);sou=1/(x+1)^2; h=(b-a)/n;l=2*n+1;xi=a:h/2:b;
c=repmat([2,4],1,n-1);c=[1,c,2,1]; %Simpson插值的各项系数 u=c.*subs(g,xi);u=repmat(u,l,1); v=xi'*c;
u=h*(u-v)/6-eye(l); w=-(subs(f,xi))';
[s,yi]=columngauss(u,w); %调用列主元Gauss消去法解方程组 if ~s
disp('Error!There is something wrong.'); else
disp('When x=');disp(xi);
disp('The discrete solution of y(x) is:');disp(yi'); end
sp=myspline(xi,yi'); %调用三次样条插值函数 xk=0:0.001:1; sk=subs(sou,xk); for i=1:length(xk)
r=find(xi(2:l)>=xk(i),1,'first');
yk(i)=subs(sp(r),xk(i)); %计算S(xk) end
es=max(abs(yk-sk));
disp(['The maximum error is: ',num2str(es)]); plot(xk,sk,'r',xk,yk); %画图
title('Solve equation by numerical intergration'); legend('Acurate solution','Approximate solution'); xlabel('x');ylabel('y(x)'); grid on;
正在阅读:
simpson法求积分03-16
《成吉思汗和鹰》教学设计和教学反思05-19
精选中秋感怀优秀作文4篇03-09
今夜,让雨落入心里散文03-30
水厂质量管理手册 - 图文03-23
世界各个国家英文名及国旗03-20
采购管理规定学习03-02
2014-2020年中国食品营养强化剂行业分析与发展趋势研究报告 - 图文11-19
发动机日常保养工作有哪些05-10
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 积分
- simpson
- 哈工大机械设计大作业螺旋传动设计千斤顶
- 同济大学汽车拆装实习报告 - 图文
- 江苏省宜兴市屺亭中学2015届九年级上学期期中考试英语试卷
- 《生活与哲学》世界观和方法论图表汇总
- 636数学分析考研真题答案08
- 篮球运动概论练习题
- 六年级语文上册复习题
- 城市河道的景观型堤防设计
- 会务合同模板
- 扎克伯克给女儿的信 A letter to our daughter
- 工程量清单计价模式下业主方对工程造价的控制
- 专家论证会会议程序及主要内容
- 《税务稽查工作规程》习题集答案部分
- K12学习云南省玉溪市第一中学2015-2016学年高二物理下学期期中试
- 预备党员转正申请书一般多少字
- 火灾报警系统设计 - 毕业论文 - 图文
- 怎样才能快速瘦脸?改脸型对比照片
- 备孕男性吃什么养精子?提高精子质量的方法!
- 水质调控
- 自动售货机控制系统的设计论文