本文共 1442 字,大约阅读时间需要 4 分钟。
线性方程组 python
Prerequisites:
先决条件:
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 = 46 2x + 7y - 13z + 3t = 65 34x + 4y - 4z + 34t = 78
The 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
物理与动力学研究
# Linear Algebra Learning Sequence# Representation of a System of Linear Equationimport numpy as np# Use of np.array() to define an VectorA = 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
翻译自:
线性方程组 python
转载地址:http://lbazd.baihongyu.com/