6.3 KiB
6.3 KiB
CDS: Numerical Methods Assignments¶
See lecture notes and documentation on Brightspace for Python and Jupyter basics. If you are stuck, try to google or get in touch via Discord.
Solutions must be submitted via the Jupyter Hub.
Make sure you fill in any place that says
YOUR CODE HEREor "YOUR ANSWER HERE".
Submission¶
- Name all team members in the the cell below
- make sure everything runs as expected
- restart the kernel (in the menubar, select Kernel$\rightarrow$Restart)
- run all cells (in the menubar, select Cell$\rightarrow$Run All)
- Check all outputs (Out[*]) for errors and resolve them if necessary
- submit your solutions in time (before the deadline)
Runge's Phenomenom¶
Use your own Lagrange interpolation routine to interpolate the function
$$f(x) = \frac{1}{1+25x^2}$$between $x=-1$ and $x=+1$, using the $x_k$ below. Plot the results and briefly discuss their differences.
In [ ]:
# Import packages here ... # YOUR CODE HERE raise NotImplementedError()
In [ ]:
# Paste your Lagrange interpolation routine here ... # YOUR CODE HERE raise NotImplementedError()
Task 1¶
Use equidistant $x_k = \frac{2k}{n} - 1$ with $k \in \{0, 1, \dots, n \}$.
In [ ]:
# YOUR CODE HERE raise NotImplementedError()
Task 2¶
Use Chebychev nodes $x_k = \operatorname{cos}\left(\frac{2k-1}{2n}\pi \right)$ with $k \in \{1, \dots, n \}$.
In [ ]:
# YOUR CODE HERE raise NotImplementedError()
Task 3¶
Use $n$ randomly chosen points $x_k$.
In [ ]:
# YOUR CODE HERE raise NotImplementedError()