Demo Iteration Project: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
 
(77 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{technical|type=section}}
{{demo project summary
{{demo project summary
| title=Demo Iteration
| title=Demo Iteration
| demographic=hydrologists and other water experts
| demographic=hydrologists and other water experts
| showcases=the rainfall overlay in a iteration mode
| showcases=the rainfall overlay in a iteration mode
| image=demo_water_overview.jpg
| image=Demo_iteration.jpg
| description=The demo show the [[Simulation Core|iteration]] functionality that can be used to adjust the ground infiltration speed using a combo formula.
| description=The demo showcases the [[Simulation Core|iteration]] functionality for adjusting ground infiltration speed via a combo formula.
}}
}}


==Calculations using the Iteration option==
==Calculations using the Iteration option==
The implementations demonstrated here strike a balance between leveraging the {{software}}'s effective means of calculation and the flexibility and verisimilitude of the results. As such, they serve as a powerful springboard for creating ones own accepted means of calculation.
The demo project simulates a Dutch polder to demonstrate how rainfall infiltration can be modeled using the [[Simulation Core|iteration]] option.  
 
==Using the Rainfall overlay for calculating the groundwater infiltration speed ==
Set up
Rain event. Duration of the Rain event. De volledige tijdsduur wordt opgegeven.
Watersystem - Advanced: Select Ggrid Overaly to set initial water level and also flow UV
Groundwater - Advanced: Select a Grid Ovelay as Groundwater Level (datum
Unsaturaed Zone
 
Output Overlays
Deze output is nodig.  
Surface Last Value
Rain
Ground Last Value
Ground Watertable
Ground Last Unsaturated Storage
Ground Last Unsaturated Fraction
Surface Last U
Surface Last V
 
Timeframes


De uitkomsten van elke iteratiestap worden door de volgende combo-overlay's gebruikt om de data weer klaar te zetten voor de volgende stap. Dit is bedoeld om de volgende iteratiestap te rekenen met de juiste inputdata. We lopen de verschillende combo-overlay's door:
We want the speed at which rainwater infiltrates to depend on the degree of saturation of the soil. Dividing the rain event into multiple iteration steps allows the infiltration rate to be adjusted based on soil saturation, increasing calculation accuracy.


Combo Surface U en Combo Surface V. In de formula van deze combooverlay is te zien dat de formule er op gericht is om er voor te zorgen dat hij rekent met de data uit de vorige tijdstap. Echter, indien de vorige iteratiestap stap 0 was, dan kan gerekend worden met 0.  
The purpose of this demo project is to clarify how an iterative calculation can be made. In this case, the infiltration of water during and after a precipitation event was chosen. This demo project can also serve as a basis for performing other iterative calculations.
IF(EQ(ITERATION, 0), 0, A)


Combo Fraction
==Setup of the Demo Project==
Combo Surface
The demo project consists of a number of components that are essential for this calculation.
Combo Grondwaterdiepte
*[[Combo Overlay]]
*[[Rainfall Overlay]]
*[[Iteration Overlay|Iteration Collector]]
*[[Indicator]]
*[[Simulation Core|Number of Simulation Iterations]]


Combo Infil Speed
==Combo Overlays==
Before we create the Rainfall event, a number of overlays are created that serve as input for the various iteration steps. At the end of each iteration the combo overlay is updated an serves as the input for the next iteration step. We'll go through the different combo overlays.


===Combo Surface U and Combo Surface V===
These overlays define the initial surface water velocity in the X and Y directions. For water flowing down a slope, the final velocity of one iteration step becomes the initial velocity for the next. The input grid is the result of the last calculation. The formula ensures calculations use data from the previous time step, except for step 0, where a value of 0 is used.


Iteration Collector
Make sure to check the box "previous" to make sure the [[Combo Overlay]] uses the U and V of the previous iteration step.<br>
Dit laat de resultaten zien van elke iteratiestap. Wanneer je de modulus niet op 1 (defealt) zet, maar bijvoorbeeld op 2
The formula in the combo overlay should in this case read: <code>IF(EQ(ITERATION, 0), 0, A)</code>
Overlays - Grid calculations - Iteration Collector
Iteration Input Overlay -> Rain event


===Combo Fraction and Combo Groundwater Depth===
Combo Fraction and Combo Groundwater Depth use input from the previous iteration step, unless it is step 0. In that case, a [[Global]] value is used. The [[Global]] DEFAULT_FRACTION is used for the saturation percentage, and the global DEFAULT_TABLE is used for the groundwater level.


<br> The formula in the combo overlay Combo Fraction should in this case read:
<code> IF(EQ(ITERATION, 0), GLOBAL_DEFAULT_FRACTION, IF(EQ(A, NO_DATA), GLOBAL_DEFAULT_FRACTION, A))</code>
<br> The formula in the combo overlay Combo Groundwater Depth should in this case read:
<code>IF(EQ(ITERATION, 0), GLOBAL_DEFAULT_TABLE, A)</code>


Partial_Start_SEC
===Combo Surface===
Partial_End_SEC
The combo Surface gives the last value of the waterlevel on the surface and is input for the next iteration step. If there is no previous iteration step, the value should be 0. Make sure to check the box "previous" to make sure the [[Combo Overlay]] uses the values of the previous itertationstep.


Indicator
<br> The formula in the combo overlay Combo Fraction should in this case read:
UPDATE_OVERLAY_PARTIAL_END_SEC_WHERE_OVERLAY_IS_10 
<code>IF(EQ(ITERATION, 0), 0, A)</code>


Hiermee stel je de start en de eindtijd van de gedeeltelijke doorrekening van de regenwateroverlay. Met andere woorden een iteratiestap. Bij de volgende stap worden deze waarden aangepast en wordt de tweede iteratie doorgerekend.
===Combo Infiltration Speed===
The purpose of the [[Combo Overlay]] Combo Infiltration Speed is to set the correct formula depending on the saturation of the soil. This example uses the overlay Ground BOFEK ID to determine the type of soil.  


Het aantal iteraties wordt door de indicator opgevraagd met de TQL: SELECT_ITERATIONS_WHERE.
The formula is entirely hypothetical and only serves to make it clear that, for each iteration step, a value is chosen based on the degree of saturation.
De iteratie waar momenteel mee wordt gerekend wordt opgevraagd met de TQL: SELECT_ITERATION_WHERE


De totale simulatie tijd wordt ook opgevraagd: Query: SELECT_ATTRIBUUT_WHERE_NAME_IS_RAIN_M_AND_OVERLAY_IS_10_AND_RELATION_IS_WEATHER_AND_INDEX_IS_2
The formula in the combo overlay reads in this case:
<code>MAX(0, SUB(GLOBAL_DEFAULT_INFIL, SWITCH(B, 0, 1004, MUL(10, SUB(A, GLOBAL_DEFAULT_FRACTION)), 1006, MUL(5, SUB(A, GLOBAL_DEFAULT_FRACTION)))))</code>


Fraction Start en Fraction End geven de start en end als fractie. Bij Start en End wordt dit uitgedrukt in seconden door deze fractie te vermenigvuldigen met de totale simulatietijd.
==Rainfall Overlay==
When setting the rainfall overlay, the default settings can be used. The exceptions are described below.


Je kan de debug niet downloaden per iteratie.
Rain Event Duration: Specifies the total calculation duration, which is subsequently divided into iteration steps.
<br>Water System – Water Level: Here the initial water level and the U and V flow are set. Use the option "Advanced: Select Grid overlay to set initial water level and also flow UV". 
The water level is set based on a specific overlay, which is the combo overlay Surface. Similarly, the y and x speed from the combo overlay is used as initial input.
<br>Groundwater: Initialize the groundwater level using the Groundwater Depth combo overlay.


Je kan per iteratie wel wegschrijven.
<br>Unsaturated Zone: Initialize saturation and storage percentages per grid cell using the Fraction combo overlay.
<br>Generated Output Overlays:


Je kan bepaalde updates wel doen. Dus wanneer je in je scenario bijvoorbeeld het attribuut van een specifiek gebouwtype wil updaten tijdens een bepaalde iteratiestap 5, dan kan dat.
*Surface Last Value
UPDATE_BUILDING_ARGICULTURE_BUYOUT_COST_M2_WHERE BUILDING_IS_35_AND_ITERATION_IS_5
*Rain
*Ground Last Value
*Ground Watertable
*Ground Last Unsaturated Storage
*Ground Last Unsaturated Fraction
*Surface Last U
*Surface Last V
*The number of timeframes is set to 1.


Je zit initieel altijd in iteratiestap 0. Dus met een TQL querie kan dit niet voor iteratiestap 5. Het kan wel via de API en de indicator.
==Iteration Collector==
The [[Iteration Overlay|Iteration Collector]] is a type of overlay. It shows the results of each iteration step. An iteration collector needs an input overlay, in this case it is the Rainfall overlay. One timeframe is saved for each iteration step.


The [[Iteration Overlay#Modules|Modulus]] attribute of the Iteration Collector determines how many iterations are stored. By default, this is set to 1. This means that only one (the last) result of each iteration step is saved and used as a timeframe in the iteration collector. When the modulus is set to 1, every iteration is stored. When you set the modulus to 2, half of the iteration values ​​are stored.


Select_
==Indicator==
The indicator sets the start and end times for the rainfall overlay iteration steps. It uses queries like <code>SELECT_ITERATIONS_WHERE</code> and <code> SELECT_ATTRIBUTE_WHERE_NAME_IS_RAIN_M_AND_OVERLAY_IS_10_AND_RELATION_IS_WEATHER_AND_INDEX_IS_2</code> to determine the number of steps and total simulation time. The <code>UPDATE_OVERLAY_PARTIAL_START_SEC_WHERE_OVERLAY_IS_3</code> and <code>UPDATE_OVERLAY_PARTIAL_END_SEC_WHERE_OVERLAY_IS_3</code> queries then adjust the timing for the next step, identified via <code>SELECT_ITERATION_WHERE</code>. Fraction Start and End define these as fractions of the total simulation time.


Modulus
==Number of Iterations==
Set the number of iterations in the [[calculation panel]] under the 'iteration' option. This is set to 1 by default.


==Exploring the results==
To view the results, play back the iteration sequence. The following results can be seen here:
* Water on ground level in meters
* Iteration Fraction: The fraction of the total water storage capacity of the unsaturated zone that is filled with water in meters
* Iteration Storage: The amount of water in the unsaturated zone in meters
* Iteration Infil Speed: The infiltration speed in meters per day
* Iteration Rain: The total amount of rainfall up to that point in the simulation in meters.
* Iteration ground table: The groundwater level in m + datum.
When the iteration Infil speed is viewed, it becomes clear that the two different soil types (BOFEK IDs) give a different result in the infiltration speed.


==Exploring the project==
==Notes and Limitations==
To begin exploring the project, see the outlet located on the left side.
Debugging cannot be downloaded per iteration but can be saved for each iteration.
Specific updates (e.g., updating attributes for certain building types in iteration 5) can be executed using the API and indicator but not through TQL for non-initial iterations.
===Effect of Iterations on Calculation Accuracy===
When calculating a precipitation event, there may be a difference between a standard calculation and an iterative calculation, even if they use the same rainfall overlay. This is due to the way data is processed during an iterative calculation.<br>
In a standard calculation, the precipitation event is executed in a single step. In an iterative calculation, on the other hand, the event is split into multiple time steps, for example 10. After each iteration step, the data is stored and prepared for the next step. Rounding occurs during this process, which can affect the accuracy of the results.<br>
The water levels are stored internally in a 64-bit format, which provides high precision with 12 decimal places. However, the results are displayed in a 32-bit format, which has an accuracy of 6 decimal places. In the iterative calculation, the 32-bit result is used. This causes small rounding differences between the results. The more iteration steps there are, the more often this rounding occurs and the larger the deviation can become.<br>
These rounding differences are minimal. If required, additional measures can be implemented to further increase precision.


{{article end
{{article end

Latest revision as of 11:36, 14 July 2026

This section describes a technical aspect, and is mainly for advanced users.


An overview of Demo Iteration.

The Demo Iteration project is available for all users and can be found in the main menu under Edit projects. This project does not count towards your license.

This project is intended for hydrologists and other water experts.

This project showcases the rainfall overlay in a iteration mode.

The demo showcases the iteration functionality for adjusting ground infiltration speed via a combo formula.

Calculations using the Iteration option

The demo project simulates a Dutch polder to demonstrate how rainfall infiltration can be modeled using the iteration option.

We want the speed at which rainwater infiltrates to depend on the degree of saturation of the soil. Dividing the rain event into multiple iteration steps allows the infiltration rate to be adjusted based on soil saturation, increasing calculation accuracy.

The purpose of this demo project is to clarify how an iterative calculation can be made. In this case, the infiltration of water during and after a precipitation event was chosen. This demo project can also serve as a basis for performing other iterative calculations.

Setup of the Demo Project

The demo project consists of a number of components that are essential for this calculation.

Combo Overlays

Before we create the Rainfall event, a number of overlays are created that serve as input for the various iteration steps. At the end of each iteration the combo overlay is updated an serves as the input for the next iteration step. We'll go through the different combo overlays.

Combo Surface U and Combo Surface V

These overlays define the initial surface water velocity in the X and Y directions. For water flowing down a slope, the final velocity of one iteration step becomes the initial velocity for the next. The input grid is the result of the last calculation. The formula ensures calculations use data from the previous time step, except for step 0, where a value of 0 is used.

Make sure to check the box "previous" to make sure the Combo Overlay uses the U and V of the previous iteration step.
The formula in the combo overlay should in this case read: IF(EQ(ITERATION, 0), 0, A)

Combo Fraction and Combo Groundwater Depth

Combo Fraction and Combo Groundwater Depth use input from the previous iteration step, unless it is step 0. In that case, a Global value is used. The Global DEFAULT_FRACTION is used for the saturation percentage, and the global DEFAULT_TABLE is used for the groundwater level.


The formula in the combo overlay Combo Fraction should in this case read: IF(EQ(ITERATION, 0), GLOBAL_DEFAULT_FRACTION, IF(EQ(A, NO_DATA), GLOBAL_DEFAULT_FRACTION, A))
The formula in the combo overlay Combo Groundwater Depth should in this case read: IF(EQ(ITERATION, 0), GLOBAL_DEFAULT_TABLE, A)

Combo Surface

The combo Surface gives the last value of the waterlevel on the surface and is input for the next iteration step. If there is no previous iteration step, the value should be 0. Make sure to check the box "previous" to make sure the Combo Overlay uses the values of the previous itertationstep.


The formula in the combo overlay Combo Fraction should in this case read: IF(EQ(ITERATION, 0), 0, A)

Combo Infiltration Speed

The purpose of the Combo Overlay Combo Infiltration Speed is to set the correct formula depending on the saturation of the soil. This example uses the overlay Ground BOFEK ID to determine the type of soil.

The formula is entirely hypothetical and only serves to make it clear that, for each iteration step, a value is chosen based on the degree of saturation.

The formula in the combo overlay reads in this case: MAX(0, SUB(GLOBAL_DEFAULT_INFIL, SWITCH(B, 0, 1004, MUL(10, SUB(A, GLOBAL_DEFAULT_FRACTION)), 1006, MUL(5, SUB(A, GLOBAL_DEFAULT_FRACTION)))))

Rainfall Overlay

When setting the rainfall overlay, the default settings can be used. The exceptions are described below.

Rain Event Duration: Specifies the total calculation duration, which is subsequently divided into iteration steps.
Water System – Water Level: Here the initial water level and the U and V flow are set. Use the option "Advanced: Select Grid overlay to set initial water level and also flow UV". The water level is set based on a specific overlay, which is the combo overlay Surface. Similarly, the y and x speed from the combo overlay is used as initial input.
Groundwater: Initialize the groundwater level using the Groundwater Depth combo overlay.


Unsaturated Zone: Initialize saturation and storage percentages per grid cell using the Fraction combo overlay.
Generated Output Overlays:

  • Surface Last Value
  • Rain
  • Ground Last Value
  • Ground Watertable
  • Ground Last Unsaturated Storage
  • Ground Last Unsaturated Fraction
  • Surface Last U
  • Surface Last V
  • The number of timeframes is set to 1.

Iteration Collector

The Iteration Collector is a type of overlay. It shows the results of each iteration step. An iteration collector needs an input overlay, in this case it is the Rainfall overlay. One timeframe is saved for each iteration step.

The Modulus attribute of the Iteration Collector determines how many iterations are stored. By default, this is set to 1. This means that only one (the last) result of each iteration step is saved and used as a timeframe in the iteration collector. When the modulus is set to 1, every iteration is stored. When you set the modulus to 2, half of the iteration values ​​are stored.

Indicator

The indicator sets the start and end times for the rainfall overlay iteration steps. It uses queries like SELECT_ITERATIONS_WHERE and SELECT_ATTRIBUTE_WHERE_NAME_IS_RAIN_M_AND_OVERLAY_IS_10_AND_RELATION_IS_WEATHER_AND_INDEX_IS_2 to determine the number of steps and total simulation time. The UPDATE_OVERLAY_PARTIAL_START_SEC_WHERE_OVERLAY_IS_3 and UPDATE_OVERLAY_PARTIAL_END_SEC_WHERE_OVERLAY_IS_3 queries then adjust the timing for the next step, identified via SELECT_ITERATION_WHERE. Fraction Start and End define these as fractions of the total simulation time.

Number of Iterations

Set the number of iterations in the calculation panel under the 'iteration' option. This is set to 1 by default.

Exploring the results

To view the results, play back the iteration sequence. The following results can be seen here:

  • Water on ground level in meters
  • Iteration Fraction: The fraction of the total water storage capacity of the unsaturated zone that is filled with water in meters
  • Iteration Storage: The amount of water in the unsaturated zone in meters
  • Iteration Infil Speed: The infiltration speed in meters per day
  • Iteration Rain: The total amount of rainfall up to that point in the simulation in meters.
  • Iteration ground table: The groundwater level in m + datum.

When the iteration Infil speed is viewed, it becomes clear that the two different soil types (BOFEK IDs) give a different result in the infiltration speed.

Notes and Limitations

Debugging cannot be downloaded per iteration but can be saved for each iteration. Specific updates (e.g., updating attributes for certain building types in iteration 5) can be executed using the API and indicator but not through TQL for non-initial iterations.

Effect of Iterations on Calculation Accuracy

When calculating a precipitation event, there may be a difference between a standard calculation and an iterative calculation, even if they use the same rainfall overlay. This is due to the way data is processed during an iterative calculation.
In a standard calculation, the precipitation event is executed in a single step. In an iterative calculation, on the other hand, the event is split into multiple time steps, for example 10. After each iteration step, the data is stored and prepared for the next step. Rounding occurs during this process, which can affect the accuracy of the results.
The water levels are stored internally in a 64-bit format, which provides high precision with 12 decimal places. However, the results are displayed in a 32-bit format, which has an accuracy of 6 decimal places. In the iterative calculation, the 32-bit result is used. This causes small rounding differences between the results. The more iteration steps there are, the more often this rounding occurs and the larger the deviation can become.
These rounding differences are minimal. If required, additional measures can be implemented to further increase precision.