ALTADataSet.AddStressDefinition: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|ALTADataSet Class|ALTADataSet}}
{{Template:API}}{{Template:APIBreadcrumb|.[[ALTADataSet_Class|ALTADataSet]]}}


{{Template:ALTADataSet.AddStressDefinition.Cmt}} The number of stress values used in subsequent calls to AddFailure, AddSuspension, etc. must be equal to the number of stress definitions in the data set (e.g., before you can add a failure time obtained with two stresses, you must add two stress definitions).


The same functionality is access via the Add/Remove Columns window in ALTA.
<onlyinclude>Adds a stress definition to the data set.</onlyinclude>


== Syntax ==
<ul>
<li>
AddStressDefinition(
{{APIName|Name}}
{{APIPrefix|As String, Optional}}
{{APIName|StressRelation}}
{{APIPrefix|As [[ALTASolverLSR Enumeration|ALTASolverLSR]]}}
=
{{APIName|ALTASolverLSR.Exponential,}}
{{APIPrefix|Optional}}
{{APIName|UseStress}}
{{APIPrefix|As Double}}
= 1 )
</li>
</ul>


Parameters
==Syntax==
:''Name'': The name of the new stress definition.
'''.AddStressDefinition'''(''Name'', ''StressRelation'', ''UseStress'')


:''StressRelation'': The stress transformation to apply to the new stress, specified using the [[ALTASolverLSR Enumeration|ALTASolverLSR]] enumeration.
===Parameters===
''Name''
:Required. String. The name of the stress.


:''UseStress'': The use stress level.
''StressRelation''
:Optional. The stress transformation that will be applied to the stress. Can be any [[ALTASolverLSR_Enumeration|ALTASolverLSR]] constant. Default value &#61; 0.


== Usage Example ==
''UseStress''
:Optional. Double. The use stress level. Default value &#61; 1.


  {{APIComment|'Declare a new ALTADataSet object. See [[ALTADataSet Class|ALTADataSet]].}}
 
   Dim ALTADS as New ALTADataSet
== Example ==
The following example demonstrates how to add stress definitions to an ALTADataSet object.
 
'''VBA'''
  {{APIComment|'Declare a new ALTADataSet object.}}
  {{APIPrefix|Dim}} ADS {{APIPrefix|As New}} ALTADataSet
 
{{APIComment|'Define 2 stress types with use stress levels &#61; 10 and 25.}}
  {{APIPrefix|Call}} ADS.AddStressDefinition({{APIString|"Stress1",,10}})
  {{APIPrefix|Call}} ADS.AddStressDefinition({{APIString|"Stress2",,25}})
    
{{APIComment|'Add failure times for Stress1 &#61; 190 and Stress2 &#61; 235.}}
  {{APIPrefix|Dim}} Stress(1) {{APIPrefix|As}} Variant
  Stress(0) = 190
  Stress(1) = 235
   
   
  {{APIComment|'Add a new stress type with a use stress level of 10.}}
  {{APIPrefix|Call}} ADS.AddFailure(100, 1, Stress)
  ADS.AddStressDefinition("NewStress1",, 10)
  {{APIPrefix|Call}} ADS.AddFailure(120, 1, Stress)
  {{APIPrefix|Call}} ADS.AddFailure(130, 1, Stress)
  {{APIPrefix|Call}} ADS.AddFailure(140, 1, Stress)
 
'''VB.NET'''
 
  {{APIComment|'Declare a new ALTADataSet object.}}
  {{APIPrefix|Dim}} ADS {{APIPrefix|As New}} ALTADataSet
 
{{APIComment|'Define 2 stress types with use stress levels &#61; 10 and 25.}}
  ADS.AddStressDefinition({{APIString|"Stress1",,10}})
  ADS.AddStressDefinition({{APIString|"Stress2",,25}})
   
   
  {{APIComment|'Add a failure to the data set (time &#61; 5, 1 failure, stress &#61; 20). See [[ALTADataSet.AddFailure|AddFailure]].}}
  {{APIComment|'Add failure times for Stress1 &#61; 190 and Stress2 &#61; 235.}}
  ALTADS.AddFailure(5, 1, 20)
  ADS.AddFailure(100, 1, 190, 235)
  ADS.AddFailure(120, 1, 190, 235)
  ADS.AddFailure(130, 1, 190, 235)

Revision as of 19:06, 15 April 2016

APIWiki.png


Member of: SynthesisAPI.ALTADataSet


Adds a stress definition to the data set.


Syntax

.AddStressDefinition(Name, StressRelation, UseStress)

Parameters

Name

Required. String. The name of the stress.

StressRelation

Optional. The stress transformation that will be applied to the stress. Can be any ALTASolverLSR constant. Default value = 0.

UseStress

Optional. Double. The use stress level. Default value = 1.


Example

The following example demonstrates how to add stress definitions to an ALTADataSet object.

VBA

 'Declare a new ALTADataSet object.  
  Dim ADS As New ALTADataSet
 
 'Define 2 stress types with use stress levels = 10 and 25. 
  Call ADS.AddStressDefinition("Stress1",,10)
  Call ADS.AddStressDefinition("Stress2",,25)
 
 'Add failure times for Stress1 = 190 and Stress2 = 235. 
  Dim Stress(1) As Variant
  Stress(0) = 190
  Stress(1) = 235

  Call ADS.AddFailure(100, 1, Stress)
  Call ADS.AddFailure(120, 1, Stress)
  Call ADS.AddFailure(130, 1, Stress)
  Call ADS.AddFailure(140, 1, Stress)
VB.NET
 
 'Declare a new ALTADataSet object.  
  Dim ADS As New ALTADataSet
 
 'Define 2 stress types with use stress levels = 10 and 25. 
  ADS.AddStressDefinition("Stress1",,10)
  ADS.AddStressDefinition("Stress2",,25)

 'Add failure times for Stress1 = 190 and Stress2 = 235. 
  ADS.AddFailure(100, 1, 190, 235)
  ADS.AddFailure(120, 1, 190, 235)
  ADS.AddFailure(130, 1, 190, 235)