5. Iterative Computation: Exercise#
Name:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
1. Newton’s method#
Define a function of your interest and find the solutions for \(f(x)=0\) by Newton’s method and quasi Newton’s method.
Define an n-dimensional functions in n-dimensional space (e.g. n=2) and find solutions for \(\b{f}(\b{x})=\b{0}\) by Newton’s method and quasi Newton’s method.
2. Bifurcation and Chaos#
A value of \(x_k\) that stays unchanged after applying a map \(f\) to it, i.e.
is called a fixed point of \(f\).
Let us consider the logistic map
A bifurcation diagram is a plot of trajectories versus a parameter.
draw the bifurcation diagram for parameter \(a\) \((1 \le a \le 4)\), like below:

Hint:
Use the
logistic()anditerate()functions from the previous lecture.For each value of \(a\), show the trajectory (i.e., the values that \(x_k\) took over some iterations) of the map after an initial transient.
Since \(x_k\) is 1D, you can plot the trajectory on the y axis. For example, take 200 points in \(1 \le a \le 4\), run 1000 step iterations for each \(a\), and plot \(x\) after skipping first 100 steps.
3. Recursive call and fractal#
Draw the Sherpinski gasket like below.
