Monte Carlo Volume Technique

(Red +X axis,Green +Y axis)

**All graphs used in this problem are derived from the app geogebra **

Use the Monte Carlo integration method to find the volume between the two surfaces z = . 4 x 2 + . 4 y 2 ( P a r a b o l o i d ) z=.4x^2+.4y^2 (Paraboloid) and z = x 2 y 2 ( H y p e r b o l i c P a r a b o l o i d ) z=x^2-y^2 (Hyperbolic Paraboloid) and bounded by the planes * z=0 and z=3 *


The answer is 5.9.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Frank Petiprin
Sep 28, 2019

FIgure-1 geogerbra GRAPH (Red +x-axis and Green +y-axis)

       *****Tilt of the graph does not line up the z-axis and Circle/Hyperbola cross-sections.*****
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
The Python solution involves generating random points (x,y,z) in the TargetBox with 
 a resulting  Plane-z (0<= z <=3). Plane-z intersects the volume in a Circle and Hyperbola  
(picture above). If x and y lie in the circle/hyperbola area then the point (x,y,z)  lies in the 
volume between the two surfaces.

Import numpy as np
#                                           **Make Use Of The Above 3-D graph**
# TargetBoxVol=3*(2.75)**2; If plane z=3,3=(2/5)*(x**2+y**2) then max radius=sqrt(7.5)=2.74
def fCir(y,z):
      return np.sqrt(abs(2.5*z-y**2))
def fHyp(y,z):
      return np.sqrt(abs(1*z+y**2))
# FindHitsInHP counts the number of times points (x,y,z) lies between the two surfaces    
def FindHitsInHP(x,y,z): #x y z are column arrays  
      x,y=np.abs(x),np.abs(y)
      yR=np.sqrt(1.5*z) # y coordinate of intersection of Circle and Hyperbola
      yLR=(y<=yR) #Is y an element of the interval [0,yR]?
      #Is x in the interval[fHyp(y,z),fCir(y,z)]?
      trueHP=((fHyp(y,z)<=x)&(x<=fCir(y,z))) 
      return(sum(trueHP&yLR)) #sums all Trues in the array trueHP
#End FindHitsInHP           
#Main
seed=9007
#np.random.seed(seed) Use as needed for testing
Trials,SSize,TotVolHP=20,500000,0
TarS=2.75 #Target Side Length
TarH=3 #Target Height
TargetBoxVol=TarH*(2*TarS)**2  
for i in range(1,Trials+1):
    x,y,z=np.random.uniform(-TarS,TarS,SSize),np.random.uniform(-TarS,TarS,SSize),np.random.uniform(0,3,SSize)
    HitsInHP=FindHitsInHP(x,y,z)
    VolHP=(HitsInHP/SSize)*TargetBoxVol
    print('Total (x,y,z) in Vol',HitsInHP,'-Volume Common to Hyperbolic-Paraboloid and a Paraboloid',VolHP,SSize,'Trial',i)
    TotVolHP+=VolHP
print('Average Volume ',TotVolHP/Trials)
Total (x,y,z) in Vol 330348-Volume Common to (Hyperbolic-Paraboloid and a Paraboloid) 5.9958 5000000 Trial 1
Total (x,y,z) in Vol 330412-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9969 5000000 Trial 2
Total (x,y,z) in Vol 330122-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9917 5000000 Trial 3
Total (x,y,z) in Vol 330261-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9942 5000000 Trial 4
Total (x,y,z) in Vol 33063-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 6.0010 5000000 Trial 5
Total (x,y,z) in Vol 330157-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9923 5000000 Trial 6
Total (x,y,z) in Vol 330180-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9927 5000000 Trial 7
Total (x,y,z) in Vol 329652-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9831 5000000 Trial 8
Total (x,y,z) in Vol 330650-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 6.0012 5000000 Trial 9
Total (x,y,z) in Vol 329596-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9822 5000000 Trial 10
Total (x,y,z) in Vol 329703-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9841 5000000 Trial 11
Total (x,y,z) in Vol 329939-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9883 5000000 Trial 12
Total (x,y,z) in Vol 330375-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9963 5000000 Trial 13
Total (x,y,z) in Vol 330260-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9941 5000000 Trial 14
Total (x,y,z) in Vol 330405-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9964 5000000 Trial 15
Total (x,y,z) in Vol 329373-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9781 5000000 Trial 16
Total (x,y,z) in Vol 330626-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 6.0008 5000000 Trial 17
Total (x,y,z) in Vol 329731-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9846 5000000 Trial 18
Total (x,y,z) in Vol 330303-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9949 5000000 Trial 19
Total (x,y,z) in Vol 329548-Volume Common to Hyperbolic-Paraboloid and a Paraboloid 5.9812 5000000 Trial 20
**Average Volume  5.99156**

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...