- #1

Telemachus

- 835

- 30

Hi there. I am working with a numerical quadrature in some scheme to solve a set of equations. At this point I am working in two dimensions. The thing is that I have some function ##\psi_m(x,y,\Omega_m)## with ##\Omega_m=(\Omega_{x,i},\Omega_{y,j})## with ##\displaystyle m=1,2,...,N,N+1,...,M=\frac{N(N+2)}{2}## where I am using a quadrature for the angular variables ##\Omega##, and the index N denotes the number of discrete directions cosines in each direction, N for x, and N for y.

Now, I have to give a determined weight to each set of the ##\Omega_m## (the weights comes from the angular quadrature of an integral), such that, for example ##\Omega_1=(\Omega_{x,1},\Omega_{y,1})## has assigned the weight ##w_1##, then for ##\Omega_2=(\Omega_{x,2},\Omega_{y,2})## we have ##w_2##,..., and for ##\Omega_N=(\Omega_{x,N},\Omega_{y,N})## we have ##w_N##. But the story continues, when I have ##\Omega_{N+1}=(\Omega_{x,1},\Omega_{y,2})##, this will have the weight ##w_{N+1}##, ##\Omega_{N+2}=(\Omega_{x,1},\Omega_{y,3})## this will have the weight t ##w_{N+2}##, and so on. But then, when I get, for example the direction ##\Omega_{2N+1}=(\Omega_{x,2},\Omega_{y,1})##, this weight must be equal to the one with the permuted indices, id est: ##w(\Omega_{x,2},\Omega_{y,1})=w(\Omega_{x,1},\Omega_{y,2})=w_{N+1}## and, in general ##w(\Omega_{x,i},\Omega_{y,j})=w(\Omega_{x,j},\Omega_{y,i})##.

This whole thing comes into a program I have written, which is automatized to solve the equation for an arbitrary set of directions M. I don't really know how to do this assignment of weights, specially the part of permuting the indices.

I thought perhaps somebody here could give me some idea.

Thanks in advance.

Now, I have to give a determined weight to each set of the ##\Omega_m## (the weights comes from the angular quadrature of an integral), such that, for example ##\Omega_1=(\Omega_{x,1},\Omega_{y,1})## has assigned the weight ##w_1##, then for ##\Omega_2=(\Omega_{x,2},\Omega_{y,2})## we have ##w_2##,..., and for ##\Omega_N=(\Omega_{x,N},\Omega_{y,N})## we have ##w_N##. But the story continues, when I have ##\Omega_{N+1}=(\Omega_{x,1},\Omega_{y,2})##, this will have the weight ##w_{N+1}##, ##\Omega_{N+2}=(\Omega_{x,1},\Omega_{y,3})## this will have the weight t ##w_{N+2}##, and so on. But then, when I get, for example the direction ##\Omega_{2N+1}=(\Omega_{x,2},\Omega_{y,1})##, this weight must be equal to the one with the permuted indices, id est: ##w(\Omega_{x,2},\Omega_{y,1})=w(\Omega_{x,1},\Omega_{y,2})=w_{N+1}## and, in general ##w(\Omega_{x,i},\Omega_{y,j})=w(\Omega_{x,j},\Omega_{y,i})##.

This whole thing comes into a program I have written, which is automatized to solve the equation for an arbitrary set of directions M. I don't really know how to do this assignment of weights, specially the part of permuting the indices.

I thought perhaps somebody here could give me some idea.

Thanks in advance.

Last edited: