CModel Class: Difference between revisions
Jump to navigation
Jump to search
Alex Ulanov (talk | contribs) No edit summary |
Alex Ulanov (talk | contribs) No edit summary |
||
Line 14: | Line 14: | ||
'''Model''' | '''Model''' | ||
*Type (as ''[[ModelTypeEnum Enumeration|ModelTypeEnum]]'') {{APIComment|Gets the model type (e.g., 2-parameter Weibull).}} | |||
*Category (as ''[[ModelCategoryEnum Enumeration|ModelCategoryEnum]]'') {{APIComment|Gets the model category (e.g., reliability).}} | |||
*Designation (as ''string'') {{APIComment|Gets a string representing the model type (for example "2P-Weibull").}} | |||
*UnitID (as ''integer'') {{APIComment|Gets or sets the unit ID.}} [[#Notes|*]] | |||
*[[CModel.SetModel|SetModel( ModelTypeEnum, ModelCategoryEnum, Double() )]] {{APIComment|{{Template:CModel.SetModel.Cmt}}}} | *[[CModel.SetModel|SetModel( ModelTypeEnum, ModelCategoryEnum, Double() )]] {{APIComment|{{Template:CModel.SetModel.Cmt}}}} | ||
*[[CModel.Parameters|Parameters]] {{APIComment|{{Template:CModel.Parameters.Cmt}}}} | *[[CModel.Parameters|Parameters]] {{APIComment|{{Template:CModel.Parameters.Cmt}}}} | ||
Line 32: | Line 36: | ||
*[[CModel.ItemKeywords|ItemKeywords(String)]] {{APIComment|{{Template:ItemKeywords.Cmt}}}} | *[[CModel.ItemKeywords|ItemKeywords(String)]] {{APIComment|{{Template:ItemKeywords.Cmt}}}} | ||
''' | '''ALTA Calculations''' | ||
*NumStresses (as ''integer'') {{APIComment|Gets the number of stresses in the model.}} | |||
*[[CModel.SetUseStress|SetUseStress( Integer, Double )]] {{APIComment|{{Template:CModel.SetUseStress1}}}} | *[[CModel.SetUseStress|SetUseStress( Integer, Double )]] {{APIComment|{{Template:CModel.SetUseStress1}}}} | ||
*[[CModel.SetUseStress|SetUseStress( Double() )]] {{APIComment|{{Template:CModel.SetUseStress2}}}} | *[[CModel.SetUseStress|SetUseStress( Double() )]] {{APIComment|{{Template:CModel.SetUseStress2}}}} | ||
Line 39: | Line 44: | ||
'''Standard Calculations''' | '''Standard Calculations''' | ||
*ErrorHappened (as ''boolean'') {{APIComment|Whether or not the last calculation produced an error.}} | |||
*[[CModel.Reliability|Reliability( Double, [Double], [Double] )]] {{APIComment|{{Template:CModel.Reliability.Cmt}}}} | *[[CModel.Reliability|Reliability( Double, [Double], [Double] )]] {{APIComment|{{Template:CModel.Reliability.Cmt}}}} | ||
*[[CModel.Unreliability|Unreliability( Double, [Double], [Double] )]] {{APIComment|{{Template:CModel.Unreliability.Cmt}}}} | *[[CModel.Unreliability|Unreliability( Double, [Double], [Double] )]] {{APIComment|{{Template:CModel.Unreliability.Cmt}}}} | ||
Line 48: | Line 54: | ||
'''Confidence Bound Calculations''' | '''Confidence Bound Calculations''' | ||
*ConfLevel (as ''double'') {{APIComment|Gets the confidence level that is currently used for calculations.}} | |||
*[[CModel.SetConfidenceLevel|SetConfidenceLevel( Double, ConfBoundsSides, Boolean, String )]] {{APIComment|{{CModel.SetConfidenceLevel.Cmt}}}} | *[[CModel.SetConfidenceLevel|SetConfidenceLevel( Double, ConfBoundsSides, Boolean, String )]] {{APIComment|{{CModel.SetConfidenceLevel.Cmt}}}} | ||
*[[CModel.Bounds Reliability|Bounds_Reliability( Double, [Double], [Double] )]] {{APIComment|{{CModel.Bounds Reliability.Cmt}}}} | *[[CModel.Bounds Reliability|Bounds_Reliability( Double, [Double], [Double] )]] {{APIComment|{{CModel.Bounds Reliability.Cmt}}}} | ||
Line 55: | Line 62: | ||
*[[CModel.Bounds FailureRate|Bounds_FailureRate( Double, [Double], [Double] )]] {{APIComment|{{Template:CModel.Bounds FailureRate.Cmt}} }} | *[[CModel.Bounds FailureRate|Bounds_FailureRate( Double, [Double], [Double] )]] {{APIComment|{{Template:CModel.Bounds FailureRate.Cmt}} }} | ||
*[[CModel.Bounds Parameters|Bounds_Parameters]] {{APIComment|{{Template:CModel.Bounds Parameters.Cmt}}}} | *[[CModel.Bounds Parameters|Bounds_Parameters]] {{APIComment|{{Template:CModel.Bounds Parameters.Cmt}}}} | ||
== Usage Example == | == Usage Example == |
Revision as of 19:36, 28 April 2015
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).
To access/edit repository level information, including accessing/adding resources, please see Repository Class.
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 and Properties
Model
- 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").
- UnitID (as integer) Gets or sets the unit ID. *
- 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.
Item
- 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.
- ItemCategoryID(Integer) Gets or sets the category ID. *
- ItemPartNumber(String) Gets or sets the part number. *
- ItemVersion(String) gets or sets the version. *
- ItemSupplier(String) Gets or sets the supplier. *
- ItemApplication(String) Gets or sets the application of the item. *
- ItemDescription(String) Gets or sets the description. *
- ItemComments(String) Gets or sets the comments. *
- ItemKeywords(String) Gets or sets the key words. *
ALTA Calculations
- NumStresses (as integer) Gets the number of stresses in the model.
- 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
- ErrorHappened (as boolean) Whether or not the last calculation produced an error.
- 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
- ConfLevel (as double) Gets the confidence level that is currently used for 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.
Usage Example
'Declare a new WeibullDataSet object. See WeibullDataSet. Dim WDS as New WeibullDataSet 'Add failure times to the data set. See AddFailure. WDS.AddFailure(10, 1) WDS.AddFailure(20, 1) WDS.AddFailure(30, 1) 'Calculate the fitted model using default settings. See Calculate. WDS.Calculate() 'Assign the fitted model to a variable. Dim WDSFittedModel as cModel WDSFittedModel = WDS.FittedModel 'Calculate the reliability at time = 50 and save the result. See Reliability. Dim Rel as Double Rel = WDSFittedModel.Reliability(50)