Perform Accelerated Life Testing Data Analysis with Stress Profiles/VBA

From ReliaWiki
Revision as of 15:32, 7 September 2016 by Kate Racaza (talk | contribs) (Created page with '{{Template:API}} ==Tutorial: Accelerated Life Testing Data Analysis - Stress Profiles == Below is the VBA version of the [[Perform_Accelerated_Life_Testing_Data_Analysis_with_St…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
APIWiki.png



Tutorial: Accelerated Life Testing Data Analysis - Stress Profiles

Below is the VBA version of the tutorial.

VBA

Sub Main()
 
  'Declare a new stress profile and define its segments.  
   Dim sp As New ALTAStressProfile
   Call sp.AddSegment(200, 125) 
   Call sp.AddSegment(300, 175)
   Call sp.AddSegment(350, 200)
   Call sp.AddSegment(375, 250)
   sp.RepeatCycle = False

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

  'Assign the stress profile to the data set.  
   Call ADS.AddStressProfile(sp)

  'The stress profile uses the logarithmic (power LSR) stress transformation 
  'and has a use stress level = 100.  
   Call ADS.AddStressDefinition("Stress1", ALTASolverLSR_Power, 100)
 
  'Add the failure times to the data set. 
   Call ADS.AddFailure_2(252, 1, sp)
   Call ADS.AddFailure_2(280, 1, sp)
   Call ADS.AddFailure_2(320, 1, sp)
   Call ADS.AddFailure_2(335, 1, sp)
   Call ADS.AddFailure_2(354, 1, sp)
   Call ADS.AddFailure_2(361, 1, sp)
   Call ADS.AddFailure_2(362, 1, sp)
   Call ADS.AddFailure_2(368, 1, sp)
   
  'Add the suspensions to the data set. 
   Call ADS.AddSuspension_2(328, 1, sp)   
   Call ADS.AddSuspension_2(375, 3, sp) 
 
  'Use the cumulative damage - Weibull model to analyze the data set. 
  'Keep all other analysis settings at default. 
   ADS.AnalysisSettings.ModelType = ALTASolverModel_CumDamage
   ADS.AnalysisSettings.Distribution = ALTASolverDistribution_Weibull
 
  'Analyze the data set. 
   Call ADS.Calculate()

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

End Sub