{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Task 05\n", "\n", "**deadline: 28/03/2021 23:59 CET**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**[0.5 points]:** Approximate the function \n", "\n", "$$\n", "f(x) =\n", "\\begin{cases}\n", "-1 & \\text{if $ x \\leq 5 $} \\\\\n", "1 & \\text{if $ x > 5 $}\n", "\\end{cases}\n", "$$\n", "\n", "in the $ [0, 10] $ interval with the Lagrange interpolating polynomial using the roots of the $ 10 $-th degree Chebyshev polynomial (you may use the [`scipy.interpolate.lagrange`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.lagrange.html) and [`scipy.special.roots_chebyt`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.roots_chebyt.html) functions). Print the interpolating polynomial. \n", "\n", "**[0.5 points]:** Plot the function $ f(x) $, the interpolating polynomial, and the absolute error of the approximation." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "\n", "# add your code here\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }