实验2符号运算求解微积分与线性代数.doc_第1页
实验2符号运算求解微积分与线性代数.doc_第2页
实验2符号运算求解微积分与线性代数.doc_第3页
实验2符号运算求解微积分与线性代数.doc_第4页
实验2符号运算求解微积分与线性代数.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

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

文档简介

年级、专业 09信息与计算科学 姓名 学号 名单序号 实验时间 2011年 10月27日 使用设备、软件 PC, MATLAB 注: 实验报告的最后一部分是实验小结与收获 实验(2) Matlab基础操作实验:符号运算求解微积分与线性代数1. 求下列函数极限(Find the limits of the following functions) (1) syms x f=sin(x)/x; limit(f,x,0)ans = 1(2) syms x f=(1+1/x)x; limit(f,x,inf)ans = exp(1)(3) syms a x f=(1+a/x)x; limit(f,x,inf) ans = exp(a) (4) syms x f=(1+1/x)x; limit(f,x,-inf) ans = exp(1) (5) syms x f=(1-cos(x)/(x2); limit(f,x,0) ans =1/2 (6) syms n f=n(1/n); limit(f,n,inf)ans = 1 (7) syms x f=(cos(x0.5)(pi/x); limit(f,x,0,right) ans = 1/exp(pi/2)2.求下列函数的导数或偏导数( Find the derivatives of the following functions) (1) syms a b c x f=(a*x*x+b*x+c)0.5; g=(exp(x2)+x*sin(x)0.5; f1=diff(f,x) f1 = (b + 2*a*x)/(2*(a*x2 + b*x + c)(1/2) f2=diff(g,x) f2 = (sin(x) + 2*x*exp(x2) + x*cos(x)/(2*(exp(x2) + x*sin(x)(1/2)(2) syms x f=log(x3); diff(f,x)ans = 3/x(3)Find the 3rd derivative of f(x). syms x 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=x3-2*x*x*y*y+3*y-5; diff(f,x,2) ans =6*x - 4*y2(5)Find . syms x y f=x3-2*x*x*y*y+3*y-5; diff(diff(f,y),x)ans = (-8)*x*y3. 求下列函数的不定积分或定积分(Find indefinite integrals or definite integrals of the functions)(1) syms x f=sin(x)-2*cos(3*x)+1/x+exp(-x); int(f,x)ans = log(x) - (2*sin(3*x)/3 - cos(x) - 1/exp(x) (2) syms x f=exp(x)*sin(exp(x); int(f,x) ans = -cos(exp(x)(3) syms x f=(x2)/(x6+4)0.5); int(f,x)Warning: Explicit integral could not be found. ans = int(x2/(x6 + 4)(1/2), x) (4) syms x f=cos(3*x)*cos(5*x); int(f,x) ans = sin(2*x)/4 + sin(8*x)/16(5) syms x f=(x2-a2)0.5)/x; int(f,x)ans =(x2 - a2)(1/2) - log(-a2)(1/2) + (x2 - a2)(1/2)/x)*(-a2)(1/2) (6) syms a b x f=exp(a*x)*sin(b*x); int(f,x)ans =-(exp(a*x)*(b*cos(b*x) - a*sin(b*x)/(a2 + b2)(7) syms x f=(sin(x)-(sin(x)3)0.5; int(f,x,0,pi) ans =4/3 (8) syms x f=1/(x2); int(f,x,1,inf)ans = 14. 解下列方程(Solve the equations.)(1) syms x f=(1-x2)0.5-x; solve(f)ans = 0.70710678118654752440084436210485(2) f1=x+y+z=10; f2=x-y+z=0; f3=2*x-y-z=-4; x,y,z=solve(f1,f2,f3) x =2 y =5z = 3(3) f1=x*x+4*x*y+z=0; f2=x+3*y*z-3=0; f3=y+sin(z)=0; x,y,z=solve(f1,f2,f3) x =-6.4840528860501102693511549985753y = -0.071995758403084664887655346911159z =-43.9102390493223146672631539563435. 求解下列常微分方程 (Solve the following ordinary differential equations.)(1) dsolve(x*Dy=y*log(x*y)-y)ans = exp(1)/x exp(exp(C6 + t/x) + 1)/x(2) dsolve(Dv+2*t=0,v(1)=5) ans = 6 - t2(3) dsolve(D2y-(a+b)*Dy+a*b*y=0) ans =C11*exp(a*t) + C12*exp(b*t) 6. 用MATLAB验证(Use MALTAB to prove the following identities)(1) function y=eg6_1(x)y=(sin(x)2+(cos(x)2; eg6_1(6)ans = 1(2) function f=eg6_2(x,y)f=sin(x+y)-sin(x)*cos(y)-cos(x)*sin(y); eg6_2(2,3)ans = -4.8572e-0177.(1)分别用数字和符号两种方法,编程计算100! 结果有何不同?那个计算得快? 数字方法: tick=1;for i=1:100; k=k*i; i=i+1;endfprintf(s=%dn,s);toc 输出结果: s=9.426900e+157Elapsed time is 0.000169 seconds.符号方法: tic syms x f=x100; diff(f,100) ans =93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 tocElapsed time is 46.860357 seconds.数值运算和符号运算都能计算100!但是计算结果的表示方法不同且大小有些差异,从计算时间上看,数值计算明显快于符号运算。(2)用符号方法,编程计算100!,结果为多大数量级?能用数值方法计算吗? syms x f=x100; diff(f,100) ans =93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 结果为e+157数量级,可以用数值方法运算。小结:通过这次作

温馨提示

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

最新文档

评论

0/150

提交评论