- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我从 sympy
的 MyMat.eigenvals().keys()
获取此矩阵(这是 4D 雅可比矩阵的特征值):
egV = [5728761814608399/400000000000000 + sqrt(116481370240190604554434649577057/100000000000000000000000000000 - 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3) - 542870217167939624258689632311630767295785372177/(20000000000000000000000000000000000000000000*sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))) - 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)))/2 - sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))/2, 5728761814608399/400000000000000 + sqrt(116481370240190604554434649577057/100000000000000000000000000000 - 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3) + 542870217167939624258689632311630767295785372177/(20000000000000000000000000000000000000000000*sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))) - 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)))/2 + sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))/2, 5728761814608399/400000000000000 - sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))/2 - sqrt(116481370240190604554434649577057/100000000000000000000000000000 - 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3) - 542870217167939624258689632311630767295785372177/(20000000000000000000000000000000000000000000*sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))) - 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)))/2, 5728761814608399/400000000000000 - sqrt(116481370240190604554434649577057/100000000000000000000000000000 - 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3) + 542870217167939624258689632311630767295785372177/(20000000000000000000000000000000000000000000*sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))) - 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)))/2 + sqrt(116481370240190604554434649577057/200000000000000000000000000000 + 84525541314107370029729686916824478617779085658015330937307969/(20000000000000000000000000000000000000000000000000000000000*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3)) + 2*(704966930593670936740277648541223935870775995019826163729310179922474354087956414591800649953/8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + sqrt(4176563721214961521026417694955136953714825217199604642869248664796023172422674692165308442655306961942463737618615469818663523407583102219569144299457956960070280847076949520807345)*I/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000)**(1/3))/2]
我只想获取实数部分,因此我尝试使用 re()
:
outMat = [re(eg) for eg in egV]
但它返回此错误:
TypeError: cannot determine truth value of Relational
最佳答案
re
函数的文档字符串表示
Returns real part of expression. This function performs only elementary analysis and so it will fail to decompose properly more complicated expressions. If completely simplified result is needed then use
Basic.as_real_imag()
or perform complex expansion on instance of this function.
在 SymPy 1.3 中,egV.as_real_imag()
返回矩阵元组:实部和虚部。虚部全为零,这告诉我们特征值是实数。显然,I
的存在来自 casus irreducibilis三次方程的一个(方程有三个实根,但它们的代数公式必然涉及复数)。
关于python - 在 Sympy 矩阵中查找复数的实部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52816301/
我需要计算像这样存储的 2 个短数据数组的 FFT(重复百万次): 等等。 数组值用黄色和蓝色表示。每个 K 值都有一个大小为 K 的未使用数据空间,我需要跳过。 我对数据进行了重新排序(和 floa
我是一名优秀的程序员,十分优秀!