实验1画出函数 x2+y)’(xy=(00的图形 f(x,y)=w-1 程序: f=y*(1-1/(x^2+y^2);Plot3Df{x-2,2},{y2-2,2} Pot3D[f{x,-1.5,1.5},{y-1.5,1.5} Plot points->35 AxesLabel->(x,y, z, View Point->(2,0, 2), PlotRange-><-5, 53] 结果 实验2画出函数r(xy)=3的等高线图,并观察(xy)→(00时的极限情 况 程序: Clear[f]; fx y=x y/(x2+y 2) pl=Plot3D[fx, y]x, 2, 2, y, -2, 2), Plot Points->30, Display Function->ldentityI c1=Contour Plot[f[, y],x,-2, 2),,-2, 2), Contour Shading->False, Axes- Automatic, AxesOrigin->(0,0), Plot Points->60, Display Function->Identity Show[Graphics Array kpl, cll pts-Table [RandomReal, -0.1,0.11,1,101,12) glx y ix,y, fx,y] TableForm /Maplg, pts], TableHeadings->(None,"x,y fx,y]]
实验1 画出函数 , 的图形 程序: f=y*(1-1/(x^2+y^2));Plot3D[f,{x,-2,2},{y,-2,2}]; Plot3D[f,{x,-1.5,1.5},{y,-1.5,1.5},PlotPoints->35, AxesLabel->{"x","y","z"},ViewPoint->{2,0,2},PlotRange->{-5,5}]; 结果: 实验2 画出函数 的等高线图,并观察 时的极限情 况 程序: Clear[f];f[x_,y_]=x y/(x^2+y^2); p1=Plot3D[f[x,y],{x,-2,2},{y,-2,2},PlotPoints->30,DisplayFunction->Identity]; c1=ContourPlot[f[x,y],{x,-2,2},{y,-2,2},ContourShading->False,Axes-> Automatic,AxesOrigin->{0,0},PlotPoints->60,DisplayFunction->Identity]; Show[GraphicsArray[{p1,c1}]];pts=Table[Random[Real,{-0.1,0.1}],{i,1,10},{2}] g[{x_,y_}]={x,y,f[x,y]}; TableForm[Map[g,pts],TableHeadings->{None,{"x","y","f[x,y]"}}]
实验3观察 2x的极限 In (xy)-00)x2+y 程序: 印x,y]=2*x^3/(x^2+y^2)cont={-08,-0.4,0.2,-0.1,-0050.05,0.10.2,0.4,0.8} ContourPlot[fx,y],x,-1, 1, y-1, 1), Contours->cont PlotPoints->50, Color Function->Hue Print[fx,y]=, fx, y]]; Print["]; Print[fx, y]==c, "where" ]; Print[c=", cont 结果
实验3 观察 的极限 程序: f[x_,y_]=2*x^3/(x^2+y^2);cont={-0.8,-0.4,-0.2,-0.1,-0.05,0.05,0.1,0.2,0.4,0.8}; ContourPlot[f[x,y],{x,-1,1},{y,-1,1},Contours->cont, PlotPoints->50,ColorFunction->Hue]; Print["f[x,y]=",f[x,y]];Print[""];Print[f[x,y]==c," where"];Print["c=",cont] 结果:
实验4作出函数∫(xy)=e()的等高线和梯度线的图形,并观察梯度线 与等高线的关系 程序 fxy}=E^(-(x^2+2y^2)/10~4)Plo3D[1xy],{x-1.2,1,2},{y-1.2,1.2} t1=ContourPlotfx, y](x,-1.2, 1.2),y-1.2, 1. 2), Plot Points->50 Contour Shading->False] fx[x_y]=Evaluate[D[f[x, yl, x]]; fy[x_,y_=Evaluate[D[f(x,yl, yl X0=1.0 y0=1.0; lamda=0.01; a=x0; b-yo Dolu=atlamda *fx[a, b/Sqrt[(fx[a, b]2+(fyla, b] 2 v=b+lamda*fy[a,b/Sqrt[(fx[a, b]2+(fyla,b ]2 c[n]=ud[n]=v;a=u;b=v,{n,200} data=Table[cn], d[n,n, 200] t2=ListPlot[ data, PlotJoined->True, PlotStyle->RGBColor[1,0,011 Showltl, t2, AspectRatio->Automatic, PlotRange->All <<Calculus Vector Analysis <<Graphics PlotField SetCoordinates[Cartesian[x, y, z; uE((x2+2y/)/10 4) complot=Show[tl, Display Function->Identity gradplot=Show[t2, Display Function->Identity] t-PlotGradient Fieldu, x,-1. 2, 1.2,y-1. 2, 1. 2), Display Function->Identity ] Show[complot, gradplot, t, Display Function->DIsplay Function] 结果
实验4 作出函数 的等高线和梯度线的图形,并观察梯度线 与等高线的关系 程序: f[x_,y_]=E^(-(x^2+2y^2)/10^4);Plot3D[f[x,y],{x,-1.2,1.2},{y,-1.2,1.2}]; t1=ContourPlot[f[x,y],{x,-1.2,1.2},{y,-1.2,1.2},PlotPoints->50, ContourShading->False]; fx[x_,y_]=Evaluate[D[f[x,y],x]];fy[x_,y_]=Evaluate[D[f[x,y],y]]; x0=1.0;y0=1.0;lamda=0.01;a=x0;b=y0; Do[u=a+lamda*fx[a,b]/Sqrt[(fx[a,b])^2+(fy[a,b])^2]; v=b+lamda*fy[a,b]/Sqrt[(fx[a,b])^2+(fy[a,b])^2]; c[n]=u;d[n]=v;a=u;b=v,{n,200}] data=Table[{c[n],d[n]},{n,200}]; t2=ListPlot[data,PlotJoined->True,PlotStyle->RGBColor[1,0,0]]; Show[t1,t2,AspectRatio->Automatic,PlotRange->All]; <<Calculus`VectorAnalysis` <<Graphics`PlotField` SetCoordinates[Cartesian[x,y,z]];u=E^(-(x^2+2y^2)/10^4); conplot=Show[t1,DisplayFunction->Identity]; gradplot=Show[t2,DisplayFunction->Identity]; t=PlotGradientField[u,{x,-1.2,1.2},{y,-1.2,1.2},DisplayFunction->Identity]; Show[conplot,gradplot,t,DisplayFunction->$DisplayFunction]; 结果:
0.9999 0.9998 0.5 9996 =0.5 0.5 -1 0.5
效结计 实验5求出曲面z=2x2+y2在点a1处的切平面、法线方程,并画出图形 程序
实 验 5 求 出 曲 面 在 点 处 的 切 平 面 、 法 线 方 程 , 并 画 出 图 形 程 序 :