Perform Accelerated Life Testing Data Analysis on External Data Source/VBA

From ReliaWiki
Jump to navigation Jump to search
APIWiki.png



Tutorial: Accelerated Life Testing Data Analysis

Below is the VBA version of the tutorial.

VBA

Sub Main()

  'Declare a new ALTADataSet object.  
   Dim ADS As New ALTADataSet

  'Define a stress type with use stress level = 300.  
   Call ADS.AddStressDefinition("Stress1",,300)

  'Add the failure times to the data set. 
   Call ADS.AddFailure_2(245, 1, 353)
   Call ADS.AddFailure_2(110, 1, 373)
   Call ADS.AddFailure_2(180, 1, 373)  
   Call ADS.AddFailure_2(200, 1, 373)
   Call ADS.AddFailure_2(50, 1, 393)
   Call ADS.AddFailure_2(70, 1, 393)
   Call ADS.AddFailure_2(88, 1, 393)
   Call ADS.AddFailure_2(112, 1, 393)
   Call ADS.AddFailure_2(140, 1, 393)
   Call ADS.AddFailure_2(160, 1, 393)
   
  'Add the suspensions to the data set. 
   Call ADS.AddSuspension_2(250, 5, 353)   
   Call ADS.AddSuspension_2(250, 3, 373) 
 
  'Use the Arrhenius-Weibull model. Keep all other analysis settings at default. 
   ADS.AnalysisSettings.ModelType = ALTASolverModel_Arrhenius
   ADS.AnalysisSettings.Distribution = ALTASolverDistribution_Weibull
 
  'Analyze the data set. 
   Call ADS.Calculate()

  'Calculate the B10 life and display the result. 
   Dim r As Double
   r = ADS.FittedModel.Time(.90)
   MsgBox("B10 Life: " & r)

End Sub