0

Use the Monte Carlo method to find the volume of intersection of, three cylinders, all of radius 3 units and infinite in length,with the axis of the first cylinder being the x-axis, the axis of the second cylinder being the y-axis and the axis of the third cylinder being the line with points (1; 1; z) where z belongs to R(any real number).

I have no idea how to do this on MATLAB. Any help, hints would be appreciated. Thank you so much!

  • 1
    Welcome to Math.SE! It would be very helpful to other people if you include what your own thoughts are about this problem. In what direction are you thinking? What do you already know? – Hrodelbert May 04 '15 at 15:17
  • 1
    Do you mean the central axis is the x axis , y axis and line , and the the vertical line through (1,1,0)? If so, you have 3 bounding inequalities: $y^2+z^2\leq 9,$ $x^2+z^2\leq 9,$ and $(x-1)^2 + (y-1)^2 \leq 9.$ – matt biesecker May 04 '15 at 15:31

1 Answers1

1

See my comment above and check my math below. The bounding inequalities $y^2+z^2\leq 9,$ $x^2+z^2\leq 9,$ and $(x-1)^2 + (y-1)^2 \leq 9.$, taken together imply your region lies in a sphere $(x-0.5)^2 + (y-0.5)^2 + z^2 \leq 13.$ This means the region lies within a box, say $[-3.5,4.5] \times [-3.5,4.5] \times [-4,4]$ (I used a radius of 4 rather than $\sqrt{13}$) Draw uniform random numbers (one each for x,y,z) in this box. If they satisfy all three bounding inequalities, then the point lies in the region.

One further hint: $r=a+(b-a)*rand()$ generates a uniformly distributed pseudo random number between $a$ and $b$