﻿{"id":4667,"date":"2014-01-17T06:05:54","date_gmt":"2014-01-16T21:05:54","guid":{"rendered":"http:\/\/fujiitoshiki.com\/improvesociety\/?p=4667"},"modified":"2014-08-01T18:59:39","modified_gmt":"2014-08-01T09:59:39","slug":"numerical-methods-for-solving-differential-equations","status":"publish","type":"post","link":"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=4667","title":{"rendered":"Numerical methods for solving differential equations"},"content":{"rendered":"<div class=\"theContentWrap-ccc\"><blockquote>\n<p>Given the boudary-value problem<\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+dy%2Fdx+%3D+f%28x%2C+y%29%5C+%5C+%5C+y%28x_0%29+%3D+y_0%5C+%5C+%5C+%281%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle dy\/dx = f(x, y)\\ \\ \\ y(x_0) = y_0\\ \\ \\ (1)' title='\\displaystyle dy\/dx = f(x, y)\\ \\ \\ y(x_0) = y_0\\ \\ \\ (1)' class='latex' \/><\/p>\n<p>it may not be possible to obtain an exact solution. In such case various methods are available for obtaining an approximate or numerical solution. In the following we list several methods. <\/p>\n<ol>\n<li>Step by step or Euler method<\/li>\n<li>Taylor series method<\/li>\n<li>Picard&#8217;s method<\/li>\n<li>Runge-Kutta method<\/li>\n<\/ol>\n<h2>1. Step by step or Euler method<\/h2>\n<p>In this method we replace the differential equation of (1) by the approximation<\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+%5Cfrac%7By%28x_0+%2B+h%29-y%28x_0%29%7D%7Bh%7D+%3D+f%28x_0%2C+y_0%29%5C+%5C+%5C+%282%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle \\frac{y(x_0 + h)-y(x_0)}{h} = f(x_0, y_0)\\ \\ \\ (2)' title='\\displaystyle \\frac{y(x_0 + h)-y(x_0)}{h} = f(x_0, y_0)\\ \\ \\ (2)' class='latex' \/><\/p>\n<p>so that<\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+y%28x_0+%2B+h%29+%3D+y%28x_0%29+%2B+hf%28x_0%2C+y_0%29%5C+%5C+%5C+%283%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle y(x_0 + h) = y(x_0) + hf(x_0, y_0)\\ \\ \\ (3)' title='\\displaystyle y(x_0 + h) = y(x_0) + hf(x_0, y_0)\\ \\ \\ (3)' class='latex' \/><\/p>\n<p>By continuity in this manner we can then find <img src='https:\/\/s0.wp.com\/latex.php?latex=y%28x_0+%2B+2h%29%2C%5C+y%28x_0+%2B+3h%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='y(x_0 + 2h),\\ y(x_0 + 3h)' title='y(x_0 + 2h),\\ y(x_0 + 3h)' class='latex' \/>, etc. We choose <img src='https:\/\/s0.wp.com\/latex.php?latex=h&#038;bg=T&#038;fg=000000&#038;s=0' alt='h' title='h' class='latex' \/> sufficiently small so as to obtain good approximations. <\/p>\n<p>A modified procedure of this method can also be used. <\/p>\n<h2>2. Taylor series method<\/h2>\n<p>By successive differentiation of the differential equation in (1) we can find <img src='https:\/\/s0.wp.com\/latex.php?latex=y%27%28x_0%29%2C%5C+y%27%27%28x_0%29%2C%5C+y%27%27%27%28x_0%29%2C%5Ccdots&#038;bg=T&#038;fg=000000&#038;s=0' alt='y&#039;(x_0),\\ y&#039;&#039;(x_0),\\ y&#039;&#039;&#039;(x_0),\\cdots' title='y&#039;(x_0),\\ y&#039;&#039;(x_0),\\ y&#039;&#039;&#039;(x_0),\\cdots' class='latex' \/>. Then the solution is given by the Taylor series<\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+y%28x%29+%3D+y%28x_0%29+%2B+y%27%28x_0%29%28x+-+x_0%29+%2B+%5Cfrac%7By%27%27%28x_0%29%28x+-+x_0%29%5E2%7D%7B2%21%7D+%2B+%5Ccdots%5C+%5C+%5C+%284%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle y(x) = y(x_0) + y&#039;(x_0)(x - x_0) + \\frac{y&#039;&#039;(x_0)(x - x_0)^2}{2!} + \\cdots\\ \\ \\ (4)' title='\\displaystyle y(x) = y(x_0) + y&#039;(x_0)(x - x_0) + \\frac{y&#039;&#039;(x_0)(x - x_0)^2}{2!} + \\cdots\\ \\ \\ (4)' class='latex' \/><\/p>\n<p>assuming that the series converges. If it does we can obtain <img src='https:\/\/s0.wp.com\/latex.php?latex=y%28x_0+%2B+h%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='y(x_0 + h)' title='y(x_0 + h)' class='latex' \/> to any desired accuracy. <\/p>\n<h2>3. Picard&#8217;s method<\/h2>\n<p>By integrating the differential equation in (1) and using the boundary condition, we find <\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+y%28x%29+%3D+y_0+%2B+%5Cint%5E%7Bx%7D_%7Bx_0%7D%5C%21+f%28u%2C+y%29du%5C+%5C+%5C+%285%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle y(x) = y_0 + \\int^{x}_{x_0}\\! f(u, y)du\\ \\ \\ (5)' title='\\displaystyle y(x) = y_0 + \\int^{x}_{x_0}\\! f(u, y)du\\ \\ \\ (5)' class='latex' \/><\/p>\n<p>Assuming the approximation <img src='https:\/\/s0.wp.com\/latex.php?latex=y_1%28x%29+%3D+y_0&#038;bg=T&#038;fg=000000&#038;s=0' alt='y_1(x) = y_0' title='y_1(x) = y_0' class='latex' \/>, we obtain from (5) a new approximation. <\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+y_2%28x%29+%3D+y_0+%2B+%5Cint%5E%7Bx%7D_%7Bx_0%7D%5C%21+f%28u%2C+y_1%29du%5C+%5C+%5C+%286%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle y_2(x) = y_0 + \\int^{x}_{x_0}\\! f(u, y_1)du\\ \\ \\ (6)' title='\\displaystyle y_2(x) = y_0 + \\int^{x}_{x_0}\\! f(u, y_1)du\\ \\ \\ (6)' class='latex' \/><\/p>\n<p>Using this in (5) we obtain another approximation. <\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+y_3%28x%29+%3D+y_0+%2B+%5Cint%5E%7Bx%7D_%7Bx_0%7D%5C%21+f%28u%2C+y_2%29du%5C+%5C+%5C+%287%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle y_3(x) = y_0 + \\int^{x}_{x_0}\\! f(u, y_2)du\\ \\ \\ (7)' title='\\displaystyle y_3(x) = y_0 + \\int^{x}_{x_0}\\! f(u, y_2)du\\ \\ \\ (7)' class='latex' \/><\/p>\n<p>Continuing in this manner we obtain a sequence of approximations <img src='https:\/\/s0.wp.com\/latex.php?latex=y_1%2C+y_2%2C+y_3%2C%5Ccdots&#038;bg=T&#038;fg=000000&#038;s=0' alt='y_1, y_2, y_3,\\cdots' title='y_1, y_2, y_3,\\cdots' class='latex' \/>. The limit of this sequence, if it exists, is the required solution. However, by carrying out the procedure a few times, good approximations can be obtained. <\/p>\n<h2>4. Runge-Kutta method<\/h2>\n<p>This method consists of computing<\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+%5Cleft.%5Cbegin%7Barray%7D%7Brcl%7Dk_1+%26+%3D+%26+hf%28x_0%2C+y_0%29+%5C%5C+k_2+%26+%3D+%26+hf%28x_0+%2B+%5Cfrac%7B1%7D%7B2%7Dh%2C+y_0+%2B+%5Cfrac%7B1%7D%7B2%7Dk_1%29+%5C%5C+k_3+%26+%3D+%26+hf%28x_0+%2B+%5Cfrac%7B1%7D%7B2%7Dh%2C+y_0+%2B+%5Cfrac%7B1%7D%7B2%7Dk_2+%5C%5C+k_4+%26+%3D+%26+hf%28x_0+%2B+%5Cfrac%7B1%7D%7B2%7Dh%2C+y_0+%2B+%5Cfrac%7B1%7D%7B2%7Dk_3%29+%5Cend%7Barray%7D+%5Cright%5C%7D%5C+%5C+%5C+%288%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle \\left.\\begin{array}{rcl}k_1 &amp; = &amp; hf(x_0, y_0) \\\\ k_2 &amp; = &amp; hf(x_0 + \\frac{1}{2}h, y_0 + \\frac{1}{2}k_1) \\\\ k_3 &amp; = &amp; hf(x_0 + \\frac{1}{2}h, y_0 + \\frac{1}{2}k_2 \\\\ k_4 &amp; = &amp; hf(x_0 + \\frac{1}{2}h, y_0 + \\frac{1}{2}k_3) \\end{array} \\right\\}\\ \\ \\ (8)' title='\\displaystyle \\left.\\begin{array}{rcl}k_1 &amp; = &amp; hf(x_0, y_0) \\\\ k_2 &amp; = &amp; hf(x_0 + \\frac{1}{2}h, y_0 + \\frac{1}{2}k_1) \\\\ k_3 &amp; = &amp; hf(x_0 + \\frac{1}{2}h, y_0 + \\frac{1}{2}k_2 \\\\ k_4 &amp; = &amp; hf(x_0 + \\frac{1}{2}h, y_0 + \\frac{1}{2}k_3) \\end{array} \\right\\}\\ \\ \\ (8)' class='latex' \/><\/p>\n<p>Then<\/p>\n<p><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle+y%28x_0+%2B+h%29+%3D+y_0+%2B+%5Cfrac%7B1%7D%7B6%7D%28k_1+%2B+2k_2+%2B+2k_3+%2B+k_4%29%5C+%5C+%5C+%289%29&#038;bg=T&#038;fg=000000&#038;s=0' alt='\\displaystyle y(x_0 + h) = y_0 + \\frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)\\ \\ \\ (9)' title='\\displaystyle y(x_0 + h) = y_0 + \\frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)\\ \\ \\ (9)' class='latex' \/><\/p>\n<p>These methods can also be adapted for higher order differential equations by writing them as several first order equations. <\/p>\n<\/blockquote>\n<p><iframe src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=fujiitoshiki-22&#038;o=9&#038;p=8&#038;l=as4&#038;m=amazon&#038;f=ifr&#038;ref=ss_til&#038;asins=0071635408\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"><\/iframe><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Given the boudary-value problem it may not be possible to obtain an exact solution. In such case various metho &hellip; <a href=\"https:\/\/www.fujiitoshiki.com\/improvesociety\/?p=4667\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Numerical methods for solving differential equations&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":6040,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-4667","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mathematics"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/4667","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4667"}],"version-history":[{"count":33,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/4667\/revisions"}],"predecessor-version":[{"id":6051,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/posts\/4667\/revisions\/6051"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=\/wp\/v2\/media\/6040"}],"wp:attachment":[{"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fujiitoshiki.com\/improvesociety\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}