cModel.SetUseStress

From ReliaWiki
Revision as of 23:47, 2 October 2015 by Kate Racaza (talk | contribs)
Jump to navigation Jump to search

Template:InProgress

APIWiki.png


Member of: SynthesisAPI9.cModel


For ALTA models only. Specifies the use stress level(s) to use for calculations.

Syntax

.SetUseStress(Index, StressValue)
.SetUseStress(StressValues())

Parameters

Index

Required. Integer. The 0-based index of the stress (e.g., the first stress in the model has an index = 0, the second stress has an index = 1, etc.).

StressValue

Required. Double. The value to use for the use stress level.

StressValues()

Required. Double. An array of the use stress values. The order of the elements in the array correspond to the order of the stresses in the model (e.g., the first element of the array defines the use stress value of the first stress in the model, etc.)


Example

This example assumes that a model with ID #47 exists in the first available project of a repository.

VB.NET

 'Add code to connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  ... 

 
 'Get ALTA model #47 from project #1. 
 Dim AModel As cModel
 MyRepository.Project.SetCurrentProject(1)  
 AModel = MyRepository.Model.GetModel(47)

 'Get the number of stresses in the model. 
 Dim MyNumStresses As Integer
 MyNumStresses = AModel.NumStresses 

 'Assume that the number of stresses in this example is 2. 
 'Set the use stress values for each of the stresses. 
 Dim UseStressArray(MyNumStresses-1) As Double
 UseStressArray(0) = 500
 UseStressArray(1) = 750

 'Set the use stress values for the model.  
 AModel.SetUseStress(UseStressArray)

 'Calculations using the specified stress values are now possible. For example, 
 'the following code returns the model's reliability at 100 hrs 
 'at the specified use stress levels. 
 Dim ResultValue As Double
 ResultValue = AModel.Reliability(100)