I have a function f
which takes three arguments x, y and z
:
f[x_,y_,z_] := 2 x + 0.5 y + z
The arguments x, y and z
must have a pre-defined domains, for example:
-1 < x < 1
3 <= y < 7
-3 < z <= 3
I would like to run my function across x,y and z
sets corresponding to some pre-defined domains as stated above and extract only those x, y and z
sets which produce some arbitrary value, for example:
7, 12, 20 etc.
The expected output I seek is something like:
{{x,y,z}, result}
where {x,y,z}
is a set of x,y,z
arguments which were passed to my function and result
is the associated result which is some pre-defined arbitrary value.
Edit
If I have a function in four parameters instead as
f[x_,y_,z_,d_] := 2 x + 0.5 y + z+ d
and I want to run f
only over x,y,z
regions while fix d
at say d=5
. I tried:
f[x_, y_, z_, d_] := 2 x + z + 0.5 y + d
x := Range[1, 5, 1]
y := Range[5, 9, 1]
z := Range[10, 14, 1]
d := 5
data = Outer[f, x, y, z, d]
But it gave output sample:
{{{f[1, 5, 10], f[1, 5, 11], f[1, 5, 12], f[1, 5, 13], f[1, 5, 14]}}}
So it seems doesn’t work. Any help ..
Note that I don't want to set d from the pre definition of the function, because my real calculation are so long and will be difficult to define the fixed parameter each time .
DensityPlot
, is that it? Use the optionPlotRange
for the second question. $\endgroup$f[x,y,z]
to be as Mathematica syntax. Now, I don't want to to make a plot any more, I just want Mathematica to show a table of values forf[x,y,z]
, epically if I have a function in more than 2 parameters, say four or six parameters, in which each one has a range. $\endgroup$Table
. $\endgroup$