Question: ORIGINAL CODE: # In this simulation the library numpy is used and it is named it np # We will also use the

ORIGINAL CODE:
# In this simulation the library numpy is used and it is named it "np"
# We will also use the math library and we will name it math
import numpy as np
import math as math
# The seed below initializes the random generator to always obtain the same result.
# DO NOT CHANGE THIS VALUE AND RERUN THIS CELL EVERYTIME YOU RUN THE PROGRAM.
np.random.seed(3500)
# Variables are defined in this cell
W =6000 # Weight of the Tank in kN
g =9.81 # Gravitational constant
meanCoF =0.6 # Mean of the coefficient of friction
stdCoF =0.05*0.6 # Standard deviation of the coefficient of friction
CoF =[] # Empty list to store coefficients of friction
Acc =[] # Empty list to store acceleration
H =[] # Empty list to store earthquake force
F =[] # Empty list to store resitance force
nSlide =0 # Counter of failures
pSlide =0 # Probability of failure
# Monte Carlo simulation
nsim =1000000 # Number of simulation
for i in range(nsim):
# Calculate earthquake forces
Acc.append(1.6* np.random.random()* g)
H.append(W * Acc[i]/ g)
# Calculate tank resistance force F = CoF * W
CoF.append(np.random.normal(meanCoF, stdCoF))
F.append(W * CoF[i])
# Check for failure
if H[i]> F[i]:
nSlide = nSlide +1
# Calculate the probability of the tank sliding during an earthquake
pSlide = nSlide / nsim
print("The probability of the tank sliding during an Earthquake is ", pSlide).
Answer question in image please.
 ORIGINAL CODE: # In this simulation the library numpy is used

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!