首页 > 代码库 > 二元函数临界点的局部极值
二元函数临界点的局部极值
closefigure(2)syms x yf=2.*x.^4+y.^4-2.*x.^2-2.*y.^2+3;fx=diff(f,x);fy=diff(f,y);fxx=diff(f,x,2);fyy=diff(fy,y);fxy=diff(fx,y);fxfyfxxfyyfxy[a,b]=solve(fx,fy)t=fxx*fyy-fxy^2;ttmp=2^(1/2)/2;k1= subs(t,[x,y],[-tmp,0])k2=subs(t,[x,y],[tmp,0])k3=subs(t,[x,y],[-tmp,-1])k4=subs(t,[x,y],[tmp,-1])k5=subs(t,[x,y],[-tmp,1])k6=subs(t,[x,y],[tmp,1])k7=subs(t,[x,y],[0,0])k8=subs(t,[x,y],[0,-1])k9=subs(t,[x,y],[0,1]) z1=subs(f,[x,y],[-tmp,0]) z2=subs(f,[x,y],[tmp,0]) z3=subs(f,[x,y],[-tmp,-1]) z4=subs(f,[x,y],[tmp,-1])z5=subs(f,[x,y],[-tmp,1])z6=subs(f,[x,y],[tmp,1])z7=subs(f,[x,y],[0,0])z8=subs(f,[x,y],[0,-1])z9=subs(f,[x,y],[0,1]) u=-3/2:0.1:3/2;v=-3/2:0.1:3/2;[x,y]=meshgrid(u,v);z=2.*x.^4+y.^4-2.*x.^2-2.*y.^2+3;surf(x,y,z); hold on contourf(x,y,z) plot(-tmp,0,‘*r‘) plot(tmp,0,‘*r‘) plot(-tmp,-1,‘*r‘) plot3(-tmp,0,z1,‘*g‘) plot3(tmp,0,z2,‘*g‘) plot3(-tmp,-1,z3,‘*g‘) plot3(tmp,-1,z4,‘*g‘) plot3(-tmp,1,z5,‘*g‘) plot3(tmp,1,z6,‘*g‘) plot3(0,0,z7,‘*g‘) plot3(0,-1,z8,‘*g‘) plot3(0,1,z9,‘*g‘) % axis equal
二元函数临界点的局部极值
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。