Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3 Modify the TTF simulation assuming that there are three components, one active and two spares, but still only one can be repaired at
Problem 3
Modify the TTF simulation assuming that there are three components, one active and two spares, but still only one can be repaired at a time. Repair time is 3.5 days. Run your simulation for 1000 replications and report a 95% confidence interval for the expected time to failure of the system.
import numpy as np import matplotlib.pyplot as plt # start with 2 functioning components at time 0 clock 0 # fix random number seed #np.random.seed(1) # initialize the time of events NextRepair float('inf') NextFailure np.ceil(6 *np.random.random) # lists to keep the event times and the states EventTimes [0] States [2] while S 0: # advance the time clock min(NextRepair, NextFailure) if NextRepairNextFailure # next event is completion of a repair NextRepair float('inf) else : # next event is a failure if S-1: NextRepair clock + 2.5 NextFailure clock + np.ceil (6 np.random.random)) # save the time and state EventTimes.append(clock) States.append(S) # plot the sample path print (TTF was:', clock) plt.plot(EventTimes, States, drawstyle 'steps-post') plt.show) import numpy as np import matplotlib.pyplot as plt # start with 2 functioning components at time 0 clock 0 # fix random number seed #np.random.seed(1) # initialize the time of events NextRepair float('inf') NextFailure np.ceil(6 *np.random.random) # lists to keep the event times and the states EventTimes [0] States [2] while S 0: # advance the time clock min(NextRepair, NextFailure) if NextRepairNextFailure # next event is completion of a repair NextRepair float('inf) else : # next event is a failure if S-1: NextRepair clock + 2.5 NextFailure clock + np.ceil (6 np.random.random)) # save the time and state EventTimes.append(clock) States.append(S) # plot the sample path print (TTF was:', clock) plt.plot(EventTimes, States, drawstyle 'steps-post') plt.show)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