符号计算答案

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1符号运算作业1.观察一个数(在此用@记述)在以下四条不同指令作用下的异同:a=@b=sym(@)c=sym(@,'d')d=sym('@')%这给出完全准确值在此,@分别代表具体数值7/3,pi/3,pi*3^(1/3);而异同通过vpa(abs(a-d)),vpa(abs(b-d)),vpa(abs(c-d))等来观察。程序:a=7/3,b=sym(7/3),c=sym(7/3,'d'),d=sym('7/3')vpa(abs(a-d)),vpa(abs(b-d)),vpa(abs(c-d))a=pi/3,b=sym(pi/3),c=sym(pi/3,'d'),d=sym('pi/3')vpa(abs(a-d)),vpa(abs(b-d)),vpa(abs(c-d))a=pi*3^(1/3),b=sym(pi*3^(1/3)),c=sym(pi*3^(1/3),'d'),d=sym('pi*3^(1/3)')vpa(abs(a-d)),vpa(abs(b-d)),vpa(abs(c-d))〖答案〗(1)x=7/3a=2.3333b=7/3c=2.3333333333333334813630699500209d=7/3v1=0.v2=0.v3=.1480297366166876e-15(2)x=pi/3a=1.0472b=pi/3c=1.0471975511965976313177861811710d=pi/3v1=0.v2=20.v3=.1148364282799222e-15(3)x=pi*3^(1/3)a=4.5310b=5101408179057732*2^(-50)c=4.5309606547207899041040946030989d=pi*3^(1/3)v1=.2660111416629094e-15v2=.2660111416629094e-15v3=.2660111416629094e-152.说出以下三条指令产生的结果各属于哪种数据类型,是“双精度”对象,还是“符号”对象?3/7+0.1,sym(3/7+0.1),vpa(sym(3/7+0.1))程序:class(3/7+0.1),class(sym(3/7+0.1)),class(vpa(sym(3/7+0.1),4))〖答案〗c1=0.5286c2=37/70c3=.528571428571428571428571428571433.在不加专门指定的情况下,以下符号表达式中的哪一个变量被认为是独立自由变量。sym('sin(w*t)'),sym('a*exp(-X)'),sym('z*exp(j*theta)')程序:findsym(sym('sin(w*t)'),1)findsym(sym('a*exp(-X)'),1)findsym(sym('z*exp(j*th)'),1)〖答案〗ans=wans=aans=z34.求符号矩阵333231232221131211aaaaaaaaaA的行列式值和逆,所得结果应采用“子表达式置换”简洁化。程序:symsa11a12a13a21a22a23a31a32a33A=[a11a12a13;a21a22a23;a31a32a33]a=det(A)B=inv(A)C=subexpr(B)[RS,w]=subexpr(B,'w')〖答案〗A=[a11,a12,a13][a21,a22,a23][a31,a32,a33]DA=a11*a22*a33-a11*a23*a32-a21*a12*a33+a21*a13*a32+a31*a12*a23-a31*a13*a22IAs=[(a22*a33-a23*a32)/d,-(a12*a33-a13*a32)/d,-(-a12*a23+a13*a22)/d][-(a21*a33-a23*a31)/d,(a11*a33-a13*a31)/d,-(a11*a23-a13*a21)/d][(-a21*a32+a22*a31)/d,-(a11*a32-a12*a31)/d,(a11*a22-a12*a21)/d]d=a11*a22*a33-a11*a23*a32-a21*a12*a33+a21*a13*a32+a31*a12*a23-a31*a13*a225.对于0x,求12011122kkxxk。程序:clearallsymsksymsxpositivefk=2/(2*k+1)*(((x-1)/(x+1))^(2*k+1))s=symsum(fk,k,0,inf)s1=simple(s)〖答案〗s_ss=log(x)6.(1)通过符号计算求ttysin)(的导数dtdy。(2)然后根据此结果,求0tdtdy和2tdtdy。程序:clearall,symst4y=abs(sin(t))df=diff(y),class(df)df1=limit(df,t,0,'left')df2=subs(df,'t',sym(pi/2))〖答案〗d=abs(1,sin(t))*cos(t)d0_=-1dpi_2=07.计算二重积分211222)(xdydxyx。程序:clearall,symsxy,f=x.^2+y.^2,fint=(int(int(f,y,1,x.^2),x,1,2)),double(fint)〖答案〗r=1006/1058.在]2,0[区间,画出dtttxyx0sin)(曲线,并计算)5.4(y。程序:clearall,symstx;f=sin(t)/t,yx=int(f,t,0,x),ezplot(yx,[02*pi])fint=subs(yx,x,4.5),%或yxd=int(f,t,0,4.5),fint=double(yxd)holdon,plot(4.5,fint,'*r')〖答案〗y=sinint(x)y5=1.6541404143792439835039224868515012345600.20.40.60.811.21.41.61.8xsinint(x)59.设系统的冲激响应为teth3)(,求该系统在输入ttucos)(,0t作用下的输出。(提示:运用卷积进行计算)程序:symsttaout=cos(t);ht=exp(-3*t);uhtao=subs(ut,t,tao)*subs(ht,t,t-tao);Yt=simple(simple(int(uhtao,tao,0,t)))〖答案〗hut=-3/10/exp(t)^3+3/10*cos(t)+1/10*sin(t)10.求0,)(tAetf的Fourier变换。程序:symsAtwA=sym('a','positive');Ft=A*exp(-a*abs(t));Y=fourier(Ft,t,w)F=simple(Y)〖答案〗F=2*A*a/(a^2+w^2)11.求4633)(23sssssF的Laplace反变换。程序:symsst;F=s+3;G=s^3+3*s^2+6*s+4;Fs=F/G;L=laplace(Fs,s,t)〖答案〗f=1/3*exp(-t)*(-2*cos(3^(1/2)*t)+3^(1/2)*sin(3^(1/2)*t)+2)12.利用符号运算证明Laplace变换的时域求导性质:)0()()(ftfLsdttdfL。程序:symsts;y=sym('f(t)');df=diff(y,t);Ldy=laplace(df,t,s)〖答案〗Ldy=s*laplace(f(t),t,s)-f(0)13.求方程2,122xyyx的解。6程序:symsxy;eq1=x^2+y^2-1;eq2=x*y-2;S=solve(eq1,eq2,x,y);disp(['S.x','S.y']);disp([S.xS.y])〖答案〗x=-1/2*(1/2*5^(1/2)+1/2*i*3^(1/2))^3+1/4*5^(1/2)+1/4*i*3^(1/2)-1/2*(1/2*5^(1/2)-1/2*i*3^(1/2))^3+1/4*5^(1/2)-1/4*i*3^(1/2)-1/2*(-1/2*5^(1/2)+1/2*i*3^(1/2))^3-1/4*5^(1/2)+1/4*i*3^(1/2)-1/2*(-1/2*5^(1/2)-1/2*i*3^(1/2))^3-1/4*5^(1/2)-1/4*i*3^(1/2)y=1/2*5^(1/2)+1/2*i*3^(1/2)1/2*5^(1/2)-1/2*i*3^(1/2)-1/2*5^(1/2)+1/2*i*3^(1/2)-1/2*5^(1/2)-1/2*i*3^(1/2)14.求微分方程045xyy的通解,并绘制任意常数为1时解的图形。程序:clear,symsxySS=dsolve('Dy*y/5+x/4=0','x')ezplot(subs(S(1),'C3',1),[-2,2-2,2],1),holdonezplot(subs(S(2),'C3',1),[-2,2-2,2],1)ezplot(subs(S(1),'C3',1),[-2,2-2,2],1),holdonezplot(subs(S(2),'C3',1),[-2,2-2,2],1)colormap([001])〖答案〗y=1/2*(-5*x^2+4*C1)^(1/2)-1/2*(-5*x^2+4*C1)^(1/2)yy=1/2*(-5*x^2+4)^(1/2)-1/2*(-5*x^2+4)^(1/2)-2-1012-2-1.5-1-0.500.511.52xy(1)y(2)715.求一阶微分方程2)0(),2xbtatx的解。程序:x=dsolve('Dx=a*t^2+b*t','x(0)=2','t')〖答案〗x=1/3*a*t^3+1/2*b*t^2+2321/3at+1/2bt+216.求边值问题1)0(,0)0(,34,43gfgfdxdggfdxdf的解。程序:[f,g]=dsolve('Df=3*f+4*g','Dg=-4*f+3*g','f(0)=0','g(0)=1','x')〖答案〗f=exp(3*t)*sin(4*t)g=exp(3*t)*cos(4*t)

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功