python_demo
python_demo,
demonstrates how Python can be used to setup and solve a simple
computational problem, and illustrate the results.
The notes:
Scripts:
-
random_points.py,
a script which generates random positions for two flies.
-
simulate_compare.py,
a script which compares the simulation histogram to the exact PDF>
-
simulate_error.py,
a script which reports the change in the distance estimate as
we increase the number of samples.
-
simulate_histogram.py,
a script which makes many simulations, then a histogram.
-
simulate_many.py,
a function which returns the average of n simulations.
-
simulate_one.py,
a script which reports the result of one simulation.
-
simulate_time.py,
a script which compares the speed of simulate_many() and
simulate_vector();
-
simulate_vector.py,
a function which returns the average of n simulations,
using a faster vector formulation.
Images:
Last revised on 29 August 2019.