Question: ORIGINAL CODE:# In this simulation the library numpy is used and it is named it np # We will also use the math
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 mathimport numpy as npimport 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 cellW # Weight of the Tank in kNg # Gravitational constantmeanCoF # Mean of the coefficient of frictionstdCoF # Standard deviation of the coefficient of frictionCoF # Empty list to store coefficients of frictionAcc # Empty list to store accelerationH # Empty list to store earthquake forceF # Empty list to store resitance forcenSlide # Counter of failurespSlide # Probability of failure# Monte Carlo simulationnsim # Number of simulationfor i in rangensim:# Calculate earthquake forcesAccappend nprandom.random gHappendW Acci g# Calculate tank resistance force F CoF WCoFappendnprandom.normalmeanCoF stdCoFFappendW CoFi# Check for failureif Hi Fi:nSlide nSlide # Calculate the probability of the tank sliding during an earthquakepSlide nSlide nsimprintThe probability of the tank sliding during an Earthquake is pSlideQ You must determine the value of the constant C Provide your answer as in terms of g You may round your answer to only two decimals.The constant C has a value of g Q Modify the original program as GIVEN to describe the maximum horizontal acceleration using the probability distribution described above and recalculate the probability of the tank sliding during an earthquake. Note: Round your answer to only three decimals.
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
