This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
howtos:feedback:tracking_method_-_minimizing_root_mean_squared_difference_with_5_point_bracketing [2010/12/24 16:07] shona.weldon |
howtos:feedback:tracking_method_-_minimizing_root_mean_squared_difference_with_5_point_bracketing [2013/02/10 17:10] (current) marcus.williams |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Minimizing Root Mean Squared Difference with 5 point bracketing ====== | + | ====== Minimizing Root Mean Squared Difference with 5 point bracketing (bi-section variant) ====== |
A typical calibration problem is to get the model results to track on something while tweaking a variable. The approach described here attempts to minimize the difference over time between the model variable and some given tracking variable. | A typical calibration problem is to get the model results to track on something while tweaking a variable. The approach described here attempts to minimize the difference over time between the model variable and some given tracking variable. | ||
Line 67: | Line 67: | ||
if ($fbViewIteration == 1) | if ($fbViewIteration == 1) | ||
+ | |||
+ | ! ** NOTE: If there is more than one upper dimension the following block of code must be adjusted accordingly *** | ||
+ | |||
! Setup shapes and initialize keep variables | ! Setup shapes and initialize keep variables | ||
!set up the mesh points | !set up the mesh points | ||
Line 78: | Line 81: | ||
! ** BEGIN USER MUST ADJUST HERE ** | ! ** BEGIN USER MUST ADJUST HERE ** | ||
+ | ! The [1] object indices assume calibration; for simulation views increment accordingly | ||
x_min[upperDim,auxDims] = copyshape (unitTA[cr][1]) | x_min[upperDim,auxDims] = copyshape (unitTA[cr][1]) | ||
x_min[upperDim,auxDims] = 0.000001 | x_min[upperDim,auxDims] = 0.000001 | ||
Line 142: | Line 146: | ||
integer $numEvalsCompleted | integer $numEvalsCompleted | ||
getobjinfo (numEvalsCompleted[], $numEvalsCompleted; info=dataElement) | getobjinfo (numEvalsCompleted[], $numEvalsCompleted; info=dataElement) | ||
- | say (" number of evaluations completed ",$fbViewIteration ) | + | say (" number of evaluations completed ",$numEvalsCompleted) |
if ($numEvalsCompleted > 1) | if ($numEvalsCompleted > 1) | ||
! Can look at last evaluations results compared to this one then store this one for future comparisons | ! Can look at last evaluations results compared to this one then store this one for future comparisons | ||
Line 150: | Line 154: | ||
!check for stoping | !check for stoping | ||
- | local numberNotConverged[] = sum (boolgt (abs (2 * currentMeshStep[upperDim,auxDims] / currentBestGuess[upperDim,auxDims]), tolerance[])) | + | local numberNotConverged[] = sum (boolgt (abs (2 * currentMeshStep[upperDim,auxDims] / currentBestGuess[upperDim,auxDims]), \ |
+ | tolerance[]); dim=all) | ||
integer $numberNotConverged | integer $numberNotConverged | ||
getobjinfo (numberNotConverged[], $numberNotConverged; info=dataElement, default=1) | getobjinfo (numberNotConverged[], $numberNotConverged; info=dataElement, default=1) |