CModel Class: Difference between revisions
Jump to navigation
Jump to search
John Leavitt (talk | contribs) |
Chris Kahn (talk | contribs) |
||
Line 50: | Line 50: | ||
== Usage Example == | == Usage Example == | ||
{{APIComment|Declare the WeibullDataSet. See [[WeibullDataSet Constructors]] | {{APIComment|'Declare the WeibullDataSet. See [[WeibullDataSet Constructors]].}} | ||
Dim WDS as New WeibullDataSet | |||
{{APIComment|Add values to the raw data. See [[WeibullDataSet.AddFailure]] | {{APIComment|'Add values to the raw data. See [[WeibullDataSet.AddFailure]].}} | ||
WDS.AddFailure(1, 1) | |||
WDS.AddFailure(2, 1) | |||
WDS.AddFailure(3, 1) | |||
{{APIComment|Calculate the Fitted Model using the raw data.See [[WeibullDataSet.CalculateBestFit]] | {{APIComment|'Calculate the Fitted Model using the raw data.See [[WeibullDataSet.CalculateBestFit]].}} | ||
WDS.CalculateBestFit | |||
{{APIComment|Use the Fitted Model using the raw data. See [[WeibullDataSet.FittedModel]] | {{APIComment|'Use the Fitted Model using the raw data. See [[WeibullDataSet.FittedModel]].}} | ||
Dim WDSFittedModel as cModel | |||
WDSFittedModel = WDS.FittedModel |
Revision as of 19:58, 26 March 2014
The model class allows you to represent probabilities, durations or costs, either fixed or time-dependent. It also contains methods for accessing the calculations performed with the Quick Calculation Pad (QCP).
Constructors
- cModel Creates an empty model. SetModel method must be called to set the model name, type, category and parameters.
- cModel( ModelTypeEnum, ModelCategoryEnum, String, Double() ) Creates a new model using the provided model type, category, name and parameters.
Methods
Set/Return Model Properties
- SetModel( ModelTypeEnum, ModelCategoryEnum, Double() ) Defines an existing cModel object.
- Parameters
- ScaleParameter_A Returns the scale parameter for ALTA models. Returns 0 if the model is not an ALTA model.
Set the Use Stress for ALTA Calculations
- SetUseStress( Integer, Double ) Updates the use stress value for the stress with the specified index.
- SetUseStress( Double() ) Updates the use stress values for all stresses.
Standard Calculations
- Reliability( Double, [Double], [Double] ) Returns the reliability at the specified time.
- Unreliability( Double, [Double], [Double] ) Returns the probability of failure at the specified time.
- Time( Double [Double], [Double] ) Returns the time at which the specified reliability will be achieved.
- MeanTime( [Double], [Double] ) Returns the mean time to failure.
- Pdf( Double [Double], [Double] ) Returns the y-value from the pdf at the specified x-value (time).
- FailureRate( Double [Double], [Double] ) Returns the failure rate at the specified time.
Confidence Bound Calculations
- SetConfidenceLevel( Double, ConfBoundsSides, Boolean, String ) Sets the confidence level for all subsequent confidence bounds calculations. Returns True if successful, otherwise returns False.
- Bounds_Reliability( Double, [Double], [Double] ) Returns the bounds on the reliability given time.
- Bounds_Unreliability( Double, [Double], [Double] ) Returns the bounds on the probability of failure given the specified time.
- Bounds_Time( Double, [Double], [Double] ) Returns the bounds on time given the specified reliability.
- Bounds_MeanTime( [Double], [Double] ) Returns the bounds on the mean time to failure.
- Bounds_FailureRate( Double, [Double], [Double] ) Returns the bounds on the failure rate given the specified time.
- Bounds_Parameters Returns an array containing bounds on all the model parameters.
Properties
- Name (as string) Gets or sets the name of the model.
- ID (as string) Gets the numerical ID of the model.
- ProjectID (as integer) Gets the numerical ID of the project the model belongs to.
- Type (as ModelTypeEnum) Gets the model type (e.g., 2-parameter Weibull).
- Category (as ModelCategoryEnum) Gets the model category (e.g., reliability).
- Designation (as string) Gets a string representing the model type (for example "2P-Weibull").
- ErrorHappened (as boolean) Whether or not the last calculation produced an error.
- ConfLevel (as double) Gets the confidence level that is currently used for calculations.
- NumStresses (as integer) Gets the number of stresses in the model.
Usage Example
'Declare the WeibullDataSet. See WeibullDataSet Constructors. Dim WDS as New WeibullDataSet 'Add values to the raw data. See WeibullDataSet.AddFailure. WDS.AddFailure(1, 1) WDS.AddFailure(2, 1) WDS.AddFailure(3, 1) 'Calculate the Fitted Model using the raw data.See WeibullDataSet.CalculateBestFit. WDS.CalculateBestFit 'Use the Fitted Model using the raw data. See WeibullDataSet.FittedModel. Dim WDSFittedModel as cModel WDSFittedModel = WDS.FittedModel