Hi, I'm trying to find a way to solve this equation with two unknowns using Python:
(a * b) = (x * c) + (y * d) + e
Where a, b, c, d and e are all floating numbers provided by the user and x and y are what the program should return. I'd really appreciate pointers to help me understand, some starting point if possible. Please bear in mind that my math is at the most basic level, I'd be totally helpless in front of a Wikipedia article on advanced algebra.
after some equivalent transformations:
If d==0 and c==0 then x,y can be anything if a*b-e==0 else nothing
if d==0 and c!=0 then y= anything, x=(a*b-e)/c
if d!=0 and c==0 then y=(a*b-e)/d, x is anything
if d!=0 and c!=0 then x,y can be an infinite number of pairs so that if x is given, then y= (a*b-e-x*c)/d
Thank you both for the suggestions. Let me define this a bit: I'm trying to calculate liquids. There is no chance of either c or d being 0.
From what you've suggested, it looks like there'd be infinite solutions. If what I'm looking for in the final solution is the smallest y possible, how should I tackle this?
Sidenote: please do share links to pages that will help me understand that sort of equations better if you happen to have them / know how to find them. My math is a mess, as I've already said, and when I'm searching for similar equations I just get confused by what I find.