I solve the equation of form $f(x,y,z)=0$ numerically for a given list {x,y}
and put roots z0
into array. For several values $x$ & $y$ there is more then one root of equation.
Then I would like to organize the nested list with structure { {x,y}, z }
where z
can be a list. For instance,
{ {x1,y1},{{z1,z2,z3}} }
There is no problem to do it,
Transpose[{xyarray,zroots}]
gives me desirable result. But then I stuck with several problems:
How can I obtain the list of roots with structure
{ {{x1,y1},z1}, {{x1,y1},z2}, {{x1,y1},z3}, ...}
I can do it with many manipulations with Transpose but I believe that there is more simple way
Suppose that I have not only list of roots but list of pairs
{z1, g[z1]}
where $g$ is simple and known function. I compute listg[zarray]
and then organize list of pairs. Finally, I work with list with structure{ {{x1,y1},{ {z1,g[z1]}}, {z2,g[z2}}, {z3,g[z3]} },... }
In this list I would like to do several things. First, extract all the elements with $g(z_i)<0$. I understand how to do this with Cases
, no problem. Then, I would like to obtain list with structure
{ {{x1,y1},{z1,g[z1]}}, {{x1,y1},{z2,g[z2]}, ...}
Therefore, finally I look for the following manipulation with lists:
{ {{x,y},list} }----->{ {{x,y},list[[1]]}, {{x,y},list[[2]]},... }