实验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->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 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]; 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 求 出 曲 面 在 点 处 的 切 平 面 、 法 线 方 程 , 并 画 出 图 形 程 序 :
Clear[f]; f[x y ]=2x 2+y 2 plPlot3D(fx,]x,-2, 2,,-2, 2) gl=ParametricPlot3D[rSin[u/Sqrt[2. r*Cos[u] r 2),u,0, 2Pi, r, 0,2)1 a=D[fxy]x].{x->1y->1} b=Dfx, yly].x->l,y->1 f1,1]+a(x-1)+b(y-1) 2=Plot3D[pxy]{x,-2,2},{y-2,2 ly[x =1+b(x-1)/a Iz[x =f[l, 1]-(x-1)a; g3=-ParametricPlot3DRX, lyx],Iz[x,(x-2, 2] Showlpl, g2, g3, AspectRatio->Automatic, ViewPoint->(-2.530,-1.025, 2.000] 结果
Clear[f];f[x_,y_]=2x^2+y^2; p1=Plot3D[f[x,y],{x,-2,2},{y,-2,2}]; g1=ParametricPlot3D[{r*Sin[u]/Sqrt[2.],r*Cos[u],r^2},{u,0,2*Pi},{r,0,2}]; a=D[f[x,y],x]/.{x->1,y->1}; b=D[f[x,y],y]/.{x->1,y->1}; p[x_,y_]=f[1,1]+a(x-1)+b(y-1); g2=Plot3D[p[x,y],{x,-2,2},{y,-2,2}]; ly[x_]=1+b(x-1)/a;lz[x_]=f[1,1]-(x-1)/a; g3=ParametricPlot3D[{x,ly[x],lz[x]},{x,-2,2}]; Show[p1,g2,g3,AspectRatio->Automatic,ViewPoint->{-2.530,-1.025,2.000}]; 结果:
-I0 实验6二元可导函数 1(xy=(2-12-(xy-x-12,证明它仅有两个极大 值点而没有极小值点,然后画出 f(r,y) 的图形,从图上观察出现这一现象的原 因,并与一元函数的结论相比较 程序: Clear[fj;fx,y-(x^2-1)^2-(x^2*y-x-1)^2; Solve[Dfx, l, x==0, D,]y==0,x,y) Plot3D[[x,y](x-2, 2),y,-1, 4), PlotRange->(4,), PlotPoints->301
实验6 二元可导函数 ,证明它仅有两个极大 值点而没有极小值点,然后画出 的图形,从图上观察出现这一现象的原 因,并与一元函数的结论相比较 程序: Clear[f];f[x_,y_]=-(x^2-1)^2-(x^2*y-x-1)^2; Solve[{D[f[x,y],x]==0,D[f[x,y],y]==0},{x,y}] Plot3D[f[x,y],{x,-2,2},{y,-1,4},PlotRange->{-4,0},PlotPoints->30];
Plot3D[fx,y]( x,-2, 2), y-1, 4, PlotRange->(-4,0) PlotPoints->30, View Point->(2504, -2.105,0.86711 Contour Plot[[x,y](x,-2, 2, y, -1, 4), Contour Shading->False, Contours->30, PlotPoints->601 {Y→0,x→-1};{Y→2,x→1}} 结果
Plot3D[f[x,y],{x,-2,2},{y,-1,4},PlotRange->{-4,0}, PlotPoints->30,ViewPoint->{2.504,-2.105,0.867}]; ContourPlot[f[x,y],{x,-2,2},{y,-1,4},ContourShading->False, Contours->30,PlotPoints->60]; 结果: