Description This subroutine executes FRED's Sensitivity Analysis for the currently active optimization variables and populates the columns of an array with the nominal value, and the minimum and maximum value ranges for each variable. There is one row in the array for each variable.
Syntax MzrSensitivity theshString, threshVal, funcString, results()
Parameters threshString As String String indicating whether the threshold value for the sensitivity function is provided as an explicit value or as a percentage above the nominal value. Options are: "value" "percent"
threshVal As Double Value specifying the threshold cutoff for the sensitivity function.
funcString As String String indicating whether the sensitivity function is calculated as the value of the merit function or as the square root of the merit function. Options are: "root" or "sqr" "value"
results() As Double A 2D array with three columns and one row for each variable. If the array has N rows, then the maximum index in the array is "results(2,N-1)"
Example The example below performs a sensitivity analysis with an explicit threshold value of 1.0 and using the raw merit function value (rather than the square root) as the sensitivity function. After the sensitivity analysis has been performed, the contents of the results() array are printed to the output window.
Sub Main
ClearOutputWindow
Dim threshString As String, funcString As String Dim threshVal As Double, results() As Double
threshString = "value" threshVal = 1 funcString = "value"
MzrSensitivity( threshString, threshVal, funcString, results() )
Print "" Print "Results Array: " Print "Var" & Chr(9) & "Nom. Val." & Chr(9) & "Lower Lim." & Chr(9) & "Upper Lim."
Dim col As Long, row As Long Dim curCol As Long, curRow As Long col = UBound(results,1) row = UBound(results,2) For curCol = 0 To col Print curCol; For curRow = 0 To row Print results(curCol, curRow); Next curRow Print "" Next curCol
End Sub
See Also
|