12-线性方程式与线性系统
一、Linear equation(线性方程式)
(一)Linear equation
1、Suppose you are given linear equations:
![1194b6ddd4abfa0e62aba251e530c45c.png](https://i-blog.csdnimg.cn/blog_migrate/eaa639ac8b628a6ff5ef60a9b336aa57.jpeg)
(二)Why Matrix Form(为什么转换为向量形式)
1、An electrical network:
![11a1ed621b653c0be6fce67dada6c27f.png](https://i-blog.csdnimg.cn/blog_migrate/9422dac976c91d99f3d8b5233d17dbeb.jpeg)
2、Given the voltages
![equation?tex=V_%7B1%7D](https://i-blog.csdnimg.cn/blog_migrate/82d7631d377ca6f22b587a5da5b2414d.png)
![equation?tex=V_%7B2%7D](https://i-blog.csdnimg.cn/blog_migrate/670190a90ba5d228223ec513218c3534.png)
![equation?tex=R_%7B1%7D](https://i-blog.csdnimg.cn/blog_migrate/655f2cfdc24367de7686601d02680c85.png)
![equation?tex=R_%7B5%7D](https://i-blog.csdnimg.cn/blog_migrate/01d0b9ab6edcf32d7210c5bc78e66b89.png)
3、Solve the current
![equation?tex=i_%7B1%7D](https://i-blog.csdnimg.cn/blog_migrate/b22e6542897aa6eebd630c7f486267a9.png)
![equation?tex=i_%7B5%7D](https://i-blog.csdnimg.cn/blog_migrate/09a23fcd895a1069f5a8ff5ef5d2d8b8.png)
注意:Kirchhoff's law(基尔霍夫定律),包括电压定律与电流定律
![9e0cf6967c847d5763e16171f6c3627f.png](https://i-blog.csdnimg.cn/blog_migrate/37d6fdba6d8504041ec29419084cce21.jpeg)
可以替换成
![equation?tex=R%2Ai%3DV](https://i-blog.csdnimg.cn/blog_migrate/ef4137420c54b10d1faf38ac081441e6.png)
![equation?tex=A%2Ax%3Db](https://i-blog.csdnimg.cn/blog_migrate/5a4b598eb74e78832ff52dc5a922d17d.png)
![equation?tex=x](https://i-blog.csdnimg.cn/blog_migrate/79271a73b75b1b2971964504afad8a27.png)
![equation?tex=i](https://i-blog.csdnimg.cn/blog_migrate/b1677f9423a31be742701330c190cf05.png)
(三)Formulation for the Electrical Networks(电路公式)
![dd300b48d9459dc00f8cb209e5b626f3.png](https://i-blog.csdnimg.cn/blog_migrate/91dccd8215323172a2cf8b2f09f71b21.png)
(四)Solving Linear Equations(解线性方程组)
1、Successive elimination(through factorization)(逐次消除(通过因子分解))
2、Cramer's method(克莱姆法则)
(五)Gaussian Elimination(高斯消去法)
1、Suppose given:
![a2882f88af755eb048d3f82680446339.png](https://i-blog.csdnimg.cn/blog_migrate/316e9695374c5d38f5bd595932f9b68b.jpeg)
(六)Gaussian Elimination-rref()
![2913e9d4ba283a9e0f6afdfb86e0e4c5.png](https://i-blog.csdnimg.cn/blog_migrate/a6a3efd9f9ada24e3e6c349d55388190.jpeg)
示例代码:
A = [1 2 1;2 6 1;1 1 4];
b = [2;7;3];
R = rref([A b])
输出结果:
![167b2f3f32989ade79518998a814a81a.png](https://i-blog.csdnimg.cn/blog_migrate/f1e69ecee4936dfde986454c99715860.jpeg)
(七)LU Factorization(LU因子分解)
1、Suppose we want to solve :
![equation?tex=Ax%3Db](https://i-blog.csdnimg.cn/blog_migrate/eb9ba40e6648620a6332b99547b63a0f.png)
![equation?tex=A%5Cin+%5CRe%5E%7Bm%5Ctimes+m%7D](https://i-blog.csdnimg.cn/blog_migrate/78632593cbcdcb293936d43320c2d47c.png)
2、Decompose A into 2 triangular matrices:
![equation?tex=A%3DL%5E%7B-1%7DU](https://i-blog.csdnimg.cn/blog_migrate/9d7dec65acbc840e8885d84f6592483d.png)
3、The problem become: