资源描述:
《南邮MATLAB上机实验二》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、实验二MATLAB的符号运算符号计算的特点:一,运算以推理解析的方式进行,因此不受计算误差积累问题困扰;二,符号计算,或给出完全正确的封闭解,或给出任意精度的数值解(当封闭解不存在时);三,符号计算指令的调用比较简单;四,计算所需时间较长。在MATLAB中,符号计算虽以数值计算的补充身份出现,但涉及符号计算的指令使用、运算符操作、计算结果可视化、程序编制以及在线帮助系统都是十分完整、便捷的。一、实验目的1、熟悉符号对象和符号表达式;2、掌握符号表达式和符号函数的操作;3、学习利用符号代数方程的求解。二、实验基本知识1、基本运算指令;2.掌握符号运算的应用。三、上机练
2、习1.(1)通过符号计算求的导数。(2)然后根据此结果,求和。>>clearallsymsty=abs(sin(t))df=diff(y)df1=limit(df,t,0,'left')df2=subs(df,'t',sym(pi/2))y=abs(sin(t))df=sign(sin(t))*cos(t)df1=-1df2=02.计算二重积分。>>clearallsymsxyf=x^2+y^2Fint=(int(int(f,y,1,x^2),x,1,2))f=x^2+y^2Fint=1006/1053.已知(1)求;(2)求.>>clearallsymsxyf=x
3、^2+y^2;dfdy2=diff(f,y,2)dfdy2=2>>intf=int(f,x,-1,1)intf=2*y^2+2/34.解方程:>>clearallsymsxeq=solve(3*x^2+4*x-6)eq=-2/3+1/3*22^(1/2)-2/3-1/3*22^(1/2)5.已知方程:(1)求通解;(2)求满足的特解.>>clearall>>y=dsolve('D3y+3*Dy+2*y-6=0','x')y=3+C1*exp((1+2^(1/2))^(1/3)*(-1-(1+2^(1/2))^(1/3)+(1+2^(1/2))^(1/3)*2^(1/
4、2))*x)+C2*exp(-1/2*(1+2^(1/2))^(1/3)*(-1-(1+2^(1/2))^(1/3)+(1+2^(1/2))^(1/3)*2^(1/2))*x)*sin(1/2*3^(1/2)*(1+2^(1/2))^(1/3)*(1-(1+2^(1/2))^(1/3)+(1+2^(1/2))^(1/3)*2^(1/2))*x)+C3*exp(-1/2*(1+2^(1/2))^(1/3)*(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