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.
nprandom.seed
# Variables are defined in this cell
W # Weight of the Tank in kN
g # Gravitational constant
meanCoF # Mean of the coefficient of friction
stdCoF # 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 # Counter of failures
pSlide # Probability of failure
# Monte Carlo simulation
nsim # Number of simulation
for i in rangensim:
# Calculate earthquake forces
Acc.append nprandom.random g
HappendW Acci g
# Calculate tank resistance force F CoF W
CoF.appendnprandom.normalmeanCoF stdCoF
FappendW CoFi
# Check for failure
if Hi Fi:
nSlide nSlide
# Calculate the probability of the tank sliding during an earthquake
pSlide nSlide nsim
printThe probability of the tank sliding during an Earthquake is pSlide Please use this code to answer the queestion in image.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
