User:Kate Racaza/test page2: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
(Replaced content with '=DRAFT= {{Template:API}}{{Template:BacktoPrevPage|<< Back to Tutorials Main Page}} xxx ==Tutorial: Life Data Analysis==')
No edit summary
Line 1: Line 1:
=DRAFT=
=DRAFT=
{{Template:API}}{{Template:BacktoPrevPage|[[API Tutorials|<< Back to Tutorials Main Page]]}}
{{Template:API}}{{Template:BacktoPrevPage}}


xxx
xxx


==Tutorial: Life Data Analysis==
==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'''
{{APIPrefix|Imports}} SynthesisAPI
{{APIPrefix|Module}} Module1
    {{APIPrefix|Sub}} Main()
  {{APIComment|'Declare a new WeibullDataSet object.}}
    {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
 
  {{APIComment|'Add the 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)
    WDS.AddFailure(120, 1)
 
  {{APIComment|'Add four suspensions to the data set.}}
    WDS.AddSuspension(120, 4) 
  {{APIComment|'Use the 2-parameter Weibull distribution with 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
 
  {{APIComment|'Analyze the data set.}}
    WDS.Calculate()
 
  {{APIComment|'Retrieve the fitted life distribution model.}}
    {{APIPrefix|Dim}} model {{APIPrefix|As}} cModel
    model = WDS.FittedModel
  {{APIComment|'Using the model, calculate the reliability at 226 hrs and display the result.}}
    {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
    r = model.reliability(226)
    MsgBox({{APIString|"Reliability: "}} & r)
    {{APIPrefix|End Sub}}
{{APIPrefix|End Module}}

Revision as of 23:21, 10 May 2016

DRAFT

APIWiki.png


<< Back to Tutorials Main Page

xxx

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 the 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)
   WDS.AddFailure(120, 1)
  
  'Add four suspensions to the data set. 
   WDS.AddSuspension(120, 4)   

  'Use the 2-parameter Weibull distribution with 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 reliability at 226 hrs and display the result. 
   Dim r As Double
   r = model.reliability(226)
   MsgBox("Reliability: " & r)

   End Sub
End Module