initial commit with 2024 materials

This commit is contained in:
Pamela Hathway 2025-09-19 10:46:45 +02:00
commit 6fdfdbb8b7
66 changed files with 102457 additions and 0 deletions

View file

@ -0,0 +1,24 @@
import numpy as np
def f(x, r):
""" Compute the logistic map for a given value of x and r. """
return r * x * (1 - x)
def iterate_f(it, x0, r):
""" Generate a population trajectory.
Takes a number of iterations `it`, a starting value, x0,
and a parameter value for r. It executes f repeatedly (it times),
each time using the last result of f as the new input to f. Append each
iteration's result to a list l. Finally, convert the list into a numpy
array and return it.
"""
x = x0
xs = [x0]
for _ in range(it):
x = f(x, r)
xs.append(x)
return np.array(xs)