Skip to content

Commit

Permalink
add mention of seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
teubert committed Aug 24, 2023
1 parent 9813df3 commit 2e9ba11
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions examples/01_Simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@
"metadata": {},
"outputs": [],
"source": [
"loading = GaussianNoiseLoadWrapper(loading, 0.2)"
"loading_with_noise = GaussianNoiseLoadWrapper(loading, 0.2)"
]
},
{
Expand All @@ -674,7 +674,7 @@
"metadata": {},
"outputs": [],
"source": [
"results = m.simulate_to_threshold(loading, save_freq=100)\n",
"results = m.simulate_to_threshold(loading_with_noise, save_freq=100)\n",
"fig = results.inputs.plot()"
]
},
Expand All @@ -691,7 +691,7 @@
"metadata": {},
"outputs": [],
"source": [
"results = m.simulate_to_threshold(loading, save_freq=100)\n",
"results = m.simulate_to_threshold(loading_with_noise, save_freq=100)\n",
"fig = results.inputs.plot()"
]
},
Expand All @@ -717,6 +717,30 @@
"source": [
"Note that the noise in input can be seen in the resulting output plots.\n",
"\n",
"The seed can be set in creation of the GaussianNoiseLoadWrapper to ensure repeatable results, for example."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"loading_with_noise = GaussianNoiseLoadWrapper(loading, 0.2, seed=2000)\n",
"results = m.simulate_to_threshold(loading_with_noise, save_freq=100)\n",
"fig = results.inputs.plot()\n",
"\n",
"loading_with_noise = GaussianNoiseLoadWrapper(loading, 0.2, seed=2000)\n",
"results = m.simulate_to_threshold(loading_with_noise, save_freq=100)\n",
"fig = results.inputs.plot()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The load profiles in the two examples above are identical because they share the same random seed.\n",
"\n",
"In this section we introduced the concept of NoiseWrappers and how they are used to represent uncertainty in future loading. This concept is expecially important when used with prediction (see 9. Prediction). A GuassianNoiseLoadWrapper was used with a Piecewise loading profile to demonstrate it, but NoiseWrappers can be applied to any loading object or function, including the advanced profiles introduced in the next section."
]
},
Expand Down Expand Up @@ -900,7 +924,12 @@
"## Conclusions\n",
"...\n",
"\n",
"simulate_to_event(), events"
"simulate_to_event(), events\n",
"loading.plot()\n",
"guassian std dev for each event.\n",
"Guassian std dev as function of t\n",
"Switch to use generator so you can set seed\n",
"remove x=None requirement\n"
]
}
],
Expand Down

0 comments on commit 2e9ba11

Please sign in to comment.