Giter VIP home page Giter VIP logo

matrix's Introduction

矩阵matrix 线性代数Linear Algebra


一元一次、一元二次、一元三次方程一元四次方程解法 一元五次方程部分解

矩阵(matrix):

矩阵基本运算 Basic Operation of Matrix
初等行变换 elementary row operations
行列式 determinant of a square matrix
求逆 逆矩阵 inverse of an n×n matrix
行化简Line Simplification
行化简的向前步骤;化为上三角矩阵 forward phase
行化简的向后步骤
对角化 diagonalization
特征值 elgenvalue
特征向量 elgenvector

matrix's People

Contributors

hlliu20 avatar

Watchers

 avatar

matrix's Issues

一元四次方程通解

def cp_x4_1(a, b, c, d, e): if a == 0: re = cp_x4(b, c, d, e) else : b = b/a c = c/a d = d/a e = e/a y_li = cp_x3(-1, c, 4*e-b*d, b*b*e-4*c*e+d*d) print(y_li) y = y_li[2] x12 = cp_x2(1, b/2-(b*b/4+c+y)**(1/2), y/2-(y*y/4-e)**(1/2)) x34 = cp_x2(1, b/2+(b*b/4+c+y)**(1/2), y/2+(y*y/4-e)**(1/2)) re = [x12[0]+x34[0], x12[1]+x34[1], x12[2], x12[3], x34[2], x34[3]] return re

def cp_x4(a, b, c, d, e): if a == 0: re = cp_x3(b, c, d, e) else : P=(c*c+12*a*e-3*b*d)/9 Q=(27*a*d*d+2*c*c*c+27*b*b*e-72*a*c*e-9*b*c*d)/54 D=(Q*Q-P*P*P)**(1/2) u=(Q+D)**(1/3) if abs((Q+D)**(1/3)) > abs((Q-D)**(1/3)) else (Q-D)**(1/3) if u==0: v=0 else : v=P/u w = -0.5+3**(1/2)/2j mst={} for k in [1, 2, 3]: m = (b*b-8*a*c/3+4*a*(w**(k-1)*u+w**(4-k)*v))**(1/2) if m==0: s, t = b*b-8*a*c/3, 0 else : s = 2*b*b-16*a*c/3-4*a*(w**(k-1)*u+w**(4-k)*v) t = (8*a*b*c-16*a*a*d-2*b*b*b)/m mst[m]=(s, t) m_li = mst.keys() m=0 for it in m_li: if abs(it)>abs(m): m= it s, t = mst[m][0], mst[m][1] x=[] for i in [1, 2, 3, 4]: x.append((-1*b+(-1)**(math.ceil(i/2))*m+(-1)**(i+1)*(s+(-1)**(math.ceil(i/2))*t)**(1/2))/(4*a)) re = [0, 0] for j in x: if type(j)==complex: if abs(j.imag) > 1e-6: re[1]+=1 re.append(j) else : re[0]+=1 re.append(j.real) else : re[0]+=1 re.append(j) return re

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.