{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Instability in a multistep method\n", "\n", "Consider the ridiculously simple IVP $u'=u$, $u(0)=1$, whose solution is $e^t$." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "using FundamentalsNumericalComputation" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "dudt = (u,t) -> u;\n", "u_exact = exp;\n", "a = 0.0; b = 1.0;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's apply the LIAF method to this problem for varying fixed step sizes. We'll measure the error at the time $t=1$." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "
\n", "n | \n", "h | \n", "error | \n", "
---|---|---|
Int64 | \n", "Float64 | \n", "Float64 | \n", "
5 | \n", "0.2 | \n", "0.01604519922158687 | \n", "
10 | \n", "0.1 | \n", "2.845479238377764 | \n", "
20 | \n", "0.05 | \n", "1.6224961462218664e6 | \n", "
40 | \n", "0.025 | \n", "9.3442027524627e18 | \n", "
60 | \n", "0.016666666666666666 | \n", "1.740134731635269e32 | \n", "