栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

高等数学拾遗01--------Hesse矩阵与多元函数的极值

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

高等数学拾遗01--------Hesse矩阵与多元函数的极值

  • 必要条件:如果函数在处取到极值,那么有
  • 其中被称做函数的一个稳定点

  • 稳定点
    • 鞍点
      •  在处的Hesse矩阵是不定的

    • 极值点
      • 是一个极小值点,那么在处的Hesse矩阵是半正定的
      • 是一个极大值点,那么在处的Hesse矩阵是半负定的
      • 在处的Hesse矩阵是正定的, 是一个严格的极小值点
      • 在处的Hesse矩阵是负定的, 是一个严格的极大值点

  • Hesse矩阵

    • 在点处的泰勒展开式的矩阵形式

  • Numpy 求矩阵的特征值并做判断

    • import numpy as np
      a = [[1,0,0],[-2,5,-2],[-2,4,-1]]
      c = np.linalg.eig(a)
      eig_values = c[0]
      p = list(c[0])
      positive = 0 
      negative = 0
      null = 0
      
      for i in p:
          if i > 0:
              positive += 1
          elif i == 0"
              null += 1
          elif i < 0:
              negative += 1       
      if negative > 0 and positive > 0:
          print("it is a saddle point")
      elif negative > 0 and positive = 0 and null > 0:
          print("it is a negative semidefinite matrix")
          print("Warning!!cannot judge!!")
      elif negative > 0 and positive = 0 and null = 0:
          print("it is a maximum point")
      elif negative = 0 and positive > 0 and null = 0:
          print("it is a minmum point")
      elif negative = 0 and positive > 0 and null > 0:
          print("it is a positive semidefinite matrix")
          print("Warning!!cannot judge!!")
          
      
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/869248.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号