# Testing Project for ASPP 2023 Mexico ## Exercise 1 -- @parametrize and the logistic map Make a file `logistic.py` and `test_logistic.py` in the same folder as this readme and the `plot_logfun.py` file. Implement the code for the logistic map in the `logistic.py` file: a) Implement the logistic map f(𝑥)=𝑟∗𝑥∗(1−𝑥) . Use `@parametrize` to test the function for the following cases: ``` x=0.1, r=2.2 => f(x, r)=0.198 x=0.2, r=3.4 => f(x, r)=0.544 x=0.75, r=1.7 => f(x, r)=0.31875 ``` b) Implement the function `iterate_f` that runs `f` for `it` iterations, each time passing the result back into f. Use `@parametrize` to test the function for the following cases: ``` x=0.1, r=2.2, it=1 => iterate_f(it, x, r)=[0.198] x=0.2, r=3.4, it=4 => f(x, r)=[0.544, 0.843418, 0.449019, 0.841163] x=0.75, r=1.7, it=2 => f(x, r)=[0.31875, 0.369152] ``` c) Import and call the `plot_trajectory` function from the `plot_logfun` module to look at the trajectories generated by your code. The `plot_logfun` imports and uses your `logistic.py` code. Import the module and call the function in a new `plot_script.py` file. Try with values `r<3`, `r>4` and `3`f` is a function and `x0` and `y0` are two possible seeds. >If `f` has SDIC then: >there is a number `delta` such that for any `x0` there is a `y0` that is not >more than `init_error` away from `x0`, where the initial condition `y0` has >the property that there is some integer n such that after n iterations, the >orbit is more than `delta` away from the orbit of `x0`. That is >|xn-yn| > delta