Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equations cannot be solved #629

Open
evolcano opened this issue Mar 2, 2024 · 2 comments
Open

Equations cannot be solved #629

evolcano opened this issue Mar 2, 2024 · 2 comments

Comments

@evolcano
Copy link

evolcano commented Mar 2, 2024

The version I use:
AngouriMath 1.4.0 preview3

Unexpected behaviour or bug:

equation cann't resolve, the result in null:

{x * (6049/100 - y) * (1308/25) ^ z - 49/100 / 118000 = 0
x * (6019/100 - y) * (523/10) ^ z - 49/100 / 188000 = 0
x * (5669/100 - y) * (5231/100) ^ z - 12/25 / 126000 = 0}

{x * (3491/100 - y) * (1047/20) ^ z - 49/100 / 176000 = 0
x * (1661/50 - y) * (1308/25) ^ z - 12/25 / 110000 = 0
x * (4099/100 - y) * (1308/25) ^ z - 12/25 / 109000 = 0}

{x * (2553/50 - y) * (6151/100) ^ z - 49/100 / 107000 = 0
x * (4537/100 - y) * (1553/25) ^ z - 1/10 / 45000 = 0
x * (4329/100 - y) * (1243/20) ^ z - 1/4 / 63000 = 0}

PS: scipy can resolve in python:

from scipy.optimize import fsolve

def equations(variables):
    x, y, z = variables
    eq1 = x * (6049/100 - y) * (1308/25) ** z - 49/100 / 118000
    eq2 = x * (6019/100 - y) * (523/10) ** z - 49/100 / 188000
    eq3 = x * (5669/100 - y) * (5231/100) ** z - 12/25 / 126000
    return [eq1, eq2, eq3]

x, y, z = fsolve(equations, (1, 1, 1))

print("Solution: x =", x, ", y =", y, ", z =", z)

result:
x = 3.664588487257544e-09
y = -3.7470438531594783
z = 0.677872451234604

@WhiteBlackGoose
Copy link
Member

is the second argument of fsolve - the right column? If so, AM assumes it to be (0, 0, 0), so you need to subtract that number from the left expression

@evolcano
Copy link
Author

evolcano commented Mar 7, 2024

@WhiteBlackGoose The right column is 0, it is no necessary to suntract. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants