WeibullDataSet.Calculate: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:APIClass|WeibullDataSet Class|WeibullDataSet}}
{{Template:API}}{{Template:APIBreadcrumb|.[[WeibullDataSet Class|WeibullDataSet]]}}
{{Template:WeibullDataSet.Calculate.Cmt}}  


This is equivalent to clicking the '''Calculate''' icon on the standard folio control panel and publishing the results.
 
<onlyinclude>Fits a life distribution to the current data set and creates a [[CModel Class|cModel]] object that represents the fitted model.</onlyinclude>
 
 
'''Remarks''': To specify the distribution, parameter estimation method and other analysis settings, use the <code>AnalysisSettings</code> and <code>GeneralSettings</code> properties of the object. To return the <code>cModel</code> object that is produced, use the <code>FittedModel</code> property of the <code>WeibullDataSet</code> object.


== Syntax  ==
== Syntax  ==
*Calculate()
'''.Calculate


== Usage Example ==


  {{APIComment|'Declare a new WeibullDataSet object. See [[WeibullDataSet Class|WeibullDataSet]].}}
== Example ==
  Dim WDS As New WeibullDataSet("AddFailure_Example")
  '''VBA'''
   
   
{{APIComment|'Declare a new WeibullDataSet object.}}
  {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
 
  {{APIComment|'Add failure times to the data set.}}
  {{APIComment|'Add failure times to the data set.}}
  WDS.AddFailure(100, 1)
  {{APIPrefix|Call}} WDS.AddFailure(100, 1)
  WDS.AddFailure(120, 1)
  {{APIPrefix|Call}} WDS.AddFailure(120, 1)
  WDS.AddFailure(130, 1)   
  {{APIPrefix|Call}} WDS.AddFailure(130, 1)   
 
{{APIComment|'Set the life distribution. Leave all other settings at default.}}
  WDS.AnalysisSettings.Distribution = WeibullSolverDistribution_Weibull
  WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters_MS_2Parameter
    
    
  {{APIComment|'Set the life distribution.}}
  {{APIComment|'Analyze the data set.}}
  WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull
  WDS.Calculate()
  WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter
{{APIComment|'Calculate the reliability at 100 hrs and display the result.}}
  {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
  r = WDS.FittedModel.Reliability(100)
  MsgBox({{APIString|"Reliability at 100 hrs: "}} & r)
 
'''VB.NET'''
{{APIComment|'Declare a new WeibullDataSet object.}}
  {{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet
 
{{APIComment|'Add failure times to the data set.}}
  WDS.AddFailure(100, 1)
  WDS.AddFailure(120, 1)
  WDS.AddFailure(130, 1) 
    
    
  {{APIComment|'Fit the data to the life distribution, using all default analysis settings.}}
  {{APIComment|'Set the life distribution. Leave all other settings at default.}}
  WDS.Calculate()
  WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull
  WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter
    
    
  {{APIComment|'Retrieve the fitted life distribution model. See [[cModel Class|cModel]].}}
  {{APIComment|'Analyze the data set.}}
  Dim model As cModel
  WDS.Calculate()
  model = WDS.FittedModel
 
{{APIComment|'Calculate the reliability at 100 hrs and display the result.}}
  {{APIPrefix|Dim}} r {{APIPrefix|As}} Double
  r = WDS.FittedModel.Reliability(100)
  MsgBox({{APIString|"Reliability at 100 hrs: "}} & r)

Latest revision as of 22:23, 4 May 2017

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.


Remarks: To specify the distribution, parameter estimation method and other analysis settings, use the AnalysisSettings and GeneralSettings properties of the object. To return the cModel object that is produced, use the FittedModel property of the WeibullDataSet object.

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)