**Introduction**

In this article we discuss how ReliaSoft APIs can be used to automate reliability analysis. Whilst the ReliaSoft API library can be used for various automation tasks we focus on life data analysis. You can find more documentation here; ReliaSoft API library.

**ReliaSoft APIs**

The ReliaSoft Application Programming Interface (API) enables you to programmatically read and write data to ReliaSoft repositories, as well as analyse and plot data sets from external sources. It is provided by Visual Basic for Applications (VBA) and .NET applications, allowing you to create automated solutions using popular Microsoft Office applications, such as Excel, or create custom “executable” applications for your organisation.

Implementing a ReliaSoft API Solution allows you to connect data in ReliaSoft repositories with the systems and tools used within your organisation. It provides the functionality to transfer and synchronize data via XML; read or write data to specific data elements within ReliaSoft repositories; and analyse data and calculate results using Life Data Analysis.

**Life Data Analysis**

Life Data Analysis refers to the study and modelling of observed product lives. Life data can be lifetimes of products in the marketplace, such as the time the product operated successfully or the time the product operated before it failed. These lifetimes can be measured in hours, miles, cycles-to-failure, stress cycles or any other metric with which the life or exposure of a product can be measured. All such data of product lifetimes can be encompassed in the term life data or, more specifically, product life data. The subsequent analysis and prediction are described as life data analysis.

**LDA with ReliaSoft APIs**

ReliaSoft Weibull++ is a comprehensive life data analysis tool that performs life data analysis utilising multiple lifetime distributions, warranty and degradation data analysis, design of experiment and more with a clear and intuitive interface geared toward reliability engineering.

A VBA Application, written using the ReliaSoft API, can be used to automate and perform Life Data Analysis using Weibull++’s analysis engine on external data. This is instead of importing the data into the tool and using the graphical user interface (GUI). The application can then report back calculated results such as reliability, probability of failure, BX% life, failure rate and mean time.

**Performing LDA**

The three key steps of Life Data Analysis are:

- Collect failure data;
- Fit a probability failure distribution to model the component’s reliability; and
- Share the results using reliability metrics.

**1. Collect failure data **

The collected failure data needs to be “time to failure data” and the more data points the better. However, we can fit curves to as few as 6 data points. When setting up tests, always remember potential pitfalls such as failures due to mechanisms that you do not wish to look at and failures of test rigs. Failure of test rigs can result in censored, or suspended data, where the test duration has stopped but the component has not yet failure.

**2. Fit a probability distribution**

There are many probability distributions that can be used to model reliability, the most commonly used are the Exponential, Weibull, and Lognormal distributions. All of these require at least one parameter to be estimated to fit the model to the failure data, and between them they can model increasing, decreasing or constant failure rate.

The parameters of the chosen model (distribution) are estimated based on the data set. There are two key methods for computer-based parameter estimation:

- Rank Regression/ Least Squares; and
- Maximum Likelihood Estimation(MLE).

Rank regression ensures accurate and consistent line fitting by employing a common mathematical technique known as least squares regression analysis. Least squares, or least sum of squares, regression requires that a straight line be fitted to a set of data points, such that the sum of the squares of the distance of the points to the fitted line is minimized. Rank regression is ideal for complete data and small sample sizes.

The MLE method is a statistical (rather than graphical) approach to parameter estimation. For a given a data set, MLE estimates the parameters that maximize the probability that the failure data belongs to that probability distribution and that set of parameters. MLE is known to be badly biased for small sample sizes, but handles censored data well, regardless of censoring scheme.

**3. Reliability metrics**

**3. Reliability metrics**

Once the parameter(s) have been estimated and the model fitted, we need to verify the model’s appropriateness, by asking the following questions:

- Does it fit the data?
- Does it fit your physical understanding of the failure mechanism?

More advanced models maybe needed to be used to model the effect of multiple failure modes. Finally with a fitted Reliability model we can now calculate metrics such as reliability, probability of failure, BX% life, failure rate and mean time.

**Performing LDA with an API**

**Performing LDA with an API**

The necessary steps for the Automated Weibull Analysis using ReliaSoft API are no different to the above steps, except there is no GUI to guide you through process. Instead, the probability distribution and parameter estimation, and reliably metrics to be calculated are specified in the code.

There is an option to determine which distribution best fits the databased on a pre-defined list of distributions e.g., only consider the normal, lognormal and 2-parameter Weibull distributions in the evaluation. This is similar to the Distribution Wizard feature in Weibull++.

**Example**

Whilst life data analysis requires the skill and judgement of an experienced engineer, automated life data analysis can save considerable time if there is a lot of repetitive analysis being produced. An example of where it would be ideally placed is the repeated testing of the same product to monitor its reliability to ensure manufacturing changes have not occurred which has changed its reliability. In this example a lot of data would be created that would need to be analysed in exactly the same way to compare and monitor the results of the testing, with the API script saving orders of magnitude of analysis time.

Number in State | State | Time to F or S |

1 | F | 16 |

1 | F | 34 |

1 | F | 53 |

1 | F | 75 |

1 | F | 93 |

5 | S | 120 |

An example of a Life Data Analysis API script to analyse the data contained in the above table is given below. For simplicity the data values are “hard coded” into this example code. However, the data could directly reference a specific Excel worksheet and cycle through every row, importing in all data.

`Option Explicit `

Sub Main()

'Declare a WeibullDataSet object.

Dim WDS as New WeibullDataSet

'Add the failure times to the data set.

Call WDS.AddFailure(16,1)

Call WDS.AddFailure(34,1)

Call WDS.AddFailure(53,1)

Call WDS.AddFailure(75,1)

Call WDS.AddFailure(93,1)

Call WDS.AddSuspension(120,5)

'Use the 2-parameter Weibull disctibution and the MLE analysis method.

WDS.AnalysisSettings.Distribution = WeibullSolverDistribution_Weibull

WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters_MS_2Parameter

WDS.AnalysisSettings.Analysis = WeibullSolverMethod_MLE

'Keep all other analysiss settings as default.

'Analyze the data set.

WDS.Calculate

'Calculate the probability of failure at 226 hrs and display the result.

Dim r As Double

r = WDS.FittedModel.Unreliability(226)

MsgBox("Probability of Failure at 226hrs = " & Round(r,3))

End Sub

This example script analyses the data using the 2-parameter Weibull distribution and the MLE analysis method and displays a message box containing the probability of failure at an arbitrary 226hrs. A screenshot of this inaction in a macro enabled workbook in excel is given below.

A more complicated script could do a lot more. In the below image was created using the API to embed a plot in a VBA User Form, along with the probability of failure calculation. This plot uses the “WAPlotSettings” Class within the API to generate a weibull probability plot using the Weibull++ plotting engine.

**Summary**

These simple examples are used to show the power of the ReliaSoft APIs, which enable the ReliaSoft suite to be even more seamlessly integrated into your organisations process and meet your needs. Whether they are for automated analysis and reporting or for managing large data sets.

The ReliaSoft API is not limited to just Weibull++ and life data analysis and they can be used with BlockSim, RCM++, XFMEA and XFRACAS to read, write and modify data held within the database.

**How we can help you**

Wilde Analysis has both extensive experience of performing Life Data Analysis consultancy projects and using the ReliaSoft APIs to provide solutions to client needs, please contact info@WildeRisk.co.uk to find out more.