Using C++ please
The Weibull Distribution is used to assess product reliability and model failure times. We can determine if the number of failures is increasing with time, decreasing with time, or remaining constant. The following equations are used to compute for the Weibull Distribution of a product: Density Function P(X
c) = f(x) dx = e f(3) = xa-de-) where x 2 0,&>0,8 > 0 = ["(x) dx = 1-2 (179) f(x) dx = 2 (8) 4 = E(X) = p.1(1+2) >>= cp) = fr(1+2) -[c(+2))} Mean Variance Alpha (a) Properties Also known as Shape Parameter, Weibull Scope, or Threshold Parameter. Beta () Properties Also known as Scale Parameter or Characteristic Life Paramter. If a1, failure rate increases with time. If a=1, failure rate is constant. Here is an example of the Probability Density with respect to time (x): 0.025 0.020 5.08 0.015 Probability Density Figure 1: Taken from http://www.engineeredsoftware.comasa/weibull.htm. 0.010 0.005 1 0.000 3D Y Based on Figure 1, failure rates can increase or decrease with respect to time and depending on the alpha and beta properties of the product. For this machine problem, create a program that will replicate the Weibull Distribution below. Weibull Distribution a = 10, p = 0.5 = 10, = 1 = 10, B = 2 Figure 2: Taken from http://www.math.utah.edu/~Izhang/teaching/3070summer2009/Daily%20Up dates/lectures/sec4_5.pdf You will only need the following equations: Density Function (to plot the XY coordinates) and Mean (to determine the amount of time a product can last prior to failure). You will use the alpha and beta properties on Figure 2 as your input since you will be replicating the 3 curves. Specifications: 1. Prompt the user to enter the alpha and beta properties of the 3 curves shown on Figure 2. 2. Use a Class structure complete with member functions. Therefore, you have 3 objects: 1 object represents a curve on the figure. 3. It will be easier to pass values from one function to another. The program will be much shorter if you take advantage of this. 4. Compute for the Mean of each curve (product). Be cautious of r (Gamma). It is simply the factorial of a number but computing for the factorial of a number with a decimal will be different as shown below. T(n) = (n - 1)! 7 5 3 1 Example: (4.5) = 3.5! = 11.63 2 2 2 2V You will need to find a way to implement the factorial of a decimal using C++ without having to apply the long method. 5. The program should generate an output like the one below. SCHWINDOWS\system32\cmd.exe Alpha property for product #1: 10 Beta property for product #1: 0.5 Alpha property for product #2: 10 Beta property for product #2: 1 Alpha property for product #3: 10 Beta property for product #3: 2 Summary Product #1 may last up to 0.475675 (unit time) prior to failure. Product #2 may last up to 0.951351 (unit time) prior to failure. Product #3 may last up to 1.9027 (unit time) to failure. Plot the curve using Excel. (x) f(x) Curve 1 ========================= f(x) Curve 2 f(x) Curve 3 2.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1.024e-@5 0.69524233 0.200339 2.41106 7.35759 0.211166 1.13243e-10 2.4374e-45 3.42816e-152 le-08 5.12e-26 0.000196829 0.00262117 0.0195122 0.100169 0.392297 1.28553 2.73372 3.67879 1.76233 0.105583 0.000109238 5.66216e-11 3.47707e-23 1.2187e-45 3.31541e-85 1.71408e-152 1.73763e-263 1.1 1.2 1.3 @ @ 9.76562e-12 5e-09 1.92217e-07 2.56-06 1.90735e-25 9.84144-05 0.000394067 0.00131058 0.00378212 0.99975609 0.0229686 0.0500847 0.102175 0.196148 0.354866 0.682765 0.951128 1.36686 1.73163 1.8394 1.52144 0.881163 0.387813 0.0527915 0.00336107 5.46188e-05 1.37977e-07 2.83108e-11 2.03436e-16 1.73853e-23 4.46923e-33 6.0935e-46 @ @ 6. For the XY coordinates, you will need to use a looping statement and manipulators. For the step, you may want to consider values less than 1 to get a smooth curve. 7. Copy and paste the coordinates to Excel and insert a chart (choose Scatter with Smooth Lines). If all goes well, the curves should be the same as the ones on Figure 2. Chart Title -Series Series Series 0 o o 0 0.1 1.02E-05 1.00E-08 9.77E-12 0.2 0.00524 5.12E-06 5.00E-09 0.3 0.20034 0.0002 1.92E-07 0.4 2.41106 0.00262 2.56E-06 0.5 7.35759 0.01951 1.91E-05 0.6 0.21117 0.10017 9.84E-05 0.7 1.13E-10 0.3923 0.00039 0.8 2.44E-45 1.20553 0.00131 0.9 2.73372 0.00378 1 0 3.67879 0.00976 1.1 0 1.76233 0.02297 1.2 0 0.10558 0.05008 1.3 0 0.00011 0.10218 0 5.66E-11 0.19615 1.5 0 3.48E-23 0.35487 1.6 0 1.22E-45 0.60277 1.7 O 3.32E-85 0.95113 1.8 O ##### 1.36686 1.9 O # 1.73163 2 0 1.8394 2.1 0 0 1.52144 2.2 0 0 0.88116 2.3 0 0.30781 2.4 0 0 0.05279 2.5 0 0 0.00336 2.6 0 5.46E-05 2.7 0 1.38E-07 2.8 0 0 2.83E-11 2.9 0 0 2.03E-16 3 O 1.74E-23 3.1 0 0 4.47E-33 3.2 0 06.09E-46 3.3 05.01E-63 0.5 1.5 Weibull Distribution = 10, B = 0.5 & a = 10. B = 1 = 10, B = 2 20 20 20 40 100 Grading Criteria Utilized struct with working member functions. Passed values from argument to parameter. XY coordinates were organized in tabular format. Program generated the correct curves. Provide your source code Provide your chart for the code