====== Tutorial 6 - Dicrete Events ====== ===== 1/1 ===== **The model** A very simple model describes the transfer of radionuclides from a weakly contaminated spot to the surrounding area. After 60 years, an accident caused a massive increase of contamination. The model itself is of no importance, but demonstrates the necessity to help the solver when discrete events occur. \\
  1. Download the file {{tutorial:Contamination.eco?linkonly}} and open it in Ecolego by clicking the {{:Open24.png|Open}} button, or by selecting **File | Open** from the [[Menu_bar|Menu bar]].

  2. Run the model and make a plot of the contamination of //NearField// and //FarField//.{{tutorial_6_3.png}}

  3. Investigate the [[transfer|transfer]] //Accident//. It uses a condition to add a pulse contamination between year 60 and year 61. Can you see any traces of this pulse in the output plots? {{tutorial_6_5.png}}

  4. Add two [[Discrete_Event|Discrete Event]] blocks – two major events occur in the model. At time = 60 years when the pulse begins, and at time = 61 years, when the pulse ends. You can create the blocks by right-clicking an empty diagonal cell in the matrix and choosing **Other | Discrete Event**.

    {{tutorial:Tutorial_6_discrete.PNG|Screenshot}}

\\
  1. Edit the first [[Discrete_Event|Discrete Event]] block. Enter “time” as the first [[expression|expression]] and “time_pulse_begin” as the second [[expression|expression]].

    \\ {{tutorial_6_1.png}}\\ \\

  2. Edit the second [[Discrete_Event|Discrete Event]] block. Enter “time” as the first expression and “time_pulse_end” as the second [[expression|expression]].{{tutorial_6_2.png}}

  3. Run a [[Running_simulations|simulation]]. Is there any difference in the output?

{{tutorial_6_4.png}} \\ \\ **Solution to the exercise** * {{tutorial:Contamination_solution.eco?linkonly}} **Reference** * [[Tutorials|Back to Tutorials]] * [[start|Home]]