zoukankan      html  css  js  c++  java
  • 二元函数临界点的局部极值

    close
    figure(2)
    syms x y
    f=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);
    fx
    fy
    fxx
    fyy
    fxy
    [a,b]=solve(fx,fy)
    t=fxx*fyy-fxy^2;
    t
    
    tmp=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
    View Code

     

  • 相关阅读:
    要搜索内容
    .net core 过滤器
    C# => 写法
    js 数组的forEach 函数
    .net core 下载文件 其他格式
    win10 1903 更改文字大小
    fetch 写法
    C# 匿名对象 增加属性
    ping —— 虚拟机
    selenium验证车贷计算器算法
  • 原文地址:https://www.cnblogs.com/wdfrog/p/6708428.html
Copyright © 2011-2022 走看看