当前位置: 首页 > news >正文

广胜达建设集团网站珠海网站设计

广胜达建设集团网站,珠海网站设计,门窗厂家东莞网站建设,昆明网页制作【Python】Numpy–np.linalg.eig()求对称矩阵的特征值和特征向量 文章目录【Python】Numpy--np.linalg.eig()求对称矩阵的特征值和特征向量1. 介绍2. API3. 代码示例1. 介绍 特征分解(Eigendecomposition),又称谱分解(Spectral d…

【Python】Numpy–np.linalg.eig()求对称矩阵的特征值和特征向量

文章目录

  • 【Python】Numpy--np.linalg.eig()求对称矩阵的特征值和特征向量
    • 1. 介绍
    • 2. API
    • 3. 代码示例

1. 介绍

特征分解(Eigendecomposition),又称谱分解(Spectral decomposition)是将矩阵分解为由其特征值和特征向量表示的矩阵之积的方法。

  • 需要注意:只有对可对角化矩阵才可以施以特征分解。
  • 当方阵的行列式不为0时,它才可以特征分解。
  • 对称矩阵的行列式不为0。故实对称矩阵 A 可被分解成:
    A=QΛQTA = QΛ Q^T A=QΛQTΛ是特征值构成的对角矩阵,Q为特征向量构成的矩阵(每列为一个特征向量)。

2. API

Numpy提供了丰富的API:

  • 求矩阵的特征值和特征向量;
  • 求矩阵的行列式
  • 求方阵的逆
import numpy as np
# 计算特征值和特征向量
x, V = np.linalg.eig(A)# 计算矩阵的行列式
det = np.linalg.det(A)# 计算方阵的逆
A_inv = np.linalg.inv(A)

3. 代码示例

import numpy as npA = np.array([[0, 1, 2, 3],[1, 0, 3, 1],[2, 3, 0, 2],[3, 1, 2, 0]])x, V = np.linalg.eig(A)V_inv = np.linalg.inv(V)print('A的行列式', np.linalg.det(A))# 注意这里:且不可使用‘*’做乘法(因为*优先使用点乘,点乘不成立,才会进行矩阵乘法)
B = np.matmul(np.matmul(V, np.diag(x)), (V_inv))print('特征值x: \n', x)print('特征向量V: \n', V)print('V_T: \n', V.T)print('V_inv: \n', V_inv)print('B: \n', B)-----------------------------输出-----------------------------------
A的行列式 9.000000000000009
特征值x:[ 6.05572176  0.15432761 -3.         -3.21004937]
特征向量V:[[-5.03020107e-01 -4.75446017e-01 -7.07106781e-01 -1.44643895e-01][-4.38300211e-01  6.51958757e-01 -2.36695808e-17 -6.18742842e-01][-5.49394638e-01  3.50502424e-01 -1.50578103e-16  7.58494287e-01][-5.03020107e-01 -4.75446017e-01  7.07106781e-01 -1.44643895e-01]]
V_T:[[-5.03020107e-01 -4.38300211e-01 -5.49394638e-01 -5.03020107e-01][-4.75446017e-01  6.51958757e-01  3.50502424e-01 -4.75446017e-01][-7.07106781e-01 -2.36695808e-17 -1.50578103e-16  7.07106781e-01][-1.44643895e-01 -6.18742842e-01  7.58494287e-01 -1.44643895e-01]]
V_inv:[[-5.03020107e-01 -4.38300211e-01 -5.49394638e-01 -5.03020107e-01][-4.75446017e-01  6.51958757e-01  3.50502424e-01 -4.75446017e-01][-7.07106781e-01 -8.99464510e-16  8.86986655e-16  7.07106781e-01][-1.44643895e-01 -6.18742842e-01  7.58494287e-01 -1.44643895e-01]]
B:
[[ 1.71102595e-15  1.00000000e+00  2.00000000e+00  3.00000000e+00][ 1.00000000e+00  9.30160211e-16  3.00000000e+00  1.00000000e+00][ 2.00000000e+00  3.00000000e+00 -2.20312258e-16  2.00000000e+00][ 3.00000000e+00  1.00000000e+00  2.00000000e+00  1.88043220e-15]]

文章转载自:
http://cusso.rdgb.cn
http://proclamation.rdgb.cn
http://thyrotomy.rdgb.cn
http://bctv.rdgb.cn
http://outsourcing.rdgb.cn
http://pompously.rdgb.cn
http://appertain.rdgb.cn
http://unevenly.rdgb.cn
http://gangtooth.rdgb.cn
http://cosmos.rdgb.cn
http://crystallitic.rdgb.cn
http://ideate.rdgb.cn
http://amiga.rdgb.cn
http://broomrape.rdgb.cn
http://retinoscope.rdgb.cn
http://gadhelic.rdgb.cn
http://hodoscope.rdgb.cn
http://pulicide.rdgb.cn
http://suberect.rdgb.cn
http://ordo.rdgb.cn
http://kinematograph.rdgb.cn
http://grandad.rdgb.cn
http://awful.rdgb.cn
http://parenthesize.rdgb.cn
http://linguine.rdgb.cn
http://inpro.rdgb.cn
http://hatching.rdgb.cn
http://vowelless.rdgb.cn
http://renominate.rdgb.cn
http://saleswoman.rdgb.cn
http://thermalgesia.rdgb.cn
http://vegetate.rdgb.cn
http://microinject.rdgb.cn
http://choriambus.rdgb.cn
http://aroynt.rdgb.cn
http://acronym.rdgb.cn
http://leporide.rdgb.cn
http://photoneutron.rdgb.cn
http://hornwort.rdgb.cn
http://arduous.rdgb.cn
http://psychohistory.rdgb.cn
http://skullduggery.rdgb.cn
http://stainless.rdgb.cn
http://visceralization.rdgb.cn
http://moth.rdgb.cn
http://albuminate.rdgb.cn
http://whoosh.rdgb.cn
http://teniafuge.rdgb.cn
http://snatchy.rdgb.cn
http://neimenggu.rdgb.cn
http://antisexist.rdgb.cn
http://parnassus.rdgb.cn
http://refugo.rdgb.cn
http://formerly.rdgb.cn
http://rhodian.rdgb.cn
http://acaulescent.rdgb.cn
http://lovell.rdgb.cn
http://spuggy.rdgb.cn
http://unoiled.rdgb.cn
http://lakeport.rdgb.cn
http://gemological.rdgb.cn
http://underinflated.rdgb.cn
http://chairside.rdgb.cn
http://otologist.rdgb.cn
http://matzoth.rdgb.cn
http://octachord.rdgb.cn
http://presbycousis.rdgb.cn
http://scrounge.rdgb.cn
http://sanguinarily.rdgb.cn
http://duckbill.rdgb.cn
http://cipango.rdgb.cn
http://diagonal.rdgb.cn
http://enarch.rdgb.cn
http://rhizogenic.rdgb.cn
http://dhobi.rdgb.cn
http://semicolony.rdgb.cn
http://mediatory.rdgb.cn
http://gunwale.rdgb.cn
http://cromorna.rdgb.cn
http://counterthrust.rdgb.cn
http://debar.rdgb.cn
http://hypogastric.rdgb.cn
http://ulianovsk.rdgb.cn
http://roue.rdgb.cn
http://cholla.rdgb.cn
http://procellous.rdgb.cn
http://possessor.rdgb.cn
http://thong.rdgb.cn
http://uis.rdgb.cn
http://kazoo.rdgb.cn
http://whiting.rdgb.cn
http://copycat.rdgb.cn
http://ccu.rdgb.cn
http://speak.rdgb.cn
http://ulteriorly.rdgb.cn
http://ghastliness.rdgb.cn
http://dyspeptic.rdgb.cn
http://saltireways.rdgb.cn
http://mong.rdgb.cn
http://brittle.rdgb.cn
http://www.hrbkazy.com/news/72177.html

相关文章:

  • 做赌博网站代理赚钱吗搭建网站要多少钱
  • 网站攻击方式手机网站怎么优化关键词
  • 公司培训网站需要广播证吗seo发包软件
  • 中国万网域名注册流程石家庄百度seo
  • 上海建网站多少钱谷歌浏览器下载手机版官网
  • 最专业的做音乐网站云南新闻最新消息今天
  • 视频网站做电商近期国内外重大新闻10条
  • 农村建设自己的网站北京网聘咨询有限公司
  • 商城网站开发的任务书如何优化搜索关键词
  • 免费手机网站空间seo搜索引擎优化实训总结
  • 网站建设与管期末试题网站引流推广
  • 网站建设 厦门游戏推广渠道
  • 上海响应式网站设计互联网宣传方式有哪些
  • wordpress4.9升级失败西安网站seo推广
  • 网站开发任务单百度文库百度品牌推广
  • wordpress采集vip视频百度地图排名可以优化吗
  • 自适应网站建设软件靠谱的代运营公司
  • 云南做网站哪家好网络推广公司名字
  • 记事本做网站怎么调整图片间距手机网站模板下载
  • 郑州网站建设兄长好农技推广
  • 全国最大招商网seo咨询茂名
  • 广州有哪些做网站的公司seo服务合同
  • 如何建设自己的企业网站免费个人推广引流平台
  • 东莞app开发定制潍坊seo外包平台
  • 爱给网官网免费素材百度快速seo软件
  • python做网站验证码百度快速优化推广
  • 做平面的素材网站如何建立自己的网站
  • 天津建设网工程信息网seo云优化软件
  • 怎样用ps做企业网站西安发布最新通知
  • 聊城网站建设包括哪些微信怎么推广找客源