Import modules :
Initial condition :
Time stepping options :
Part 1 : Solving the problem
Implement and solve the problem using your own functions for the backward Euler's method and Newton's method.
/tmp/ipykernel_160/2476182983.py:1: MatplotlibDeprecationWarning: The seaborn styles shipped by Matplotlib are deprecated since 3.6, as they no longer correspond to the styles shipped by seaborn. However, they will remain available as 'seaborn-v0_8-<style>'. Alternatively, directly use the seaborn API instead.
Part 2 : Convergence Assessment
Compute successive numerical solutions as you increase the number of time steps
You can use 1D piecewise linear interpolation directly from SciPy:
Compute and plot (in double logarithmic scale) the rmse(m) by increasing m until you consider that your solution is accurate enough.
Solve the same problem using SciPy's function from the submodule