|
33 | 33 | "colab_type": "text" |
34 | 34 | }, |
35 | 35 | "source": [ |
36 | | - "<a href=\"https://colab.research.google.com/github/john-s-butler-dit/Numerical-Analysis-Python/blob/master/Chapter%2001%20-%20Euler%20Methods/1_Problem%20Sheet/01_Problem%20Sheet%201%20Question%202b.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" |
| 36 | + "<a href=\"https://colab.research.google.com/github/john-s-butler-dit/Numerical-Analysis-Python/blob/master/Chapter%2001%20-%20Euler%20Methods/1_Problem%20Sheet/102b_Problem_Sheet.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" |
37 | 37 | ] |
38 | 38 | }, |
39 | 39 | { |
|
73 | 73 | "\n", |
74 | 74 | "warnings.filterwarnings(\"ignore\")" |
75 | 75 | ], |
76 | | - "execution_count": 8, |
| 76 | + "execution_count": null, |
77 | 77 | "outputs": [] |
78 | 78 | }, |
79 | 79 | { |
|
120 | 120 | "plt.title('Illustration of discrete time points for h=%s'%(h))\n", |
121 | 121 | "plt.plot();" |
122 | 122 | ], |
123 | | - "execution_count": 9, |
| 123 | + "execution_count": null, |
124 | 124 | "outputs": [ |
125 | 125 | { |
126 | 126 | "output_type": "display_data", |
|
167 | 167 | "for i in range (0,N):\n", |
168 | 168 | " w[i+1]=w[i]+h*(w[i]-t[i])" |
169 | 169 | ], |
170 | | - "execution_count": 10, |
| 170 | + "execution_count": null, |
171 | 171 | "outputs": [] |
172 | 172 | }, |
173 | 173 | { |
|
178 | 178 | "source": [ |
179 | 179 | "y=np.exp(t)+t+1 # Exact Solution" |
180 | 180 | ], |
181 | | - "execution_count": 11, |
| 181 | + "execution_count": null, |
182 | 182 | "outputs": [] |
183 | 183 | }, |
184 | 184 | { |
|
212 | 212 | " \\begin{equation}|y(t_1)-w_1|<\\tau=\\frac{Mh}{2}=\\frac{8h}{2}=4h.\\end{equation}\n", |
213 | 213 | "### Lipschitz constant\n", |
214 | 214 | "The Lipschitz constant $L$ is from the Lipschitz condition,\n", |
215 | | - " \\begin{equation}\\left| \\frac{\\partial f(t,y)}{\\partial t}\\right|\\leq L. \\end{equation}\n", |
| 215 | + " \\begin{equation}\\left| \\frac{\\partial f(t,y)}{\\partial y}\\right|\\leq L. \\end{equation}\n", |
216 | 216 | "The constant can be found by taking partical derivative of $f(t,y)=y-t$ with respect to $y$\n", |
217 | 217 | " \\begin{equation}\\frac{\\partial f(t,y)}{\\partial y}=1\\end{equation}\n", |
218 | 218 | " \\begin{equation}L=1.\\end{equation}\n", |
|
230 | 230 | "source": [ |
231 | 231 | "Upper_bound=8*h/(2*1)*(np.exp(t)-1) # Upper Bound" |
232 | 232 | ], |
233 | | - "execution_count": 12, |
| 233 | + "execution_count": null, |
234 | 234 | "outputs": [] |
235 | 235 | }, |
236 | 236 | { |
|
285 | 285 | "plt.tight_layout()\n", |
286 | 286 | "plt.subplots_adjust(top=0.85) " |
287 | 287 | ], |
288 | | - "execution_count": 13, |
| 288 | + "execution_count": null, |
289 | 289 | "outputs": [ |
290 | 290 | { |
291 | 291 | "output_type": "display_data", |
|
317 | 317 | "df = pd.DataFrame(data=d)\n", |
318 | 318 | "df" |
319 | 319 | ], |
320 | | - "execution_count": 14, |
| 320 | + "execution_count": null, |
321 | 321 | "outputs": [ |
322 | 322 | { |
323 | 323 | "output_type": "execute_result", |
|
415 | 415 | "source": [ |
416 | 416 | "" |
417 | 417 | ], |
418 | | - "execution_count": 14, |
| 418 | + "execution_count": null, |
419 | 419 | "outputs": [] |
420 | 420 | } |
421 | 421 | ] |
|
0 commit comments