线性方程组 python_线性方程组的表示 使用Python的线性代数
線性方程組 python
Prerequisites:
先決條件:
Defining a Vectors
定義向量
Defining a Matrix
定義矩陣
In this article, we are going to learn how to represent a linear equation in Python using Linear Algebra. For example we are considering an equation with 3 variables (x,y,z and t).
在本文中,我們將學習如何使用線性代數在Python中表示線性方程。 例如,我們正在考慮具有3個變量( x,y,z 和t )的方程。
3x + 4y - 7z + 12t = 462x + 7y - 13z + 3t = 6534x + 4y - 4z + 34t = 78The above equation has a form as below in linear Algebra:
上式的線性代數形式如下:
Ax = b, x = (x y z t)Application:
應用:
Machine Learning
機器學習
Calculus
結石
Linear Programming
線性規劃
Physics and Kinetic Studies
物理與動力學研究
用于表示線性方程組的Python代碼 (Python code for Representation of a system of linear equation)
# Linear Algebra Learning Sequence # Representation of a System of Linear Equationimport numpy as np# Use of np.array() to define an Vector A = np.array([[3, 4, -7, 12], [2, 7, -13, 3], [34, 4, -4, 34]]) b = np.array([46, 65, 78]) print("The Matrix A : \n",A)x = np.array(['x', 'y', 'z', 't']) print("\nThe Vector x : ",x) print("\nThe Vector b : ",b)print("\n---Now the equations is represented in form of vector: Ax = b---") print("This is just a python intrepetation of understanding a linear equation")Output:
輸出:
The Matrix A : [[ 3 4 -7 12][ 2 7 -13 3][ 34 4 -4 34]]The Vector x : ['x' 'y' 'z' 't']The Vector b : [46 65 78]---Now the equations is represented in form of vector: Ax = b--- This is just a python intrepetation of understanding a linear equation翻譯自: https://www.includehelp.com/python/representation-of-a-system-of-linear-equation.aspx
線性方程組 python
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的线性方程组 python_线性方程组的表示 使用Python的线性代数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: tolowercase_JavaScri
- 下一篇: dnf所有卡片以及效果大全