Answered step by step
Verified Expert Solution
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.
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started