Here are some examples of how account variables are created and how restrictions can control production and outcome for different goods.


<%EXTOGGLE%>Account variable: Area of old forest

Here you create an account variable for this:

1.Add a new variable named AreaOldForest with the period index Periods (p) and RangeType = non-negative. See accounting variable
2.Type the definition in the syntax window




forall <p> in periods :

sum <i,j> in TreatmentUnits * Alternatives with

    altIncluded[i,j] > 0 and standAge[i,j,p] >= 150 :

        area[i]*x[i,j] == AreaOldForest[p];


prod_tip        Tip – use model parameters instead of “hard core coding”!

Instead of using the number 100 as a requirement for old forest, you can create a parameter which you call, for instance, “minAge” of the type “Constant value”, assign it the value 100, and change 100 in the definition above to “minAge”. This type of parameterization makes it easier if you want to use a certain value in several places, e.g. in a model.


<%EXTOGGLE%>Restriction: Requirements for proportion of old forest

Scenario: You want to add a requirement that at least 10 % of the area must consist of 100-year or older forest in each time period.



You have created an account variable with the name “AreaOldForest” (see above) for the area of forest at least 100 years old.
You have created a formula parameter with the name “SummaAreal” for the sum of the stand areas.



1.Right-click on “Constraints” and select “Add new restriction”.


2.Type a name, e.g. “MinAreaOldForest” and click OK.
3.Select the restriction and type the definition in the syntax window.




forall <p> in periods :


ArealGammalSkog[p] >= 0.1 * SummaAreal;




tog_minusArea for selective cutting

Scenario: You want to analyse the implications of applying selective cutting on at least 10 % of the area and let the optimisation model decide which stands are suitable for this management.


You have run TPG where both selective and clear cut forestry alternatives have been simulated for 30 % of the stands. See steps 1-7 under Selective cutting/Continuous cover forestry (PlanWise).

1.If you haven’t already done so, add a parameter for the control category you have used for a specific management program and a specific stand.
2.Add a variable named “AreaCCF” (possibly with period index p if generation 1 and 2 can be managed with different categories) with the following definition:

sum <i,j> in TreatmentUnits*Alternatives with altIncluded[i,j] == 1 and   trmtCategory[i,j,0] == 2 : area[i]*x[i,j] == AreaCCF ;


Note! From version 2.5 there is a new result variable called ManagementSystem (in result group Treatment) that you can use instead, which would give the formulation below (if the management system for a stand is not allowed to change over time).

sum <i,j> in TreatmentUnits*Alternatives with altIncluded[i,j] == 1 and   mgmtSystem[i,j,0,0] == 1 : area[i]*x[i,j] == AreaCCF ;


Note: We assume that a control category “Selective cutting” has running number 2. The actual number can be found by right-clicking the parameter trmtCategory[i j t] in the model tree. Select Show definition and select the valid TPG-simulation. The number corresponding to the category will then be shown.

Klicka för att förstora

3.Add a restriction named “MinAreaCCF”, for example with the definition.

AreaCCF >= 0.1 * SumArea;

Where SumArea is a formal parameter that sums the total area (see the example of SumArea), and we assume that at most 10 % of this will be managed with continuous cover forestry.





Contact support. © Sveriges Lantbruksuniversitet