您好,欢迎访问三七文档
当前位置:首页 > 建筑/环境 > 电气安装工程 > 湖南工业大学MATLAB实验三
湖南工业大学实验报告班级姓名:学号:日期:20一、实验名称MATLAB第三次上机实训二、实验目的1、.熟悉MATLAB2.、熟练应用书上内容及其用MATLAB求解三、实验仪器1、计算机2、.MATLAB应用软件四、实验内容1、符号表达式的生成p64;符号矩阵的创立p68;符号矩阵的简化p73。2、符号代数方程求解。P793、求解:2cos(x)+y^(1/2)-ln(z)=72^x+2y-8z=-1x+y-cosh(z)=04、符号求解d3u/dx^3=u,u(0)=1,u’(0)=-1,u’’(0)=pi五、实验原理及1、符号表达式的生成f='log(x)'f=log(x)eqation='a*x^2+b*x+c=0'eqation=a*x^2+b*x+c=0diffeq='Dy-y=x'diffeq=Dy-y=xf=sym('sin(x)')f=sin(x)f=sym('sin(x)^2=0')f=sin(x)^2=0symsxf=sin(x)+cos(x)f=sin(x)+cos(x)符号矩阵的创立pa=sym('[1/s+x,sin(x)cos(x)^2/(b+x);9,exp(x^2+y^2),log(tanh(y))]')a=[1/s+x,sin(x),cos(x)^2/(b+x)][9,exp(x^2+y^2),log(tanh(y))]b=[a;'[exp(-i),3,x^3+y^9]']b=[1/s+x,sin(x),cos(x)^2/(b+x)][9,exp(x^2+y^2),log(tanh(y))][exp(-i),3,x^3+y^9];符号矩阵的简化symsxfactor(x^9-1)ans=x-1)*(x^2+x+1)*(x^6+x^3+1)大整数的分解factor(sym('12345678901234567890'))ans=(2)*(3)^2*(5)*(101)*(3803)*(3607)*(27961)*(3541)同类式的合并symsxy;collect(x^2*y+y*x-x^2-2*x)ans=(y-1)*x^2+(y-2)*x2、符号代数方程求解{10x-y=9-x+10y-2z=7-2y+10z=3[x,y,z]=solve('10*x-y=9','-x+10*y-2*z=7','-2*y+10*z=6')x=473/475y=91/95z=376/475vpa([x,y,z])ans=[.99578947368421052631578947368421,.95789473684210526315789473684211,.79157894736842105263157894736842]3、求解:2cos(x)+y^(1/2)-ln(z)=72^x+2y-8z=-1x+y-cosh(z)=0[x,y,z]=solve('2*cos(x)+y^(1/2)-log10(z)=7','2^x+2*y-8*z=-1','x+y-cosh(z)=0')vpa([x,y,z])书80functiony=fc(x)y(1)=x(1)-0.7*sin(x(1))-0.2*cos(x(2));y(2)=x(2)-0.7*cos(x(1))+0.2*sin(x(2));y=[y(1)y(2)];x0=[0.50.5]x0=0.50000.5000fsolve('fc',x0)Optimizationterminated:first-orderoptimalityislessthanoptions.TolFun.ans=0.52650.5079fc.m文件functiony=fc(x);y(1)=2*cos(x(1))+x(2)^(1/2)-log10(x(3))-7;y(2)=2^x(1)+2*x(2)-8*x(3)+1;y(3)=x(1)+x(2)-cosh(x(3));y=[y(1)y(2)y(3)];x0=[101545]x0=101545fsolve('fc',x0)Maximumnumberoffunctionevaluationsreached:increaseoptions.MaxFunEvals.ans=0.031912.33193.2395x1=[121541]x1=121541fsolve('fc',x1)Maximumnumberoffunctionevaluationsreached:increaseoptions.MaxFunEvals.ans=-0.021812.29073.22764、符号求解。d3u/dx^3=u,u(0)=1,u’(0)=-1,u’’(0)=pidsolve('D3u=u')ans=C1*exp(t)+C2*exp(-1/2*t)*sin(1/2*3^(1/2)*t)+C3*exp(-1/2*t)*cos(1/2*3^(1/2)*t)y=dsolve('D3u=u','u(0)=1','Du(0)=-1','D2u(0)=pi')y=1/3*pi*exp(t)-1/3*(1+pi)*3^(1/2)*exp(-1/2*t)*sin(1/2*3^(1/2)*t)+(1-1/3*pi)*exp(-1/2*t)*cos(1/2*3^(1/2)*t)六、实验总结本次实验主要学到了利用MATLAB求解方程,使自己更加熟悉课本上的求解过程,也发现了很多细节错误,经过老师细心解决,都已经解决,这次实验让自己更加了解了matlab的使用,加深了对课本知识的理解。
本文标题:湖南工业大学MATLAB实验三
链接地址:https://www.777doc.com/doc-2246423 .html