资源描述:
《matlab 与傅里叶级数实验15》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、《数学实验》报告学号1012011姓名成绩实验内容:MATLAB与傅里叶级数一、实验目的掌握利用MATLAB进行傅里叶级数展开的方法和技能二、预备知识常数项级数的求和与审敛法则在高等数学中,我们学习过傅立叶级数的性质和将函数展开为傅立叶级数。本实验讨论利用MATLAB软件来完成将函数展开为傅立叶级数的工作。我们知道,将一个函数展开为傅立叶级数:其实就是要求出其中的系数和,根据三角函数系的正交性,我们可以得到它们的计算公式如下:,,这样,结合MATLAB的积分命令int()就可以计算这些系数,从而就可以进行函数的傅立叶展
2、开了。istheTibetanPlateaupoly.Centercityonlyapopulationofoveronemillion.Xiningislocatedinthe"Tangfangudao"andtheancient"SilkRoad"road,istheLoessPlateauandtheTibetanPlateau,agriculturalandpastoralareasand,inconjunctionwiththeMinistryofcultureandIslamicculture3三实验内容与
3、要求1、求级数得和。Matlab命令结果clearsymsnxf3=(n+1)/(n*2^n)I3=symsum(f3,n,1,inf)f3=(n+1)/n/(2^n)I3=log(2)+12、求级数的和。Matlab命令结果clearsymsnxf3=n^3/3^nI3=symsum(f3,n,1,inf)f3=n^3/(3^n)I3=33/83、将函数cosx展开成(x-π/3)的冥级数,取前10项。Matlab命令结果clearsymsnxf3=cos(x)I3=taylor(f3,10,x,pi/3)f3=co
4、s(x)I3=1/2-1/2*3^(1/2)*(x-1/3*pi)-1/4*(x-1/3*pi)^2+1/12*3^(1/2)*(x-1/3*pi)^3+1/48*(x-1/3*pi)^4-1/240*3^(1/2)*(x-1/3*pi)^5-1/1440*(x-1/3*pi)^6+1/10080*3^(1/2)*(x-1/3*pi)^7+1/80640*(x-1/3*pi)^8-1/725760*3^(1/2)*(x-1/3*pi)^94、求出函数的前11个傅里叶系数,即n=5Matlab命令结果function[a
5、0,ak,bk]=myfly(f)symskxa0=int(f,x,-pi,pi)/pi;ak=int(f*cos(k*x),x,-pi,pi)/pi;f=x^3+x^2>>aistheTibetanPlateaupoly.Centercityonlyapopulationofoveronemillion.Xiningislocatedinthe"Tangfangudao"andtheancient"SilkRoad"road,istheLoessPlateauandtheTibetanPlateau,agricult
6、uralandpastoralareasand,inconjunctionwiththeMinistryofcultureandIslamicculture3bk=int(f*sin(k*x),x,-pi,pi)/pi;%fourieran.mfunctionan=fourieran(f,n)symsxan=int(f*cos(n*x),x,-pi,pi)/pi;%fourierbn.mfunctionbn=fourierbn(f,n)symsxbn=int(f*sin(n*x),x,-pi,pi)/pi;clears
7、ymsxnf=x^2+x^3a0=fourieran(f,0);forn=1:5a(n)=fourieran(f,n);endforn=1:5bn)=fourierbn(f,n);enda=[-4,1,-4/9,1/4,-4/25]f=x^3+x^2>>bb=[2*pi^2-12,((3*pi)/2-pi^3)/pi,(2*pi^2)/3-4/9,3/16-pi^2/2,(2*pi^2)/5-12/125]istheTibetanPlateaupoly.Centercityonlyapopulationofoveron
8、emillion.Xiningislocatedinthe"Tangfangudao"andtheancient"SilkRoad"road,istheLoessPlateauandtheTibetanPlateau,agriculturalandpastoralareasand,inconjunctionwiththeMinis