CModel.Bounds MeanTime: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:cModel.Bounds MeanTime}}{{Template:API}}{{Template:APIBreadcrumb|9|.[[CModel Class|cModel]]}}
{{DISPLAYTITLE:cModel.Bounds MeanTime}}{{Template:API}}{{Template:APIBreadcrumb|.[[CModel Class|cModel]]}}




<onlyinclude>Calculates the bounds on the mean time to failure. Returns a '''[[BoundsValues Class|BoundsValues]]''' object array that contains the result(s).</onlyinclude>
<onlyinclude>Calculates the bounds on the mean time to failure for an associated cModel object. Returns a '''[[BoundsValues Class|BoundsValues]]''' object that represents the confidence bounds.</onlyinclude>


You must first use the [[CModel.SetConfidenceLevel|SetConfidenceLevel]] method to specify the confidence bound settings, and then use this method to perform the calculations.
 
{{Template:API_BoundsNote}}


== Syntax==
== Syntax==
Line 11: Line 12:
===Parameters===
===Parameters===
''CurrentAge''
''CurrentAge''
:Double. The current age. Default value = 0. (Optional)
:Optional. Double. The current age. Default value = 0.


''DutyCycle''
''DutyCycle''
:Double. The duty cycle. Default value = 1. (Optional)
:Optional. Double. The duty cycle. Default value = 1.




== Example ==
== Example ==
This example assumes that a published model with ID #47 exists in the repository.
  '''VBA'''
  '''VBA'''
   
   
  {{APIComment|...}}
  {{APIComment|...}}
   
   
  {{APIComment|'Add code to get an existing model or create a new one.}}
  {{APIComment|'Get model ID #47 from project ID #1 in the repository.}}
  {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
  {{APIPrefix|Dim}} AModel {{APIPrefix|As}} cModel
  {{APIComment|...}}
  MyRepository.Project.SetCurrentProject(1)  
  {{APIPrefix|Set}} AModel = MyRepository.Model.GetModel(47)
    
    
  {{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  {{APIPrefix|Call}} AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)
  {{APIPrefix|Call}} AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)
   
   
  {{APIComment|'Calculate the bounds on the model's mean time to failure.}}
  {{APIComment|'Calculate the bounds on the model's mean time to failure.}}
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  {{APIPrefix|Set}} ResultValue = AModel.Bounds_MeanTime()
  {{APIPrefix|Set}} ResultValue = AModel.Bounds_MeanTime
   
   
  {{APIComment|'Output sample: Display the results for the upper and lower confidence bounds.}}
  {{APIComment|'Output sample: Display the results for the upper and lower confidence bounds.}}
  MsgBox ({{APIString|" Upper bound: "}} & ResultValue.Upper & {{APIString|", Lower bound: "}} & ResultValue.Lower)
  MsgBox ({{APIString|" Upper bound: "}} & ResultValue.Upper & {{APIString|", Lower bound: "}} & ResultValue.Lower)


  '''VB.NET'''
  '''VB.NET'''
Line 41: Line 45:
  {{APIComment|...}}
  {{APIComment|...}}
   
   
  {{APIComment|'Add code to get an existing model or create a new one.}}
  {{APIComment|'Get model ID #47 from project ID #1 in the repository.}}
  {{APIPrefix|Dim}} AModel {{APIPrefix|As New}} cModel
  {{APIPrefix|Dim}} AModel {{APIPrefix|As}} cModel
  {{APIComment|...}}
  MyRepository.Project.SetCurrentProject(1)  
  AModel = MyRepository.Model.GetModel(47)
    
    
  {{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIComment|'Set the confidence level to 90% two-sided bounds.}}
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  {{APIPrefix|Dim}} ErrorMsg {{APIPrefix|As}} String
  AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)
  AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)
   
   
  {{APIComment|'Calculate the bounds on the model's mean time to failure.}}
  {{APIComment|'Calculate the bounds on the model's mean time to failure.}}
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  {{APIPrefix|Dim}} ResultValue {{APIPrefix|As}} BoundsValues
  ResultValue = AModel.Bounds_MeanTime()
  ResultValue = AModel.Bounds_MeanTime
   
   
  {{APIComment|'Output sample: Display the results for the upper and lower confidence bounds.}}
  {{APIComment|'Output sample: Display the results for the upper and lower confidence bounds.}}
  MsgBox ({{APIString|" Upper bound: "}} & ResultValue.Upper & {{APIString|", Lower bound: "}} & ResultValue.Lower)
  MsgBox ({{APIString|" Upper bound: "}} & ResultValue.Upper & {{APIString|", Lower bound: "}} & ResultValue.Lower)

Latest revision as of 19:01, 18 August 2016

APIWiki.png


Member of: SynthesisAPI.cModel


Calculates the bounds on the mean time to failure for an associated cModel object. Returns a BoundsValues object that represents the confidence bounds.


Remarks: Use the SetConfidenceLevel method to specify the confidence bound settings, and then use this method to perform the calculations. This method applies to published models only. Returns nothing if the calculation is performed on a non-published model.

Syntax

.Bounds_MeanTime( CurrentAge, DutyCycle) 

Parameters

CurrentAge

Optional. Double. The current age. Default value = 0.

DutyCycle

Optional. Double. The duty cycle. Default value = 1.


Example

This example assumes that a published model with ID #47 exists in the repository.

VBA

 ... 

 'Get model ID #47 from project ID #1 in the repository. 
  Dim AModel As cModel
  MyRepository.Project.SetCurrentProject(1)  
  Set AModel = MyRepository.Model.GetModel(47)
 
 'Set the confidence level to 90% two-sided bounds. 
  Dim ErrorMsg As String
  Call AModel.SetConfidenceLevel(0.9, ConfBoundsSides_TwoSidedBoth, False, ErrorMsg)

 'Calculate the bounds on the model's mean time to failure. 
  Dim ResultValue As BoundsValues
  Set ResultValue = AModel.Bounds_MeanTime

 'Output sample: Display the results for the upper and lower confidence bounds. 
  MsgBox (" Upper bound: " & ResultValue.Upper & ", Lower bound: " & ResultValue.Lower)
VB.NET

 ... 

 'Get model ID #47 from project ID #1 in the repository. 
  Dim AModel As cModel
  MyRepository.Project.SetCurrentProject(1)  
  AModel = MyRepository.Model.GetModel(47)
 
 'Set the confidence level to 90% two-sided bounds. 
  Dim ErrorMsg As String
  AModel.SetConfidenceLevel(0.9, ConfBoundsSides.TwoSidedBoth, False, ErrorMsg)

 'Calculate the bounds on the model's mean time to failure. 
  Dim ResultValue As BoundsValues
  ResultValue = AModel.Bounds_MeanTime

 'Output sample: Display the results for the upper and lower confidence bounds. 
  MsgBox (" Upper bound: " & ResultValue.Upper & ", Lower bound: " & ResultValue.Lower)