Jan-12-2023, 10:09 PM
Hello All,
Say I want to find all POSITIVE INTEGRAL solutions for a,b for this linear equation:
a + 2b = 5 and the solutions are:
a|5|3|1|
----------
b|0|1|2|
Say I want to find all POSITIVE INTEGRAL solutions for a,b for this linear equation:
a + 2b = 5 and the solutions are:
a|5|3|1|
----------
b|0|1|2|
import sympy a,b = symbols('a b', integer=True) solve( a*1 + b*2 - 5, [a,b])which gives me the following output:
[(5 - 2*b, b)]How to go next to extract the possible numerical solutions as given in the table? is there any built-in function in sympy for that?