当前位置:网站首页>Solution of overdetermined equation
Solution of overdetermined equation
2022-04-22 07:04:00 【Lupin123123】
Do your homework today , It is required to solve a system of overdetermined equations , I thought I could use it directly sympy Library linsolve() Just get the function done , The result cannot be obtained , I guess it's because of the error
import numpy as np
from sympy import *
A = np.array([[-0.75, 0.25, 0, 0],
[0.2, -0.8, 0.25, 0],
[0.12, 0.12, -0.8, 0.25],
[0.43, 0.43, 0.55, -0.25],
[1.00, 1.00, 1.00, 1.00]])
b = np.array([0, 0, 0, 0, 1.0])
A = np.column_stack((A, b))
A = Matrix(A)
A = A.rref() // The augmented matrix is transformed into a row stepped matrix
A = np.array(A[0])
print(A)
In fact, it can also be used np.linalg.lstsq() Method , But this method is an approximation , Can't judge the solution of the equations , But you can use **np.linalg.matrix_rank()** First judge the rank of the augmented matrix, and then use this method to solve
A = np.array([[-0.75, 0.25, 0, 0],
[0.2, -0.8, 0.25, 0],
[0.12, 0.12, -0.8, 0.25],
[0.43, 0.43, 0.55, -0.25],
[1.00, 1.00, 1.00, 1.00]])
b = np.array([[0], [0], [0], [0], [1.0]])
x = np.linalg.lstsq(A, b, rcond=None)[0]
版权声明
本文为[Lupin123123]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220604096558.html
边栏推荐
- USBCAN卡在动力电池组EOL测试系统中CAN总线的应用
- Replace Fe1 1s hub card reading master chip-ma8601
- It's nothing to be able to dismantle the host. Mr. expressway can also test it
- Stm32wb55 RTT based ble sample making process
- Add files to the server
- Do you believe that one day BGA can't take the difference line?
- Alternative ag9311 design circuit | cs5266 application circuit diagram | design and development of three in one scheme of typec docking station
- Oscilloscope can only measure waveform - the pattern is small
- Development of two stage target detection technology (I) r-cnn and spp net
- STM32 clock division Tim_ Detailed description of clockdivision configuration and use
猜你喜欢

Do you believe that one day BGA can't take the difference line?

PMSM FOC控制 Matlab/Simulink仿真之反Park变换

CAN总线中继网桥在新能源测试系统中的应用。

CAN光纤光端机在光电滑环中的应用

The buried mine design of PCB mark is short circuited, but no trace can be found

Meituan set up channel package walle mode

Design parameters and circuit comparison of type C to HDMI 4k30hz expansion chip scheme cs5261 and cs5266

HDMI2.0二进一出切换器方案ASW3642和TS3DV642设计电路对比

量化PM2.5数据

STM32 时钟分割TIM_ClockDivision配置及使用详细说明
随机推荐
The capacitor on PCBA is cracked and short circuited. Why is it the fault of design?
Do you believe that one day BGA can't take the difference line?
谱瑞PS8625替代方案|PS8622替代方案|高性价比EDP转LVDS转接板方案CS5211设计开发
PCBA上電容開裂短路,怎麼又是設計的錯?
STM32定时器产生事件TIM_GenerateEvent
Development of two stage target detection technology (II) fast r-cnn and fast r-cnn
MCS-5 中断技术(理论)
STM32学习记录0005——JLINK下载与调试
示波器只能测波形-格局小啦
沁恒CH573开发板上手
C form design: the mouse is close to the control to display prompt remarks
CS5213新版规格书|CS5213新版说明书|HDMI转VGA带音频信号输出方案设计
It's hard to believe that this pair of high-speed signals have changed through holes so many times!!!
911数据中不同月份不同类型的电话的次数的变化情况
Replace rtd2171u | cs5266 design circuit | type C to HDMI scheme | cs5266an
Easy to use textview marquee effect
Audio type 523 + VGA + 5 + HDC to 5 + VGA
I didn't dare to think about it before
PCBA上电容开裂短路,怎么又是设计的错?
MDK-Scope联合调试 RTT模式 多通道