GoldSim Modeling & Native DLL

Monte Carlo Realizations & Scenario Modeling

[!NOTE] In GoldSim Monte Carlo mode, CligenWeather.dll generates an independent weather sequence for each realization based on the realization number.

This guide explains how Monte Carlo realizations are seeded in the DLL and how to inspect multi-realization results in GoldSim.


How Realizations Work with the DLL

In GoldSim, when you select Monte Carlo simulation mode and specify (for example) 100 Realizations, GoldSim loops through 100 iterations of your simulation timeframe (e.g., from Year 0 to Year 30).

At the start of each realization:

  1. GoldSim updates its internal run property Realization (incrementing from $1$ to $2, 3, \dots, 100$).
  2. The DLL receives the current realization index.
  3. The DLL initializes its pseudorandom number generator with a deterministic seed derived from the realization index.
  4. Each realization receives an independent 30-year weather time series generated from the same monthly CLIGEN parameters.
graph TD
    A["GoldSim Monte Carlo Run<br/>(100 Realizations)"] --> R1["Realization 1<br/>Seed 1001"]
    A --> R2["Realization 2<br/>Seed 1002"]
    A --> R3["Realization ..."]
    A --> R100["Realization 100<br/>Seed 1100"]

    R1 --> W1["Generates 30-Yr Sequence A<br/>(Contains 1997-style wet spell)"]
    R2 --> W2["Generates 30-Yr Sequence B<br/>(Contains 3-yr dry drought)"]
    R3 --> W3["Generates 30-Yr Sequence C"]
    R100 --> W100["Generates 30-Yr Sequence N"]

    W1 --> P["GoldSim Probabilistic Results<br/>(P10, P50, P90 Envelopes, Spill Risk)"]
    W2 --> P
    W3 --> P
    W100 --> P

Analyzing Probabilistic Results in GoldSim

Once the 100-realization run completes, open a Multi-Realization Time History Result element in GoldSim:

1. Probabilities of Spill or Overflow

If modeling a water storage reservoir or tailings impoundment:

  • Plot the water surface elevation over time.
  • Switch the display view from All Realizations to Probabilities.
  • Set the threshold to your spillway crest elevation. GoldSim will report the exact percentage of realizations that reached or exceeded the spillway (e.g., "There is a 3.2% probability of a spill event over the 30-year operational life of the facility").

2. Multi-Year Drought Vulnerability

  • View cumulative water storage at the 10th percentile (P10).
  • If your system maintains adequate storage even along the lower P10 trajectory, your water rights and storage design demonstrate high drought resilience.

3. Peak Storm Sizing

  • View maximum daily runoff rates across all 100 realizations.
  • Identify the worst-case storm event across the entire 3,000 synthetic years ($100 \text{ realizations} \times 30 \text{ years}$) to test emergency overflow spillway capacities.

Reproducibility & Seed Behavior

  • Because the DLL uses deterministic seeding based on GoldSim's realization index, re-running a GoldSim model with the same inputs and realization numbers produces the same sequence of generated values.

Troubleshooting Common GoldSim Questions

Q: Why do all realizations show the same weather?

A: Ensure that GoldSim's built-in run property Realization is linked to the DLL's realization input argument in the External element dialog. If this input is hardcoded to a static number (such as 1), the DLL will use the same seed for every realization.

Q: How many realizations should I run?

A:

  • 5 to 10 realizations: Initial testing and model debugging.
  • 50 to 100 realizations: Standard water balance and storage evaluations.
  • 500+ realizations: Evaluating low-probability tail events.