current position:Home>How does Python's sympy module use the specific value input to solve the system of binary primary equations

How does Python's sympy module use the specific value input to solve the system of binary primary equations

2022-02-03 01:56:16 CSDN Q & A

img


I found the relevant code and wrote it . But there is something wrong with the calculated result . I also want to ask you guys to help me see




Refer to the answer 1:

For example, solving equations :
2x-y=3
3x+y=7
You need to pay attention to the sign of the constant term , Other no problem :
A,B,C=2,-1,-3
a,b,c=3,1,-7
x,y = sympy.symbols('x y')
sympy.solve([A*x+B*y+C,a*x+b*y+c],[x,y])
{x: 2, y: 1}




Refer to the answer 2:



Refer to the answer 3:

There's nothing wrong with your writing , The equation moves all the formulas and constants to the left , On the right is 0
namely ax+by+c=0 The way
So the formula on the left uses solve In the middle ok 了




Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030156143693.html

Random recommended