|
Printer Friendly |
Structuring yield calculations to optimize performance
It is common practice to create new yield tables in models by factoring or performing arithmetic on user-input yield tables. For example, you might calculate product yields by factoring total yields, or you might calculate yields for different species by strata by factoring their total yields. This creates additional work for the Woodstock compiler since it must calculate new yield tables in addition to scanning the user input tables, but it is very convenient.
But, how you declare the yield factors and the yield arithmetic can have a significant impact on model run times, in particular matrix build times. This is particularly relevant for large, complex models. The purpose of this tech tip is to describe the best practice for performing yield arithmetic.
You can declare constants or factors used in yield calculations as time-dependent or age-dependent yields since they do not change. That said it is quite common to declare the factors as time-dependent since you can use them directly in output calculations.
However, if you wish to factor age-dependent yields using the constant, declaring it as a time-dependent yield means that you can no longer use the _MULTIPLY function to perform the factoring (because you can’t mix yield types in the system-provided math functions). This means that you must perform the factoring using standard arithmetic, which is very inefficient with respect to propagation of yield tables and memory usage.
So the best practice is to align the factor yield type with the yield table that you are factoring and use the system-provided math functions to perform the arithmetic. That is, if you wish to scale or factor age-dependent yields, declare the factors are age-dependent yields.
This may seem like a trivial thing, but for large models it can have a drastic impact on matrix build times. As an example, a model that used standard arithmetic to multiply age-dependent yields by time-dependent constants that had over 100,000 defined development types produced more than one million yield tables. It was taking in excess of two days to build the matrix (the creation of new development types was also a factor in the lengthy build time). After changing the constants to age-dependent yields and utilizing the _MULTIPLY function instead of standard arithmetic, the number of yield tables was reduced by an order of magnitude, and the matrix was built in hours instead of days.
|
|
Stora Enso Predicts a 2.5% Savings
“We asked, ‘If we had made the decision and optimized the problems, how much money would we have saved?’” The answer was approximately 2.5 percent.”
- Continue reading...
- View all case studies...
|
 |
|
|
|