User:Kate Racaza/test page: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
{{Template:API}}{{Template:BacktoPrevPage}}
{{Template:API}}{{Template:BacktoPrevPage}}


If you have [http://www.reliasoft.com/alta/index.htm ALTA PRO], you can use the Synthesis API to analyze a data set with time-dependent stress profiles. In this tutorial, you will learn how to define stress profiles, analyze a data set, and obtain analysis results from the model.
xxx


==Prerequisites==
In this tutorial, you'll use a Windows Form application to create a button that, when clicked, analyzes a Weibull++ data set and displays the resulting plot. Before you begin, be sure to create a Windows Form Application project, and insert a button and a picturebox control to the form. You can rename the button to "Create Plot," if desired.


==Tutorial: Accelerated Life Testing Data Analysis - Stress Profiles ==
Need help with creating Windows Forms? See this [https://msdn.microsoft.com/en-us/library/b201w61t%28v=vs.100%29.aspx Microsoft tutorial].
The following example demonstrates how to define a single stress profile for an ALTA data set and use the analysis results to obtain the B1 life (i.e., time at which reliability is equal to 99%). A discussion of the example follows.  
 
==Tutorial: W++/ALTA Plots ==
The following example demonstrates how to use the Synthesis API to create a plot and display it in a Windows application. A discussion of the example follows.  


The data sets used in this example are:
<div style="width:100%;">
<div style="width:50%; margin: auto;">
<div style="float:left; margin-right:20px;">
{|{{table}}
|+Stress Profile
|Start||End||Stress
|-
|0||200||125
|-
|200||300||175
|-
|300||350||200
|-
|350||375||250
|}
</div>
<div style="float:left;">
{|{{table}}
|+Data Set
|Number in State||State||Time to F or S
|-
|1||F||252
|-
|1||F||280
|-
|1||F||320
|-
|1||S||328
|-
|1||F||335
|-
|1||F||354
|-
|1||F||361
|-
|1||F||362
|-
|1||F||368
|-
|3||S||375
|}
</div>
</div></div>
<div style="clear:both;"></div>
  '''VB.NET'''
  '''VB.NET'''
   
   
Line 60: Line 19:
     {{APIPrefix|Sub}} Main()
     {{APIPrefix|Sub}} Main()
    
    
   {{APIComment|'Declare a new stress profile and define its segments.}}  
   {{APIComment|'Create a Weibull++ data set.}}  
     {{APIPrefix|Dim}} sp {{APIPrefix|As New}} ALTAStressProfile
     {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
     sp.AddSegment(200, 125)  
     WDS.AddFailure(16, 1)
     sp.AddSegment(300, 175)
     WDS.AddFailure(34, 1)
     sp.AddSegment(350, 200)
     WDS.AddFailure(53, 1)
     sp.AddSegment(375, 250)
     WDS.AddFailure(75, 1)
     sp.RepeatCycle = False
     WDS.AddFailure(93, 1)
     WDS.AddSuspension(120, 5)  
  {{APIComment|'Declare a new ALTADataSet object.}}
    {{APIPrefix|Dim}} ADS {{APIPrefix|As New}} ALTADataSet
  {{APIComment|'Assign the stress profile to the data set.}}
     ADS.AddStressProfile(sp)
   
   
   {{APIComment|'The stress profile uses the logarithmic (power LSR) stress transformation}}
   {{APIComment|'Analyze the data set using the 2-parameter Weibull distribution and}}  
  {{APIComment|'and has a use stress level &#61; 100.}}
   {{APIComment|'the RRX analysis method. Keep all other analysis settings at default.}}
    ADS.AddStressDefinition({{APIString|"Stress1"}}, ALTASolverLSR.Power, 100)
     WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull
 
     WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter
  {{APIComment|'Add the failure times to the data set.}}
    WDS.AnalysisSettings.Analysis = WeibullSolverMethod.RRX
    ADS.AddFailure(252, 1, sp)
    ADS.AddFailure(280, 1, sp)
    ADS.AddFailure(320, 1, sp)
    ADS.AddFailure(335, 1, sp)
    ADS.AddFailure(354, 1, sp)
    ADS.AddFailure(361, 1, sp)
    ADS.AddFailure(362, 1, sp)
    ADS.AddFailure(368, 1, sp)
   
  {{APIComment|'Add the suspensions to the data set.}}
    ADS.AddSuspension(328, 1, sp) 
    ADS.AddSuspension(375, 3, sp)
 
   {{APIComment|'Use the cumulative damage - Weibull model to analyze the data set.}}
  {{APIComment|'Keep all other analysis settings at default.}}
     ADS.AnalysisSettings.ModelType = ALTASolverModel.CumDamage
     ADS.AnalysisSettings.Distribution = ALTASolverDistribution.Weibull
    
    
   {{APIComment|'Analyze the data set.}}
   {{APIComment|'Analyze the data set.}}
     ADS.Calculate()
     WDS.Calculate()
   
   
   {{APIComment|'Calculate the B1 life and display the result.}}
   {{APIComment|'Declare a new WAPlots object.}}
     {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
     {{APIPrefix|Dim}} WPlot {{APIPrefix|As New}} WAPlots
    r = ADS.FittedModel.Time(.99)
    MsgBox({{APIString|"B1 Life: "}} & r)
   
   
  {{APIComment|'Add the analyzed data set to the plot.}}
    WPlot.AddDataset(WDS)
{{APIComment|'Create a probability plot and display it in the picturebox.}}
  PictureBox1.Image =WPlot.CreatePlot(WAPlotType.Probability)
  PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
 
     {{APIPrefix|End Sub}}
     {{APIPrefix|End Sub}}
  {{APIPrefix|End Module}}
  {{APIPrefix|End Module}}

Revision as of 22:17, 12 May 2016

DRAFT

APIWiki.png


<< Back to Tutorials Main Page

xxx

Prerequisites

In this tutorial, you'll use a Windows Form application to create a button that, when clicked, analyzes a Weibull++ data set and displays the resulting plot. Before you begin, be sure to create a Windows Form Application project, and insert a button and a picturebox control to the form. You can rename the button to "Create Plot," if desired.

Need help with creating Windows Forms? See this Microsoft tutorial.

Tutorial: W++/ALTA Plots

The following example demonstrates how to use the Synthesis API to create a plot and display it in a Windows application. A discussion of the example follows.

VB.NET

Imports SynthesisAPI 

Module Module1
   Sub Main()
 
  'Create a Weibull++ data set.  
   Dim WDS As New WeibullDataSet
   WDS.AddFailure(16, 1)
   WDS.AddFailure(34, 1)
   WDS.AddFailure(53, 1)  
   WDS.AddFailure(75, 1)
   WDS.AddFailure(93, 1)
   WDS.AddSuspension(120, 5)   

  'Analyze the data set using the 2-parameter Weibull distribution and  
  'the RRX analysis method. Keep all other analysis settings at default. 
   WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull
   WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter
   WDS.AnalysisSettings.Analysis = WeibullSolverMethod.RRX
 
  'Analyze the data set. 
   WDS.Calculate()

  'Declare a new WAPlots object. 
   Dim WPlot As New WAPlots

  'Add the analyzed data set to the plot. 
   WPlot.AddDataset(WDS)

 'Create a probability plot and display it in the picturebox. 
  PictureBox1.Image =WPlot.CreatePlot(WAPlotType.Probability)
  PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize
 
   End Sub
End Module


Discussion

The ALTAStressProfile class represents a time-dependent stress profile. In this example, the stresses are increased in a stepwise fashion. The RepeatCycle property is set to False, indicating that all times after the last segment will use the stress value defined in the last segment.

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

Next, create an ALTA data set by declaring a new ALTADataSet object, and then using the AddStressProfile method to associate the stress profile with the object.

 'Declare a new ALTADataSet object.  
  Dim ADS As New ALTADataSet
 
 'Assign the stress profile to the data set.  
  ADS.AddStressProfile(sp)

Use the AddStressDefinition method to define the name, stress transformation and use stress level of the stress profile.

 'The stress profile uses the logarithmic (power LSR) stress transformation 
 'and has a use stress level = 100.  
  ADS.AddStressDefinition("Stress1", ALTASolverLSR.Power, 100)

The data set can contain failures, suspensions or interval data. The following example shows how to use the AddFailure method and AddSuspension method to add the stress profile to the data points.

 'Add the failure times to the data set. 
  ADS.AddFailure(252, 1, sp)
  ADS.AddFailure(280, 1, sp)
  ADS.AddFailure(320, 1, sp)
  ADS.AddFailure(335, 1, sp)
  ADS.AddFailure(354, 1, sp)
  ADS.AddFailure(361, 1, sp)
  ADS.AddFailure(362, 1, sp)
  ADS.AddFailure(368, 1, sp)
    
 'Add the suspensions to the data set. 
  ADS.AddSuspension(328, 1, sp)   
  ADS.AddSuspension(375, 3, sp) 

The AnalysisSetting property returns an ALTAAnalysisOptions object, which represents the analysis settings of the data set. In the following example, we use the ModelType and Distribution properties of the object to specify the life-stress relationship and distribution.

 '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

Use the Calculate method to analyze the data set. The method returns a message box that shows the estimated parameters of the model, based on the settings specified in the AnalysisSettings property.

 'Analyze the data set. 
  ADS.Calculate()

The FittedModel property gets a cModel object that represents the fitted model of the analysis. From the model, you can calculate useful metrics such as reliability, failure rate, mean time, etc. In this example, we use the cModel.Time method to calculate for the B1 life.

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

Notes

For analyses that require multiple stress profiles, the number of stress definitions must be equal to the number of stress profiles used in the analysis. For example:

 'Define two stress profiles.  
  Dim SP1 As New ALTAStressProfile
  Dim SP2 As New ALTAStressProfile
 ... 

 'Assign the stress profiles to a data set.  
  Dim ADS As New ALTADataSet
  ADS.AddStressProfile(SP1)
  ADS.AddStressProfile(SP2)

 'Define the stress transformations and use stress levels.  
  ADS.AddStressDefinition("Stress1", ALTASolverLSR.Arrhenius, 100)
  ADS.AddStressDefinition("Stress2", ALTASolverLSR.Power, 4)

You can then use the overloaded methods to add the stress profiles to the data points:

 ... 
 'Add failure times. 
  ADS.AddFailure(171, 1, SP1, SP2)
  ADS.AddFailure(174, 1, SP1, SP2)
 ... 

References