Accelerated Life Testing Analysis in Microsoft Excel - Explanation: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
The functions in this example and the code structure are very similar to the [[Life Data Analysis in Microsoft Excel - Explanation|Weibull++ example]]. After reviewing the Weibull++ example, note the following differences.
The functions in this example and the code structure are very similar to the [[Life Data Analysis in Microsoft Excel - Explanation|Weibull++ example]]. After reviewing the Weibull++ example, note the following differences.


*Inside the CalculateALTA function, a "Use Stress" value is specified before running calculations. This is done by calling the ALTADataSet object's AddStressDefinition and passing a name of the stress and the value.  Note that we are checking that the stress value is greater than 0 to provide a useful error message if it is not.
<ul>
 
<li>Inside the CalculateALTA function, a "Use Stress" value is specified before running calculations. This is done by calling the ALTADataSet object's AddStressDefinition and passing a name of the stress and the value.  Note that we are checking that the stress value is greater than 0 to provide a useful error message if it is not.
</li>
<div style="margin-right: 150px;">
<div style="margin-right: 150px;">
  {{APIComment|'Set the Use Stress value}}
  {{APIComment|'Set the Use Stress value}}
Line 19: Line 20:
</div>
</div>


*When loading the failure data from the spreadsheet, the ALTADataSet object's AddFailure subroutine includes a third parameter to pass the stress values for the failure.  Note that although our sheet has only one stress column, you could add additional stress columns which is why the stress value is passed inside an array.
<li>When loading the failure data from the spreadsheet, the ALTADataSet object's AddFailure subroutine includes a third parameter to pass the stress values for the failure.  Note that although our sheet has only one stress column, you could add additional stress columns which is why the stress value is passed inside an array.
 
</li>
  {{APIComment|'Read the Grouped Time to Failures data into the ALTADataSet}}
  {{APIComment|'Read the Grouped Time to Failures data into the ALTADataSet}}
   Dim i As Integer
   Dim i As Integer
Line 29: Line 30:
                               CLng(ActiveSheet.Cells(i, 2).Value), StressArray)
                               CLng(ActiveSheet.Cells(i, 2).Value), StressArray)
     Next
     Next
</ul>

Revision as of 16:14, 12 March 2014


This article explains some of the API calls in the Accelerated Life Testing Analysis in Microsoft Excel example file. For more examples, please see the Example section of the API Reference.

The functions in this example and the code structure are very similar to the Weibull++ example. After reviewing the Weibull++ example, note the following differences.

  • Inside the CalculateALTA function, a "Use Stress" value is specified before running calculations. This is done by calling the ALTADataSet object's AddStressDefinition and passing a name of the stress and the value. Note that we are checking that the stress value is greater than 0 to provide a useful error message if it is not.
  •  'Set the Use Stress value 
     Dim useStress As Double
     useStress = ActiveSheet.Range("F3")
     If useStress <= 0 Then
         'If the use stress value is invalid, then don't continue calculating 
         MsgBox "Enter a use stress. The use stress value must be greater than 0.", vbInformation
         Call ClearResults
         Exit Sub
     End If
     Call mALTADataSet.AddStressDefinition(ActiveSheet.Range("C2"), , useStress)
    
  • When loading the failure data from the spreadsheet, the ALTADataSet object's AddFailure subroutine includes a third parameter to pass the stress values for the failure. Note that although our sheet has only one stress column, you could add additional stress columns which is why the stress value is passed inside an array.
  • 'Read the Grouped Time to Failures data into the ALTADataSet Dim i As Integer Dim StressArray(0) As Variant For i = 3 To ActiveSheet.Cells(ActiveSheet.Rows.count, 1).End(xlUp).Row - 1 StressArray(0) = ActiveSheet.Cells(i, 3).Value Call mALTADataSet.AddFailure(Val(ActiveSheet.Cells(i, 1).Value), _ CLng(ActiveSheet.Cells(i, 2).Value), StressArray) Next