ALTADataSet.Calculate: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|ALTADataSet Class|ALTADataSet}}
{{Template:API}}{{Template:APIBreadcrumb|.[[ALTADataSet_Class|ALTADataSet]]}}
{{Template:ALTADataSet.Calculate.Cmt}}
 
 
<noinclude>Returns a message box that shows the estimated parameters of the model (i.e., distribution and life-stress relationship), based on the settings specified in the <code>AnalysisSettings</code> property of the ALTADataSet object. In addition, it creates a retrievable [[CModel Class|cModel]] object that represents the fitted model from the accelerated life testing data analysis.
 
If no data set has been defined, the API prompts the user to enter the parameters for the specified distribution. </noinclude>


== Syntax ==
== Syntax ==


*Calculate()
.Calculate()
 


== Usage Example ==
== Example ==


  {{APIComment|'Declare a new ALTADataSet object. See [[ALTADataSet Class|ALTADataSet]].}}
'''VBA'''
  Dim ADS As New ALTADataSet("AddFailure_Example")
  {{APIComment|'Declare a new ALTADataSet object.}}
  {{APIPrefix|Dim}} ADS {{APIPrefix|As New}} ALTADataSet
    
    
  {{APIComment|'Define a new stress. See [[ALTADataSet.AddStressDefinition|AddStressDefinition]].}}
  {{APIComment|'Define a stress type with use stress level &#61; 25.}}
  ADS.AddStressDefinition("Stress1")
  {{APIPrefix|Call}} ADS.AddStressDefinition({{APIString|"Stress1"}},,300)
{{APIComment|'Add failure times for Stress1 &#61; 190.}}
  {{APIPrefix|Dim}} Stress(0) {{APIPrefix|As}} Variant
  Stress(0) = 190
  {{APIPrefix|Call}} ADS.AddFailure(100, 1, Stress)
  {{APIPrefix|Call}} ADS.AddFailure(120, 1, Stress)
  Stress(0) = 235
  {{APIPrefix|Call}} ADS.AddFailure(130, 1, Stress)
  {{APIPrefix|Call}} ADS.AddFailure(140, 1, Stress)
   
   
  {{APIComment|'Add failure times to the data set.}}
  {{APIComment|'Fit the data to a model, using all default analysis settings.}}
  ADS.AddFailure(100, 1, 190)
  {{APIPrefix|Call}} ADS.Calculate()
  ADS.AddFailure(120, 1, 190)
 
  ADS.AddFailure(130, 1, 190)
{{APIComment|'Retrieve the fitted model.}}
  ADS.AddFailure(140, 1, 190)
  {{APIPrefix|Dim}} model {{APIPrefix|As}} cModel
  ADS.AddFailure(130, 1, 274)
  {{APIPrefix|Set}} model = ADS.FittedModel
  ADS.AddFailure(150, 1, 274)
  ADS.AddFailure(70, 1, 438)
{{APIComment|'Using the model, calculate the reliability at 100 hrs and display the result.}}
  ADS.AddFailure(80, 1, 438)
  {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
  ADS.AddFailure(85, 1, 438)
  r = model.reliability(100)
  ADS.AddFailure(90, 1, 438)
  MsgBox({{APIString|"Reliability at 100 hrs: "}} & r)
 
'''VB.NET'''
{{APIComment|'Declare a new ALTADataSet object.}}
  {{APIPrefix|Dim}} ADS {{APIPrefix|As New}} ALTADataSet
    
    
{{APIComment|'Define a stress type with use stress level &#61; 25.}}
  ADS.AddStressDefinition({{APIString|"Stress1"}},,300)
{{APIComment|'Add failure times for Stress1 &#61; 190.}}
  ADS.AddFailure(100, 1, 190)
  ADS.AddFailure(120, 1, 190)
  ADS.AddFailure(130, 1, 235)
  ADS.AddFailure(140, 1, 235)
  {{APIComment|'Fit the data to a model, using all default analysis settings.}}
  {{APIComment|'Fit the data to a model, using all default analysis settings.}}
  ADS.Calculate()
  ADS.Calculate()
 
 
  {{APIComment|'Retrieve the fitted model. See [[cModel Class|cModel]].}}
  {{APIComment|'Retrieve the fitted model.}}
  Dim model As cModel
  {{APIPrefix|Dim}} model {{APIPrefix|As}} cModel
  model = ADS.FittedModel
  model = ADS.FittedModel
{{APIComment|'Using the model, calculate the reliability at 100 hrs and display the result.}}
  {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
  r = model.reliability(100)
  MsgBox({{APIString|"Reliability at 100 hrs: "}} & r)

Revision as of 17:24, 19 April 2016

APIWiki.png


Member of: SynthesisAPI.ALTADataSet


Returns a message box that shows the estimated parameters of the model (i.e., distribution and life-stress relationship), based on the settings specified in the AnalysisSettings property of the ALTADataSet object. In addition, it creates a retrievable cModel object that represents the fitted model from the accelerated life testing data analysis.

If no data set has been defined, the API prompts the user to enter the parameters for the specified distribution.

Syntax

.Calculate()


Example

VBA

 'Declare a new ALTADataSet object. 
  Dim ADS As New ALTADataSet
 
 'Define a stress type with use stress level = 25. 
  Call ADS.AddStressDefinition("Stress1",,300)

 'Add failure times for Stress1 = 190. 
  Dim Stress(0) As Variant
  Stress(0) = 190
  Call ADS.AddFailure(100, 1, Stress)
  Call ADS.AddFailure(120, 1, Stress)

  Stress(0) = 235
  Call ADS.AddFailure(130, 1, Stress)
  Call ADS.AddFailure(140, 1, Stress)

 'Fit the data to a model, using all default analysis settings. 
  Call ADS.Calculate()
  
 'Retrieve the fitted model. 
  Dim model As cModel
  Set model = ADS.FittedModel

 'Using the model, calculate the reliability at 100 hrs and display the result. 
  Dim r As Double
  r = model.reliability(100)
  MsgBox("Reliability at 100 hrs: " & r)
VB.NET

 'Declare a new ALTADataSet object. 
  Dim ADS As New ALTADataSet
 
 'Define a stress type with use stress level = 25. 
  ADS.AddStressDefinition("Stress1",,300)

 'Add failure times for Stress1 = 190. 
  ADS.AddFailure(100, 1, 190)
  ADS.AddFailure(120, 1, 190)
  ADS.AddFailure(130, 1, 235)
  ADS.AddFailure(140, 1, 235)

 'Fit the data to a model, using all default analysis settings. 
  ADS.Calculate()
  
 'Retrieve the fitted model. 
  Dim model As cModel
  model = ADS.FittedModel

 'Using the model, calculate the reliability at 100 hrs and display the result. 
  Dim r As Double
  r = model.reliability(100)
  MsgBox("Reliability at 100 hrs: " & r)