5.1.5 Start Point—Pipeline Array (Ageing) Module
The SAPLINGS-ARRAY module is based on the pipeline array (ageing) module, shown at Figure 5-13. Strictly speaking, this module represents a queue rather than a delay. That is, exit from the queue is in exactly the same order as entry.
Input to this module takes the form of the planting of saplings in the first year. These are added to become the stock of saplings where each of the 12 dimensional elements in SAPLINGS-ARRAY represents the current age of saplings. Ageing (in yearly increments) is achieved by the Shift Saplings-Array Ageing rate variable which takes each element of the SAPLINGS-ARRAY and once per year raises it to the next higher increment (to become the next higher dimensional element). The contents of each array element are processed in this way until they reach the highest dimensional increment, when they flow out to enter the stock COUNT SAPLINGS TO SMALL-ARRAY.
Key variables for the module Figure 5-13 are shown in Table 5-10.

Table 5-10. Key Variables Used In First Iteration of SAPLINGS-ARRAY Module at Figure 5-13
Variable | Definition | Comment |
|---|---|---|
Initial Saplings- Array | 0 | Array Dimensions: 1..12 All 12 values, corresponding to each of the years of growing saplings, are set to zero. An alternative way of specifying this array would be: {0,0,0,0,0,0,0,0,0,0,0,0}. |
SAPLINGS-ARRAY | FOR (s = 1..12 | 'Initial Saplings—Array'[s]) | Array Dimensions: 1..12 The initial value of the SAPLINGS-ARRAY is set to {0,0,0,0,0,0,0,0,0,0,0,0}. The (-ARRAY) notation is used to avoid confusion with the original SAPLINGS module, otherwise it is not needed. |
Plantings-Array | 50000*RANDOM (0.85, 1.00, 0.36)*1<<trees/yr>> | Array Dimensions: 1..1 |
Shift Saplings-Array Ageing | 'SAPLINGS-ARRAY'[1..11] /1<<yr>> | Array Dimensions: 1..11 Alternative formulation: FOR (s= 1..11 | IF(ARRSUM('SAPLINGS-ARRAY')>=0<<trees>>,1,0) *('SAPLINGS-ARRAY'[s]/1<<yr>>)) |
Saplings Becoming Small-Array | FOR (s= 12..12 | 'SAPLINGS-ARRAY'[s] /1<<yr>>) | Array Dimensions: 12..12 This function skims off the last array element and moves it to the state variable COUNT SAPLINGS TO SMALL-ARRAY. Later this variable (or one like it) will be used to provide the input to the SMALL TREES-ARRAY module. |
The next step involves taking into account losses which occur through culling of saplings. Note that it is assumed that this culling takes place in the first year only. That is, 25% of all saplings planted are culled during the first year and no further culling takes place. This is done simply for convenience. The array version offers the additional functionality that allows the culling time to be specified. That can be incorporated into future versions if needed.
Culled trees are lost and their number is deducted from that able to be indexed through the ageing process. Only those trees which have not been lost and have aged sufficiently can be transferred to the next class of small trees.
To enable the module to be verified, this instance of the module will be simulated using a time-step of one year. The period of ageing is 12 years. This is shown in Figure 5-14. Key variables, altered or added, for the module Figure 5-14 are shown in Table 5-11.
Note that the sequence of calculation is important. The sequence is:
- Planting.
- Saplings are lost through culling.
- Remaining saplings flow out to be indexed to next year of growth.
- Indexed saplings flow in to the stock of saplings.
- Once remaining saplings have achieved full age they progress to become small trees.

This module is tested to ensure that it is functioning correctly. The best test is to compare it with the SAPLINGS module built earlier, shown in Figure 5-7. Other tests such as mass-balance have been added to check correct functioning. The module at Figure 5-15 is simulated with a time-step of one year. Consequently, the dimension of the SAPLINGS-ARRAY is 1..12. That is, it has 12 distinct elements, one for each year of ageing.
Key variables, altered or added, for the module Figure 5-15 are shown in Table 5-12.
Table 5-11. Key Variables Used In First Iteration of SAPLINGS-ARRAY Module at Figure 5-14
Variable | Definition | Comment |
|---|---|---|
Culling Saplings Array | {0.25,0,0,0,0,0,0,0,0,0,0,0} | Array Dimensions: 1..12 This variable has the function of setting the annual portion of saplings to be culled. 25% of first-year saplings are culled. Saplings are not culled in latter years. |
Losing Saplings-Array | FOR (s = 1..12 | 'SAPLINGS-ARRAY'[s]/1<<yr>>*'Culling Saplings—Array'[s]) | Array Dimensions: 1..12 |
Shift Saplings-Array Ageing | FOR(s=1..11 | IF(ARRSUM('SAPLINGS-ARRAY')>=0<<trees>>,1,0) *('SAPLINGS-ARRAY'[s]-'Losing Saplings-Array'[s] *1<<yr>>)/1<<yr>>) | Array Dimensions: 1..11 |

Table 5-12. Key Variables In SAPLINGS-ARRAY Module With 1-Year Timestep at Figure 5-15
Variable | Definition | Comment |
|---|---|---|
Saplings-Array Actually Culled | 'COUNT SAPLINGS-ARRAY LOST'/'TOTAL PLANTINGS' | Calculates actual number of saplings culled to gauge conformance with planned figure. |
Saplings-Array Delta Checky | ARRSUM('Initial Saplings—Array')+ 'TOTAL PLANTINGS'- 'COUNT SAPLINGS-ARRAY TO SMALL'- ARRSUM('SAPLINGS-ARRAY')- 'COUNT SAPLINGS-ARRAY LOST' | Mass-balance check. |
It is clear that performance of this array version of SAPLINGS module is comparable to that constructed earlier. To provide greater accuracy, the time-step is changed to one quarter of a year. This is shown in Figure 5-16.
Key variables for the module Figure 5-16 are shown in Table 5-13.

Table 5-13. Key Variables in SAPLINGS-ARRAY Module With 1-Qtr Timestep at Figure 5-16
Variable | Definition | Comment |
|---|---|---|
Initial Saplings- Array | 0 | Array Dimensions: 1..48 All 48 values, corresponding to each of the quarter years of growing saplings, are set to zero. |
SAPLINGS-ARRAY | FOR (s = 1..48 |'Initial Saplings-Array'[s]) | Array Dimensions: 1..48 |
Plantings-Array | 50000/4*RANDOM(0.85, 1.00, 0.36)*1<<trees/qtr>> | Array Dimensions: 1..1 |
Losing Saplings-Array | FOR (s = 1..48 | 'SAPLINGS-ARRAY'[s]/1<<qtr>>*'Culling Saplings-Array'[s]) | Array Dimensions: 1..48 |
Shift Saplings-Array Ageing | FOR(s=1..47 | IF(ARRSUM('SAPLINGS-ARRAY')>=0<<trees>>,1,0) *('SAPLINGS-ARRAY'[s]–'Losing Saplings-Array'[s] *1<<qtr>>)/1<<qtr>>) | Array Dimensions: 1..47 |
Saplings Becoming Small-Array | FOR (s= 48..48 | 'SAPLINGS-ARRAY'[s]/1<<qtr>>) | Array Dimensions: 48..48 |
Following the same procedure, each of the remaining array modules can be constructed. Note that the HARVESTABLE TREES module already built can be used with minor modification. That is, the input variable must be made compatible with the existing module. The SMALL TREES-ARRAY module is shown in Figure 5-17.
Key variables for the module Figure 5-17 are shown in Table 5-14.

Table 5-14. Key Variables in SMALL TREES-ARRAY Module—1-Qtr Timestep at Figure 5-17
Variable | Definition | Comment |
|---|---|---|
Initial Small Trees- Array | 0 | Array Dimensions: 1..52 All 52 values, corresponding to each of the 13 years (52 quarters of growing small trees, are set to zero. |
SMALL TREES-ARRAY | FOR (t = 1..52 |'Initial Saplings—Array'[s]) | Array Dimensions: 1..52 |
Small Trees-Array Inflow | REDIM(1..1|'Saplings Becoming Small-Array') | Array Dimensions: 1..1 It is necessary to change the dimensions of the rate-controlling output from SAPLINGS-ARRAY module (having dimensions 48..48, using [s] as the index designator) to a new array having dimensions 1..1, with associated index designator [t] |
Losing Small Trees-Array | FOR (t = 1..52 | 'SMALL TREES-ARRAY'[t]/1<<qtr>> *'Culling Small Trees-Array'[t]) | Array Dimensions: 1..52 |
Shift Small Trees-Array Ageing | FOR(t=1..51 | IF(ARRSUM('SMALL TREES-ARRAY')>0<<trees>>,1,0) | Array Dimensions: 1..51 |
Small-Array Becoming Medium | FOR (t= 52..52 | IF('SMALL TREES-ARRAY'[t]>0<<trees>>, 'SMALL TREES-ARRAY'[t]/1<<qtr>>,0<<trees/qtr>>)) | Array Dimensions: 52..52 |
The MEDIUM TREES-ARRAY module is shown in Figure 5-18. The variables are similar to the SMALL TREES-ARRAY module and should be easily derived. Therefore they are not specified, as has been done previously.
The HARVESTABLE TREES-ARRAY module is shown at Figure 5-19.
The development of an array version was demonstrated. It was seen that the array version is equivalent, though some minor differences can be found. These come from the differences in processing steps needed by Powersim™ Studio to complete the required numerical calculations. For example, insertion of an additional auxiliary to re-dimension an array variable means that one additional step is required to complete calculations. For a given simulation a fewer number of calculation steps is completed. The differences this creates over long simulations have little consequence.


