《实验2符号运算求解微积分与线性代数》由会员分享,可在线阅读,更多相关《实验2符号运算求解微积分与线性代数(7页珍藏版)》请在金锄头文库上搜索。
1、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、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=di
3、ff(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
4、)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 =
5、 -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、) (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
7、(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 followi
8、ng 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)
9、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=x1
10、00; diff(f,100) ans =93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 tocElapsed time is 46.860357 seconds.数值运算和符号运算都能计算100!但是计算结果的表示方法不同且大小有些差异,从计算时间上看,数值计算明显快于符号运算。(2)用符号方法,编程计算100!,结果为多大数
11、量级?能用数值方法计算吗? syms x f=x100; diff(f,100) ans =93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 结果为e+157数量级,可以用数值方法运算。小结:通过这次作业,我深刻地体会到了课本知识与实际运用的差异,上课听老师讲解感觉很明白,等到自己动手操作的时候就会感到有很多细节和知识点自己并没有完全理解,还需要进一步的钻研。通过努力完成的作业令我有小小的自豪感,今后我会更加认真地学习这门语言,并将它运用于实践。 友情提示:方案范本是经验性极强的领域,本范文无法思考和涵盖全面,供参考!最好找专业人士起草或审核后使用。