MATLAB实验报告2.doc_第1页
MATLAB实验报告2.doc_第2页
MATLAB实验报告2.doc_第3页
MATLAB实验报告2.doc_第4页
MATLAB实验报告2.doc_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

年级、专业 09级数学与应用数学2班 姓名 卢海宽 学号 150142009040 名单序号 117 实验时间 2011年 10月27 日 使用设备、软件 PC, MATLAB 注: 实验报告的最后一部分是实验小结与收获 实验(2) Matlab基础操作实验:符号运算求解微积分与线性代数1. 求下列函数极限(Find the limits of the following functions) (1) syms x r;r=sin(x)/x;limit(r,x,0)ans = 1 (2) syms x r;r=(1+1/x)x;limit(r,x,inf)ans = exp(1)(3) syms x r a;r=(1+a/x)x;limit(r,x,inf)ans = exp(a) (4) syms x r;r=(1+1/x)x;limit(r,x,-inf)ans = exp(1)(5) syms x r;r=(1-cos(x)/(x2);limit(r,x,0)ans = 1/2(6) syms n r;r=n(1/n);limit(r,n,inf)ans = 1(7)syms x n r;r=(cos(sqrt(x)(n/x);limit(r,x,0,right)ans = 1/exp(n/2)2.求下列函数的导数或偏导数( Find the derivatives of the following functions) (1)syms x a b c f g;f=sqrt(a*x2+b*x+c);g=sqrt(exp(x2)+x*sin(x);a1=diff(f,x)a2=diff(g,x)a1 = (b + 2*a*x)/(2*(a*x2 + b*x + c)(1/2) a2 = (sin(x) + 2*x*exp(x2) + x*cos(x)/(2*(exp(x2) + x*sin(x)(1/2) (2)syms x f;f=log(x3);diff(f,x)ans = 3/x (3)Find the 3rd derivative of f(x).syms x f;f=x*exp(-x2);diff(f,x,3)ans = (24*x2)/exp(x2) - 6/exp(x2) - (8*x4)/exp(x2)(4) )Find syms x y f;f=x3-2*x2*y2+3*y-5;diff(f,x,2)ans = 6*x - 4*y2(5)Find .syms x y f;f=x3-2*x2*y2+3*y-5;fx=diff(f,x);fxy=diff(fx,y)fxy = -8*x*y3. 求下列函数的不定积分或定积分(Find indefinite integrals or definite integrals of the functions)(1)syms x s;s=sin(x)-2*cos(3*x)+1/x+exp(-x);int(s,x)ans = log(x) - (2*sin(3*x)/3 - cos(x) - 1/exp(x)(2)syms x s;s=exp(x)*sin(exp(x);int(s,x)ans = -cos(exp(x)(3) syms x s;s=x2/(sqrt(x6)+4);int(s,x)Warning: Explicit integral could not be found. ans = int(x2/(x6)(1/2) + 4), x) (4)syms x s;s=cos(3*x)*cos(5*x);int(s,x)ans = sin(2*x)/4 + sin(8*x)/16(5) syms x s a;s=(sqrt(x2-a2)/x;int(s,x)ans = (x2 - a2)(1/2) - log(-a2)(1/2) + (x2 - a2)(1/2)/x)*(-a2)(1/2)(6) syms x s a b;s=exp(a*x)*sin(b*x);int(s,x)ans = -(exp(a*x)*(b*cos(b*x) - a*sin(b*x)/(a2 + b2)(7) syms x s;s=sqrt(sin(x)-(sin(x)3);int(s,x,0,pi)Warning: Explicit integral could not be found. ans = int(sin(x) - sin(x)3)(1/2), x = 0.pi)(8) syms x s;s=1/(x2);int(s,x,1,inf)ans = 14. 解下列方程(Solve the equations.)(1)syms x;solve(sqrt(1-x2)-x,x)ans = 2(1/2)/2(2)syms x y z;s=solve(x+y+z-10,x-y+z,2*x-y-z+4,x,y,z)s.x,s.y,s.zs = x: 1x1 sym y: 1x1 sym z: 1x1 sym ans = 2 ans = 5 ans = 3(3)syms x y z;s=solve(x2+4*x*y+z,x+3*y*z-3,y+sin(z),x,y,z)s.x,s.y,s.zs = x: 1x1 sym y: 1x1 sym z: 1x1 sym ans = -6.4840528860501102693511549985753 ans = -0.071995758403084664887655346911159 ans = -43.9102390493223146672631539563435. 求解下列常微分方程 (Solve the following ordinary differential equations.)(1)syms x y;s=dsolve(x*Dy=y*log(x*y)-y,x)s = 1/x exp(exp(C8 + log(x)/x(2)syms v t;s=dsolve(Dv+2*t=0,v(1)=5,t)s = 6 - t2(3)syms a b x y;s=dsolve(D2y-(a+b)*Dy+a*b*y=0,x)s = C13*exp(a*x) + C14*exp(b*x) 6. 用MATLAB验证(Use MALTAB to prove the following identities)(1) syms x;s=solve(sin(x)2+cos(x)2-1,x)s = C_求解此方程所得的解是全体实数因此该等式在实数域上成立。 (2) syms x y;s=solve(sin(x+y)-sin(x)*cos(y)-cos(x)*sin(y),x,y)s = C_2求解此方程所得的解是全体二维空间点的全体因此该等式成立。7.(1)分别用数字和符号两种方法,编程计算100! 结果有何不同?那个计算得快?(2)用符号方法,编程计算200!,结果为多大数量级?能用数值方法计算吗?解:(1)tics=1;for n=1:100 s=s*n;endformat long;stocs = 9.332621544394410e+157Elapsed time is 0.000345 seconds.以上为用数字计算ticsyms n s;s=sym(1);for n=1: 100 s=s*n;endstocs = 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000Elapsed time is 0.098745 seconds.以上为用符号运算,可见两者对同一运算的结果相同,但符号运算所消耗的时间要比数字运算的多,精度要大。(2) tics=1;for n=1:200 s=s*n;endstocs = InfElapsed time is 0.000512 seconds.数字运算,数据溢出。ticsyms n s;s=sym(1);for n=1:200 s=s*n;endstocs = 78865786736479050355236321393218506229513597768717326329474253324435944996340334292030428401198462390417721213891963883025764279024263710506192662495282993111346285727076331723739698894392244562145166424025403329186413122742829485327752424240757390324032125740557956866022603190417032406235170085879617892222278962370

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论