Question: How to find endogenous variable over a set of two exogenous variables?

Hello everyone,

I'm studying an equation with three variables similar to the following:

x*y+z=0

Now, I would like to obtain the numeric values of x associated to (y, z) that are free to assume any integer value within the intervals [-1...5] and [0...5] respectively. Thus, I should get 42 values of x overall. The question is very similar to the one asked here: https://www.mapleprimes.com/questions/146636-How-To-Solve-An-Equation-In-Three-Variables but in my case I would like to obtain all the 42 values of x (included undefined solutions) associated to the sets (y,z), possibly arranged in a 42x3 matrix where the columns are the variables (x,y,z) and the rows the values (x,y,z) that satisfy the equation.

I started to tackle the problem using a for loop:

for y from -1 by 1 to 5 do

    for z from 0 by 1 to 5 do

        eq:= fsolve(x*y + z, x);

    end do;

end do;

eq;

 

But it returns only one value: -1.000. Any help is appreciated.

Thank you for your time.

Please Wait...