User:Kate Racaza/test page2: Difference between revisions
Kate Racaza (talk | contribs) No edit summary |
Kate Racaza (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
{{Template:API}}{{Template:BacktoPrevPage}} | {{Template:API}}{{Template:BacktoPrevPage}} | ||
xxx | xxx use the Weibull++ engine to perform life data analysis on an external data source. | ||
==Tutorial: Life Data Analysis== | ==Tutorial: Life Data Analysis== | ||
Line 27: | Line 27: | ||
WDS.AddSuspension(120, 5) | WDS.AddSuspension(120, 5) | ||
{{APIComment|'Use the 2-parameter Weibull distribution | {{APIComment|'Use the 2-parameter Weibull distribution and the rank regression on X (RRX) analysis method.}} | ||
{{APIComment|'Keep all other analysis settings at default.}} | {{APIComment|'Keep all other analysis settings at default.}} | ||
WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull | WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull | ||
Line 58: | Line 58: | ||
The data set can contain failures, suspensions, interval data or free-form data. The following example shows how to use the [[WeibullDataSet.AddFailure|AddFailure]] method to define failures and the [[WeibullDataSet.AddSuspension|AddSuspension]] method to define suspensions. | The data set can contain failures, suspensions, interval data or free-form data. The following example shows how to use the [[WeibullDataSet.AddFailure|AddFailure]] method to define failures and the [[WeibullDataSet.AddSuspension|AddSuspension]] method to define suspensions. | ||
{{APIComment|'Add failure times to the data set.}} | |||
WDS.AddFailure(16, 1) | |||
WDS.AddFailure(34, 1) | |||
WDS.AddFailure(53, 1) | |||
WDS.AddFailure(75, 1) | |||
WDS.AddFailure(93, 1) | |||
{{APIComment|'Add five suspensions to the data set.}} | |||
WDS.AddSuspension(120, 5) | |||
The AnalysisSetting property returns a [[WeibullAnalysisOptions Class|WeibullAnalysisOptions]] object, which represents the analysis settings of the WeibullDataSet object. In the following example, we use the <code>Distribution</code>, <code>Parameters</code> and <code>Analysis</code> properties of the WeibullAnalysisOptions class to specify the life distribution and analysis method. | |||
{{APIComment|'Use the 2-parameter Weibull distribution and the rank regression on X (RRX) analysis method.}} | |||
{{APIComment|'Keep all other analysis settings at default.}} | |||
WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull | |||
WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter | |||
WDS.AnalysisSettings.Analysis = WeibullSolverMethod.RRX | |||
To analyze the data set, use the [[WeibullDataSet.Calculate|Calculate]] method. The method returns a message box that shows the estimated parameters of the life distribution, based on the settings specified in the AnalysisSettings property. | |||
{{APIComment|'Analyze the data set.}} | |||
WDS.Calculate() | |||
In addition, the Calculate method creates a retrievable [[CModel Class|cModel]] object that represents the fitted model from the life data analysis. From the model, you can calculate useful metrics such as reliability, failure rate, mean time, etc. In this example, we calculate for the probability of failure (unreliability). | |||
{{APIComment|'Retrieve the fitted life distribution model.}} | |||
{{APIPrefix|Dim}} model {{APIPrefix|As}} cModel | |||
model = WDS.FittedModel | |||
{{APIComment|'Using the model, calculate the probability of failure at 226 hrs and display the result.}} | |||
{{APIPrefix|Dim}} r {{APIPrefix|As}} Double | |||
r = model.unreliability(226) | |||
MsgBox({{APIString|"Prob. Fail: "}} & r) | |||
==Notes== | |||
Related [[Calculate Results from a Model]] | |||
===References=== | |||
*[[WeibullDataSet Class]] | |||
**[[WeibullDataSet.AddFailure|WeibullDataSet.AddFailure Method]] | |||
**[[WeibullDataSet.AddSuspension| WeibullDataSet.AddSuspension Method]] | |||
**[[WeibullDataSet.Calculate|WeibullDataSet.Calculate Method]] | |||
*[[WeibullAnalysisOptions Class]] | |||
*[[CModel Class|cModel Class]] |
Revision as of 19:03, 11 May 2016
DRAFT
xxx use the Weibull++ engine to perform life data analysis on an external data source.
Tutorial: Life Data Analysis
The following example demonstrates how to define a Weibull++ data set, fit a life distribution to the data and obtain analysis results from the model. A discussion of the example follows.
VB.NET Imports SynthesisAPI Module Module1 Sub Main() 'Declare a new WeibullDataSet object. Dim WDS As New WeibullDataSet 'Add failure times to the data set. WDS.AddFailure(16, 1) WDS.AddFailure(34, 1) WDS.AddFailure(53, 1) WDS.AddFailure(75, 1) WDS.AddFailure(93, 1) 'Add five suspensions to the data set. WDS.AddSuspension(120, 5) 'Use the 2-parameter Weibull distribution and the rank regression on X (RRX) analysis method. 'Keep all other analysis settings at default. WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter WDS.AnalysisSettings.Analysis = WeibullSolverMethod.RRX 'Analyze the data set. WDS.Calculate() 'Retrieve the fitted life distribution model. Dim model As cModel model = WDS.FittedModel 'Using the model, calculate the probability of failure at 226 hrs and display the result. Dim r As Double r = model.unreliability(226) MsgBox("Prob. Fail: " & r) End Sub End Module
Discussion
The WeibullDataSet class represents a Weibull++ standard folio data sheet. The class contains all the methods and properties that allow you to define a data set and fit a statistical distribution to the data.
'Declare a new WeibullDataSet object. Dim WDS As New WeibullDataSet
The data set can contain failures, suspensions, interval data or free-form data. The following example shows how to use the AddFailure method to define failures and the AddSuspension method to define suspensions.
'Add failure times to the data set. WDS.AddFailure(16, 1) WDS.AddFailure(34, 1) WDS.AddFailure(53, 1) WDS.AddFailure(75, 1) WDS.AddFailure(93, 1) 'Add five suspensions to the data set. WDS.AddSuspension(120, 5)
The AnalysisSetting property returns a WeibullAnalysisOptions object, which represents the analysis settings of the WeibullDataSet object. In the following example, we use the Distribution
, Parameters
and Analysis
properties of the WeibullAnalysisOptions class to specify the life distribution and analysis method.
'Use the 2-parameter Weibull distribution and the rank regression on X (RRX) analysis method. 'Keep all other analysis settings at default. WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter WDS.AnalysisSettings.Analysis = WeibullSolverMethod.RRX
To analyze the data set, use the Calculate method. The method returns a message box that shows the estimated parameters of the life distribution, based on the settings specified in the AnalysisSettings property.
'Analyze the data set.
WDS.Calculate()
In addition, the Calculate method creates a retrievable cModel object that represents the fitted model from the life data analysis. From the model, you can calculate useful metrics such as reliability, failure rate, mean time, etc. In this example, we calculate for the probability of failure (unreliability).
'Retrieve the fitted life distribution model. Dim model As cModel model = WDS.FittedModel 'Using the model, calculate the probability of failure at 226 hrs and display the result. Dim r As Double r = model.unreliability(226) MsgBox("Prob. Fail: " & r)
Notes
Related Calculate Results from a Model