If one has two arrays of equal length, say
{x1,x2,.......xn} and {y1,y2,...yn},
how can one combine these into a third array of equal length
{{x1,y1},{x2,y2},....{xn,yn}}? This latter is actually an n x 2 matrix.
I need this for a purpose which actually may have a more elegant solution than using the above. I need to solve numerically an integral equation with what is called "collision number expansion" (Neumann series expansion), i. e. repeated integration. Using Nintegrate and nested integrals is hopeless already for the first loop, it would require a supercomputer to come up to the second or third iteration.
So instead I am calculating my (smoothly behaving) starting function in a number of points (say given xn coordinates), which will become the values yn. Then I use Interpolation because in the next iteration (integration) I need the value my function at points other than xn, this comes from the nature of the problem. But if I use Interpolation only on the yn, then the independent variable will not be my xn, only the natural numbers 1.2...n. Then of course I cannot perform the integration, since I lose contact with my individual dxi values.
This is what I thought to solve with the above trick, since if I use Interpolation on the point pairs, then my interpolated functions will have the correct x co-ordinates.
Any advice? Thanks!