Files
cds-numerical-methods/Week 1/04 Runges Phenomenom.ipynb

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 HERE or "YOUR ANSWER HERE".

Submission

  1. Name all team members in the the cell below
  2. make sure everything runs as expected
  3. restart the kernel (in the menubar, select Kernel$\rightarrow$Restart)
  4. run all cells (in the menubar, select Cell$\rightarrow$Run All)
  5. Check all outputs (Out[*]) for errors and resolve them if necessary
  6. submit your solutions in time (before the deadline)
team_members = ""

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()