How to determine how many randomly distributed rays should strike a stack of plates?

25 Views Asked by At

I'm struggling with a geometrical problem.

I have 4 square plates of side L arranged vertically, and they're going to be struck by rays that are randomly and uniformly distributed in both angle of incidence and intersection.

Here's a diagram to help my explanation:

enter image description here

As you can see, they're separated in two pairs: The blue (middle ones) and the red (outer ones).

The distance between the inner plates is H and the distance between the outer plates is H+2•S, because S is the separation between the red and blue plates in each side.

I was trying to figure out how I could calculate the expected ratio between the number of rays that crossed the blue pair (independently of having or not crossed the red pair too) and the number of rays that crossed the red pair (all of which also cross the blue pair, of course).

And I'm struggling because it seems that my first approach didn't work.

My first approach was to, in each dimension, consider the integral of the "opening angle" versus the length.

That is, for each point in a plate where a ray crossed, there's a maximum and minimum incidence angle for which it would cross the other plate of that pair, so there's a Δθ. I integrated that Δθ for every point along that dimension of the plate, doing this for both X and Y separately and then finding the product.

This product would give me an area analog of this total "opening" of that pair to those random rays.

But, this approach was seemingly wrong.

I made a code in Python3 to simulate that, using the random.random() method, a PRNG, seeded with an actual RNG (os.urandom) at every 2048 numbers drawn. Both X,Y and Z intersects were random (the ray only had to pass through somewhere in the volume of that column) and the angles were randomly distributed between the minimum and maximum angle of the blue pair (between arctan(L/H) and -arctan(L/H)).

Every random choice is independent of each other, their ranges are set in the beginning of the simulation. No random choice changes the range for another random choice, because this would spoil independence and uniformity.

For a very large number of rays to cross the blue pair (10 million), the ratio of red/blue was larger than expected.

With H=20, S=6 and L=6, the ratio red/blue was 0.434768.

The ratio I expected using my integration was 0.397557.

The error becomes smaller as H becomes much larger than S, which is to be expected, cause the ratio approaches to 1 in both the simulation and in my approach, so the error has to diminish.

But for lower H/S ratios the error is too large, so I'm wondering: What is the correct approach then?

Thanks!