Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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). Please use this code to answer the queestion in image.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions