WeibullDataSet.Calculate: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:
  {{APIComment|'Analyze the data set.}}
  {{APIComment|'Analyze the data set.}}
   WDS.Calculate()
   WDS.Calculate()
 
{{APIComment|'Retrieve the fitted life distribution model.}}
  {{APIPrefix|Dim}} model {{APIPrefix|As}} cModel
  {{APIPrefix|Set}} model = WDS.FittedModel
   
   
  {{APIComment|'Using the model, calculate the reliability at 100 hrs and display the result.}}
  {{APIComment|'Calculate the reliability at 100 hrs and display the result.}}
   {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
   {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
   r = model.reliability(100)
   r = WDS.FittedModel.Reliability(100)
   MsgBox({{APIString|"Reliability at 100 hrs: "}} & r)
   MsgBox({{APIString|"Reliability at 100 hrs: "}} & r)


Line 56: Line 52:
   WDS.Calculate()
   WDS.Calculate()
    
    
  {{APIComment|'Retrieve the fitted life distribution model.}}
  {{APIComment|'Calculate the reliability at 100 hrs and display the result.}}
  {{APIPrefix|Dim}} model {{APIPrefix|As}} cModel
  model = WDS.FittedModel
{{APIComment|'Using the model, calculate the reliability at 100 hrs and display the result.}}
   {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
   {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
   r = model.reliability(100)
   r = WDS.FittedModel.Reliability(100)
   MsgBox({{APIString|"Reliability at 100 hrs: "}} & r)
   MsgBox({{APIString|"Reliability at 100 hrs: "}} & r)

Revision as of 22:17, 17 June 2016

APIWiki.png


Member of: SynthesisAPI.WeibullDataSet


Fits a life distribution to the current data set and creates a cModel object that represents the fitted model. Returns a message box that shows the estimated parameters of the fitted model.

To specify the life distribution, parameter estimation method and other analysis settings, use the AnalysisSettings and GeneralSettings properties of the associated WeibullDataSet object.

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

Syntax

.Calculate


Example

VBA

 'Declare a new WeibullDataSet object.  
  Dim WDS As New WeibullDataSet
  
 'Add failure times to the data set. 
  Call WDS.AddFailure(100, 1)
  Call WDS.AddFailure(120, 1)
  Call WDS.AddFailure(130, 1)  
 
 'Set the life distribution. Leave all other settings at default. 
  WDS.AnalysisSettings.Distribution = WeibullSolverDistribution_Weibull
  WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters_MS_2Parameter
 
 'Analyze the data set. 
  WDS.Calculate()

 'Calculate the reliability at 100 hrs and display the result. 
  Dim r As Double
  r = WDS.FittedModel.Reliability(100)
  MsgBox("Reliability at 100 hrs: " & r)
VB.NET

 'Declare a new WeibullDataSet object.  
  Dim WDS As New WeibullDataSet
  
 'Add failure times to the data set. 
  WDS.AddFailure(100, 1)
  WDS.AddFailure(120, 1)
  WDS.AddFailure(130, 1)  
 
 'Set the life distribution. Leave all other settings at default. 
  WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull
  WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter
 
 'Analyze the data set. 
  WDS.Calculate()
  
 'Calculate the reliability at 100 hrs and display the result. 
  Dim r As Double
  r = WDS.FittedModel.Reliability(100)
  MsgBox("Reliability at 100 hrs: " & r)