ALTADataSet Class: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
Line 60: Line 60:


== Usage Example ==
== Usage Example ==
<!--Not validated.-->
This example demonstrates how to analyze failure times and suspensions obtained under time-varying stress conditions (ALTA PRO only). Full application examples are available at [[Synthesis_API_Reference#Application_Examples]].


  {{APIComment|'Declare the ALTADataSet. See [[ALTADataSet Constructors]].}}
  {{APIComment|{{APIComment|'***Initialize a New ALTADataSet object***
  Dim ALTADS As New ALTADataSet
   Dim ADS As New ALTADataSet("DataSet1")
 
{{APIComment|'Define a single stress. See [[ALTADataSet.AddStressDefinition|AddStressDefinition]].}}
  ALTADS.AddStressDefinition("Stress1", ALTASolverLSR.Exponential, 300)
         
{{APIComment|'Create a stress profile to describe time-varying stress conditions. See [[ALTAStressProfile Class|ALTAStressProfile]].}}
   Dim sp = New ALTAStressProfile("Profile1")
  sp.RepeatCycle = True
  sp.AddSegment(1, 250)
  sp.AddSegment(2, 300)
  sp.AddSegment(3, 400)
    
    
  {{APIComment|'Add 3 exact failure times to the data set. See [[ALTADataSet.AddFailure|AddFailure]].}}
  {{APIComment|'***Analysis Settings***
   ALTADS.AddFailure(10, 1, sp)
  ADS.AnalysisSettings.ModelType = ALTASolverModel.Arrhenius
   ALTADS.AddFailure(20, 1, sp)
   ADS.AnalysisSettings.Distribution = ALTASolverDistribution.Weibull
   ALTADS.AddFailure(30, 1, sp)
   ADS.AnalysisSettings.Analysis = ALTASolverMethod.MLE
   ADS.AnalysisSettings.UngroupGroupedData = False
  ADS.AnalysisSettings.SortBeforeCalculations = True
    
    
  {{APIComment|'Add 3 suspensions to the data set. See [[ALTADataSet.AddSuspension|AddSuspension]].}}
  {{APIComment|'***General Settings***
   ALTADS.AddSuspension(50, 3, sp)
  ADS.GeneralSettings.AllowLargeBetaValues = False
   ADS.GeneralSettings.ImplementStressAtTheEndOfTheStep = False
    
    
  {{APIComment|'Get the numbers of failure times. In this example, NumberOfFailures will be 3. See [[ALTADataSet.FailureCount|FailureCount]].}}
  {{APIComment|'***Add Stress Definitions***
   Dim NumberOfFailures As Integer
   ADS.AddStressDefinition("Temperature (K)", , 400)
  NumberOfFailures = ALTADataSet.FailureCount
 
 
  {{APIComment|'***Add Failure Times***
  {{APIComment|'Get the number of suspensions. In this example, NumberOfSuspension will be 3. See [[ALTADataSet.SuspensionCount|SuspensionCount]].}}
   ADS.AddFailure(248, 1, 406)
  Dim NumberOfSuspension As Integer
   ADS.AddFailure(164, 1, 416)
   NumberOfSuspension = ALTADS.SuspensionCount
   ADS.AddFailure(92, 1, 426)
    
{{APIComment|'Specify that the data will be fitted to a cumulative damage model combined with}}
{{APIComment|'the Weibull life distribution. See [[ALTASolverModel Enumeration|ALTASolverModel]] and [[ALTASolverDistribution Enumeration|ALTASolverDistribution]].}}
   ALTADS.AnalysisSettings.ModelType = ALTASolverModel.CumDamage
  ALTADS.AnalysisSettings.Distribution = ALTASolverDistribution.Weibull
    
    
  {{APIComment|'Fit the data to the model. See [[ALTADataSet.Calculate|Calculate]].}}
  {{APIComment|'***Calculate the data***
   ALTADS.Calculate
   ADS.Calculate()
    
    
  {{APIComment|'Use the fitted model to calculate and save the reliability at time &#61; 100. See [[cModel.Reliability|Reliability]].}}
  {{APIComment|'***Get the reliability at 300 hours***
   Dim Rel As Double
   Dim Rel As Double
   Rel = ALTADS.FittedModel.Reliability(100)
   Rel = ADS.FittedModel.Reliability(300)
     
{{APIComment|'Clear the data and fitted model. See [[ALTADataSet.ClearDataSet|ClearDataSet]].}}
  ALTADS.ClearDataSet

Revision as of 23:40, 26 March 2014


Provides the functionality of an ALTA standard folio, including entering data in a data set, specifying analysis settings and fitting a distribution and life-stress relationship to the data set. To create plots, use the WAPlots class.

Constructors

  • ALTADataSet Creates a new ALTADataSet object with an empty data set name.
  • ALTADataSet( String ) Creates a new ALTADataSet object with the user-specified data set name.

Methods

Use these methods to enter data points into a data sheet and analyze them. The settings for the analysis are specified with this class's properties.

Add Stresses and Stress Profiles

Add/Remove Data

Analyze Data

  • Calculate Fits the model (i.e., distribution and life-stress relationship) to the current data set using the settings specified in the AnalysisSettings property.

Properties

Use these properties to specify analysis settings and view analysis results, as well as view or edit properties of the data set.

Analysis Settings

Analysis Results

  • FittedModel (as cModel) Gets the fitted model from the accelerated life testing analysis.
  • AnalysisResults (as ALTAAnalysisResults) Gets the likelihood function value that was estimated from the analysis.

Data Set Properties

  • DatasetName (as string) Provides the ability to retrieve or set the name of the data set.
  • FailureCount (as integer) Gets the total number of failures in the data set.
  • SuspensionCount (as integer) Gets the total number of suspensions in the data set.
  • NumStresses (as integer) Gets the total number of stresses in the data set.

Events

The ALTAEvents class contains all the event handlers that can be called by ALTADataSet. To use events, you must inherit the class, override its methods and assign its instance to the Events property of an ALTADataSet. ALTAEvents inheritance is not available in VB6/VBA.

Usage Example

{{APIComment|{{APIComment|'***Initialize a New ALTADataSet object***
 Dim ADS As New ALTADataSet("DataSet1")
 
{{APIComment|'***Analysis Settings***
 ADS.AnalysisSettings.ModelType = ALTASolverModel.Arrhenius
 ADS.AnalysisSettings.Distribution = ALTASolverDistribution.Weibull
 ADS.AnalysisSettings.Analysis = ALTASolverMethod.MLE
 ADS.AnalysisSettings.UngroupGroupedData = False
 ADS.AnalysisSettings.SortBeforeCalculations = True
 
{{APIComment|'***General Settings***
 ADS.GeneralSettings.AllowLargeBetaValues = False
 ADS.GeneralSettings.ImplementStressAtTheEndOfTheStep = False
 
{{APIComment|'***Add Stress Definitions***
 ADS.AddStressDefinition("Temperature (K)", , 400)
{{APIComment|'***Add Failure Times***
 ADS.AddFailure(248, 1, 406)
 ADS.AddFailure(164, 1, 416)
 ADS.AddFailure(92, 1, 426)
 
{{APIComment|'***Calculate the data***
 ADS.Calculate()
 
{{APIComment|'***Get the reliability at 300 hours***
 Dim Rel As Double
 Rel = ADS.FittedModel.Reliability(300)