Numerical PDE Methods Available for pdsolve/numeric
<Text-field style="Heading 2" layout="Heading 2" bookmark="info">Description</Text-field>This page contains a description of all numerical PDE methods available for time dependent problems, including information on the order of accuracy, applicable PDE problems, if numerical boundary conditions are required, and the differencing scheme used. For more information on specifying a specific numeric method for solving a PDE, see pdsolve/numeric/method.All methods can be applied to variable coefficient inhomogeneous PDEs, which are first order in time. In the following, NiNJImhHNiI= is used as the space step, and NiNJImtHNiI= as the time step. In addition, the differential order of the PDE in the spatial variable is denoted by NiNJJXhvcmRHNiI=.
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk0">ForwardTime1Space[forward/backward]</Text-field>The forward time forward/backward space method is an explicit single stage method that can be used to find solutions to first order time/space PDEs.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JEkiaEdGKEkia0dGKA== accurate.First order PDEs that describe right-traveling waves should use the backward method (specified as ForwardTime1Space[backward]), and specify the boundary condition at the left boundary, while left-traveling waves require the forward method (specified as ForwardTime1Space[forward]), and the boundary condition at the right boundary. Numerical boundary conditions are not required.As this is an explicit scheme, stability requires a restriction of the form NiMySSJrRzYiKiZJImFHRiUiIiJJImhHRiVGKA== for some NiNJImFHNiI= depending upon the problem.The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is the result of applying differencing to the PDE about the point NiRJInRHNiImSSJ4R0YkNiNJImlHRiQ= and can obtained by substitution of the discretizationsNiQvJkkidUc2IjYjSSJ0R0YmKiYsJiZGJTYkIiIiSSJpR0YmRi0mRiU2JCIiIUYuISIiRi1JImtHRiZGMkkhR0YmNiQvJkkidUc2IjYjSSJ4R0YmKiYsJiZGJTYkIiIhSSJpR0YmIiIiJkYlNiRGLSwmRi5GLyEiIkYvRjNGL0kiaEdGJkYzSSFHRiY=NiMvSSJ1RzYiJkYkNiQiIiFJImlHRiU=into the PDE for the backward method. The forward method simply replaces the discretization for NiMmSSJ1RzYiNiNJInhHRiU= byNiMvJkkidUc2IjYjSSJ4R0YmKiYsJiZGJTYkIiIhLCZJImlHRiYiIiJGMEYwRjAmRiU2JEYtRi8hIiJGMEkiaEdGJkYz
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk1">CenteredTime1Space[forward/backward]</Text-field>The centered time forward/backward space method is an implicit single stage method that can be used to find solutions to PDEs containing the derivatives NiZJInVHNiImRiM2I0kieEdGJCZGIzYjSSJ0R0YkJkYjNiNJI3h0R0Yk.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JEkiaEdGKCokSSJrR0YoIiIj accurate.PDEs that describe right-traveling waves should use the backward method (specified as CenteredTime1Space[backward]), and specify the boundary condition at the left boundary, while left-traveling waves require the forward method (specified as CenteredTime1Space[forward]), and the boundary condition at the right boundary. Numerical boundary conditions are not required.This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is the result of applying differencing to the PDE about the point NiQsJkkidEc2IiIiIkkia0dGJSNGJiIiIyZJInhHRiU2I0kiaUdGJQ== and is obtained by substitution of the discretizationsNiQvJkkidUc2IjYjSSN4dEdGJiooLComRiU2JCIiIkkiaUdGJkYtJkYlNiRGLSwmRi5GLSEiIkYtRjImRiU2JCIiIUYuRjImRiU2JEY1RjFGLUYtSSJrR0YmRjJJImhHRiZGMkkhR0YmNiQvJkkidUc2IjYjSSJ0R0YmKiYsJiZGJTYkIiIiSSJpR0YmRi0mRiU2JCIiIUYuISIiRi1JImtHRiZGMkkhR0YmNiQvJkkidUc2IjYjSSJ4R0YmLCQqJiwqJkkidkdGJjYkIiIiSSJpR0YmRi8mRi02JEYvLCZGMEYvISIiRi9GNCZGLTYkIiIhRjBGLyZGLTYkRjdGM0Y0Ri9JImhHRiZGNCNGLyIiI0khR0YmNiQvSSJ1RzYiLCYmRiQ2JCIiIkkiaUdGJSNGKSIiIyZGJDYkIiIhRipGK0khR0YlNiMvSSJ0RzYiLCZGJCIiIkkia0dGJSNGJyIiIw==into the PDE for the backward method. The forward method simply replaces the discretizations for NiMmSSJ1RzYiNiNJI3h0R0Yl and NiMmSSJ1RzYiNiNJInhHRiU= byNiQvJkkidUc2IjYjSSN4dEdGJiooLComRiU2JCIiIiwmSSJpR0YmRi1GLUYtRi0mRiU2JEYtRi8hIiImRiU2JCIiIUYuRjImRiU2JEY1Ri9GLUYtSSJrR0YmRjJJImhHRiZGMkkhR0YmNiMvJkkidUc2IjYjSSJ4R0YmLCQqJiwqJkkidkdGJjYkIiIiLCZJImlHRiZGL0YvRi9GLyZGLTYkRi9GMSEiIiZGLTYkIiIhRjBGLyZGLTYkRjdGMUY0Ri9JImhHRiZGNCNGLyIiIw==
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk2">BackwardTime1Space[forward/backward]</Text-field>The backward time forward/backward space method is an implicit single stage method that can be used to find solutions to PDEs containing the derivatives NiZJInVHNiImRiM2I0kieEdGJCZGIzYjSSJ0R0YkJkYjNiNJI3h0R0Yk.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JEkiaEdGKEkia0dGKA== accurate.PDEs that describe right-traveling waves should use the backward method (specified as BackwardTime1Space[backward]), and specify the boundary condition at the left boundary, while left-traveling waves require the forward method (specified as BackwardTime1Space[forward]), and the boundary condition at the right boundary. Numerical boundary conditions are not required.This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is the result of applying differencing to the PDE about the point NiQsJkkidEc2IiIiIkkia0dGJUYmJkkieEdGJTYjSSJpR0Yl and is obtained by substitution of the discretizationsNiQvJkkidUc2IjYjSSN4dEdGJiooLComRiU2JCIiIkkiaUdGJkYtJkYlNiRGLSwmRi5GLSEiIkYtRjImRiU2JCIiIUYuRjImRiU2JEY1RjFGLUYtSSJrR0YmRjJJImhHRiZGMkkhR0YmNiQvJkkidUc2IjYjSSJ0R0YmKiYsJiZGJTYkIiIiSSJpR0YmRi0mRiU2JCIiIUYuISIiRi1JImtHRiZGMkkhR0YmNiQvJkkidUc2IjYjSSJ4R0YmKiYsJiZJInZHRiY2JCIiIkkiaUdGJkYuJkYsNiRGLiwmRi9GLiEiIkYuRjNGLkkiaEdGJkYzSSFHRiY=NiQvSSJ1RzYiJkYkNiQiIiJJImlHRiVJIUdGJQ==NiMvSSJ0RzYiLCZGJCIiIkkia0dGJUYninto the PDE for the backward method. The forward method simply replaces the discretizations for NiMmSSJ1RzYiNiNJI3h0R0Yl and NiMmSSJ1RzYiNiNJInhHRiU= byNiQvJkkidUc2IjYjSSN4dEdGJiooLComRiU2JCIiIiwmSSJpR0YmRi1GLUYtRi0mRiU2JEYtRi8hIiImRiU2JCIiIUYuRjImRiU2JEY1Ri9GLUYtSSJrR0YmRjJJImhHRiZGMkkhR0YmNiMvJkkidUc2IjYjSSJ4R0YmKiYsJiZJInZHRiY2JCIiIiwmSSJpR0YmRi5GLkYuRi4mRiw2JEYuRjAhIiJGLkkiaEdGJkYz
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk3">ForwardTimeCenteredSpace or Euler</Text-field>The forward time centered space method is an explicit single stage method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with no mixed partial derivatives.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JCokSSJoR0YoIiIjSSJrR0Yo accurate.PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are second order in space require no numerical boundary conditions, but still require the same number of conditions on each boundary.As this is an explicit scheme, stability imposes a restriction on the time step of the problem relative to the space step. In general, this scheme is unstable for PDEs where NiNJJXhvcmRHNiI= is odd. For PDEs that are even order in space, stability requires a restriction of the form NiMySSJrRzYiKiZJImFHRiUiIiIpSSJoR0YlSSV4b3JkR0YlRig= for some NiNJImFHNiI= depending upon the problem.The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is the result of applying central differencing to the PDE about the point NiRJInRHNiImSSJ4R0YkNiNJImlHRiQ= using NiMsJiIiIkYkLUklY2VpbEc2JEkqcHJvdGVjdGVkR0YoSShfc3lzbGliRzYiNiMsJEkleG9yZEdGKiNGJCIiI0Yv points (that is, the mesh uses NiMtSSVjZWlsRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2IywkSSV4b3JkR0YoIyIiIiIiIw== points on either side of the center).
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk4">CenteredTimeCenteredSpace or CrankNicholson</Text-field>The centered time centered space method is an implicit single stage method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with mixed partial derivatives.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JCokSSJoR0YoIiIjKiRJImtHRihGLA== accurate.PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are second order in space require no numerical boundary conditions, but still require the same number of conditions on each boundary.This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is the result of applying central differencing to the PDE about the point NiQsJkkidEc2IiIiIkkia0dGJSNGJiIiIyZJInhHRiU2I0kiaUdGJQ== using NiMsJiIiIkYkLUklY2VpbEc2JEkqcHJvdGVjdGVkR0YoSShfc3lzbGliRzYiNiMsJEkleG9yZEdGKiNGJCIiI0Yv points (that is, the mesh uses NiMtSSVjZWlsRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2IywkSSV4b3JkR0YoIyIiIiIiIw== points on either side of the center).
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk5">BackwardTimeCenteredSpace or BackwardEuler</Text-field>The backward time centered space method is an implicit method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with mixed partial derivatives.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JCokSSJoR0YoIiIjSSJrR0Yo accurate.PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are second order in space require no numerical boundary conditions, but still require the same number of conditions on each boundary.This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is the result of applying central differencing to the PDE about the point NiQsJkkidEc2IiIiIkkia0dGJUYmJkkieEdGJTYjSSJpR0Yl using NiMsJiIiIkYkLUklY2VpbEc2JEkqcHJvdGVjdGVkR0YoSShfc3lzbGliRzYiNiMsJEkleG9yZEdGKiNGJCIiI0Yv points (that is, the mesh uses NiMtSSVjZWlsRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2IywkSSV4b3JkR0YoIyIiIiIiIw== points on either side of the center). For PDEs having no mixed partial derivatives, the only point in the discretization that is at the current time step is NiMmSSJ1RzYiNiQiIiFJImlHRiU=, all other points are of the form LUklbXJvd0c2JEkqcHJvdGVjdGVkR0YlL0krbW9kdWxlbmFtZUc2IkksVHlwZXNldHRpbmdHNiRGJUkoX3N5c2xpYkdGKDYpLUkjbWlHNiRGJS9GJ0YpNiNRInVGKC1JI21vRzYkRiUvRidGKTYjUSJbRigtSSNtbkc2JEYlL0YnRik2I1EiMUYoLUY0NiNRKCZjb21tYTtGKC1GNDYjUTEmSW52aXNpYmxlVGltZXM7RigtRjQ2I1EmJmFzdDtGKC1GNDYjUSJdRig=.
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk6">Box</Text-field>The box method is an implicit single stage method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with mixed partial derivatives.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JCokSSJoR0YoIiIjKiRJImtHRihGLA== accurate.The method uses a spatial mesh with an even number of points, so necessarily one boundary must have one condition more than the other. Since the method is symmetric (would be no different if one boundary had the extra condition versus the other) the method is automatically adjusted to accommodate the boundary conditions.PDEs that are even order in space require one additional numerical boundary condition, while PDEs that are odd order in space require no numerical boundary conditions.This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is different depending if the extra boundary condition (or numerical boundary condition for even order problems) is given at the left or right boundaries. If the extra condition is on the left, the scheme can be obtained through application of central differencing of the PDE about the point NiQsJkkidEc2IiIiIkkia0dGJSNGJiIiIywmJkkieEdGJTYjSSJpR0YlRiZJImhHRiUjISIiRik= using NiMsJiIiIkYkLUkmZmxvb3JHNiRJKnByb3RlY3RlZEdGKEkoX3N5c2xpYkc2IjYjLCRJJXhvcmRHRiojRiQiIiNGJA== points to the left of NiNJImlHNiI=, and NiMtSSZmbG9vckc2JEkqcHJvdGVjdGVkR0YmSShfc3lzbGliRzYiNiMsJEkleG9yZEdGKCMiIiIiIiM= points to the right. If the extra condition is on the right, the scheme can be obtained through application of central differencing of the PDE about the point NiQsJkkidEc2IiIiIkkia0dGJSNGJiIiIywmJkkieEdGJTYjSSJpR0YlRiZJImhHRiVGKA== using NiMtSSZmbG9vckc2JEkqcHJvdGVjdGVkR0YmSShfc3lzbGliRzYiNiMsJEkleG9yZEdGKCMiIiIiIiM= points to the left of NiNJImlHNiI=, and NiMsJiIiIkYkLUkmZmxvb3JHNiRJKnByb3RlY3RlZEdGKEkoX3N5c2xpYkc2IjYjLCRJJXhvcmRHRiojRiQiIiNGJA== points to the right.
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk7">LaxFriedrichs</Text-field>The Lax-Friedrichs method is an explicit single stage method that can be used to find solutions to PDEs that are first order in time, and odd order in space, with no mixed partial derivatives.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JSokSSJoR0YoIiIjSSJrR0YoKiYpRissJC1JJWNlaWxHNiRGJkYnNiMsJEkleG9yZEdGKCMiIiJGLEYsRjhGLSEiIg== accurate. Note: The method can be applied to PDEs with odd order in space, but the stability requirement (see below) forces the error to be NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2IyIiIg== due to the NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2IyomKUkiaEdGKCwkLUklY2VpbEc2JEYmRic2IywkSSV4b3JkR0YoIyIiIiIiI0Y2RjVJImtHRighIiI= term.PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are second order in space require no numerical boundary conditions, but do require the same number of conditions on each boundary.As this is an explicit scheme, stability imposes a restriction on the time step of the problem relative to the space step. For PDEs that are odd order in space, stability requires a restriction of the form NiMySSJrRzYiKiZJImFHRiUiIiIpSSJoR0YlSSV4b3JkR0YlRig= for some NiNJImFHNiI= depending upon the problem. When this condition is combined with the accuracy of the method, the error is discovered to be LUklbXJvd0c2JEkqcHJvdGVjdGVkR0YlL0krbW9kdWxlbmFtZUc2IkksVHlwZXNldHRpbmdHNiRGJUkoX3N5c2xpYkdGKDYlLUkjbWlHNiRGJS9GJ0YpNiNRIk9GKC1JI21vRzYkRiUvRidGKTYjUTAmQXBwbHlGdW5jdGlvbjtGKC1JKG1mZW5jZWRHNiRGJS9GJ0YpNiMtRiM2LC1JJW1zdXBHNiRGJS9GJ0YpNiQtRiM2Iy1GLjYjUSJoRigtRiM2Iy1JI21uRzYkRiUvRidGKTYjUSIyRigtRjQ2I1EoJmNvbW1hO0YoLUYuNiNRImFGKC1GNDYjUSInRigtRjQ2I1ExJkludmlzaWJsZVRpbWVzO0YoRmVuLUZBNiRGRS1GIzYjLUYuNiNRJXhvcmRGKEZSLUkmbWZyYWNHNiRGJS9GJ0YpNiRGRS1GIzYkRlVGWEZlbg==, or simply NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2I0kiaEdGKA== when LUklbXJvd0c2JEkqcHJvdGVjdGVkR0YlL0krbW9kdWxlbmFtZUc2IkksVHlwZXNldHRpbmdHNiRGJUkoX3N5c2xpYkdGKDYvLUkjbWlHNiRGJS9GJ0YpNiNRImtGKC1JI21vRzYkRiUvRidGKTYjUSkmZXF1YWxzO0YoLUYuNiNRImFGKC1GNDYjUSInRigtRjQ2I1ExJkludmlzaWJsZVRpbWVzO0YoRj8tSSVtc3VwRzYkRiUvRidGKTYkLUYjNiMtRi42I1EiaEYoLUYjNiMtRi42I1EleG9yZEYoLUY0NiNRKCZjb21tYTtGKEY5RjxGPy1GNDYjUSUmbHQ7RihGOQ==.The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is identical to that of the Euler scheme with the exception that the value NiMmSSJ1RzYiNiQiIiFJImlHRiU= is replaced by the interpolation of the value at NiMmSSJ1RzYiNiQiIiFJImlHRiU= using all other points in the Euler stencil NiMmSSJ1RzYiNiQiIiFJImpHRiU= where NiMwSSJqRzYiSSJpR0Yl.
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk8">LaxWendroff</Text-field>The Lax-Wendroff method is an explicit single stage method that can be used to find solutions to linear PDEs that are first order in time and space.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JSokSSJoR0YoIiIjKiZJImtHRigiIiJGK0YvKiRGLkYs accurate.The Lax-Wendroff method always requires a numerical boundary condition so that one boundary condition is specified for each boundary.As this is an explicit scheme, stability requires a restriction of the form NiMySSJrRzYiKiZJImFHRiUiIiJJImhHRiVGKA== for some NiNJImFHNiI= depending upon the problem.The derivation of this scheme is complex, and involves computing difference schemes of derivatives of the input PDE, (which results in the linearity restriction), but is available in many standard textbooks.
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk9">Leapfrog</Text-field>The Leapfrog method is an explicit two stage method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with no mixed partial derivatives.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JCokSSJoR0YoIiIjKiRJImtHRihGLA== accurate, and as it is a two stage method, a startup method must be used.PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are even order in space require no numerical boundary conditions, but still require the same number of conditions on each boundary.As this is an explicit scheme, stability imposes a restriction on the time step of the problem relative to the space step. In general, this scheme is unstable for PDEs where NiNJJXhvcmRHNiI= is even. For PDEs that are odd order in space, stability requires a restriction of the form NiMySSJrRzYiKiZJImFHRiUiIiIpSSJoR0YlSSV4b3JkR0YlRig= for some NiNJImFHNiI= depending upon the problem.The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== uses the formulaNiMvJkkidUc2IjYjSSJ0R0YmLCQqJiwmJkYlNiQiIiJJImlHRiZGLiZGJTYkISIiRi9GMkYuSSJrR0YmRjIjRi4iIiM=for the time derivative, and uses central differencing over NiMsJiIiIkYkLUklY2VpbEc2JEkqcHJvdGVjdGVkR0YoSShfc3lzbGliRzYiNiMsJEkleG9yZEdGKiNGJCIiI0Yv points to compute all spatial derivatives.
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk10">DuFortFrankel</Text-field>The DuFort-Frankel method is an explicit two stage method that can be used to find solutions to linear PDEs that are first order in time, and even order in space, with no mixed partial derivatives. In some cases it can be used to find solutions of nonlinear PDEs.The method is NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2JSokSSJoR0YoIiIjKiRJImtHRihGLComRi5GLClGKywkLUklY2VpbEc2JEYmRic2IywkSSV4b3JkR0YoIyIiIkYsRiwhIiI= accurate, and as it is a two stage method, a startup method must be used. Note: The method can be applied to PDEs with odd order in space, but the stability requirement (see below) forces the error to be NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2IyIiIg== due to the NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2IyomSSJrR0YoIiIjKUkiaEdGKCwkLUklY2VpbEc2JEYmRic2IywkSSV4b3JkR0YoIyIiIkYsRiwhIiI= term. Note, however, that if no even order derivatives appear in the PDE at all, then the resulting scheme is identical to the scheme generated by the Leapfrog method for the same PDE, so in that case those comments apply.Since this method is restricted to PDEs that are even order in space, no numerical boundary conditions are required, but the number of conditions on each boundary must be the same.As this is an explicit scheme, stability imposes a restriction on the time step of the problem relative to the space step. The restriction is of the form NiMySSJrRzYiKiZJImFHRiUiIiIpSSJoR0YlSSV4b3JkR0YlRig= for some NiNJImFHNiI= depending upon the problem. When this condition is combined with the accuracy of the method, the error is discovered to be LUklbXJvd0c2JEkqcHJvdGVjdGVkR0YlL0krbW9kdWxlbmFtZUc2IkksVHlwZXNldHRpbmdHNiRGJUkoX3N5c2xpYkdGKDYlLUkjbWlHNiRGJS9GJ0YpNiNRIk9GKC1JI21vRzYkRiUvRidGKTYjUTAmQXBwbHlGdW5jdGlvbjtGKC1JKG1mZW5jZWRHNiRGJS9GJ0YpNiMtRiM2KC1JJW1zdXBHNiRGJS9GJ0YpNiQtRiM2Iy1GLjYjUSJoRigtRiM2Iy1JI21uRzYkRiUvRidGKTYjUSIyRigtRjQ2I1EoJmNvbW1hO0YoLUYuNiNRImFGKC1GQTYkLUY0NiNRIidGKEZMLUY0NiNRMSZJbnZpc2libGVUaW1lcztGKC1GQTYkRkUtRiM2Iy1GLjYjUSV4b3JkRig=, or simply NiMtSSJPRzYkSSpwcm90ZWN0ZWRHRiZJKF9zeXNsaWJHNiI2IyokSSJoR0YoIiIj when LUklbXJvd0c2JEkqcHJvdGVjdGVkR0YlL0krbW9kdWxlbmFtZUc2IkksVHlwZXNldHRpbmdHNiRGJUkoX3N5c2xpYkdGKDYvLUkjbWlHNiRGJS9GJ0YpNiNRImtGKC1JI21vRzYkRiUvRidGKTYjUSkmZXF1YWxzO0YoLUYuNiNRImFGKC1GNDYjUSInRigtRjQ2I1ExJkludmlzaWJsZVRpbWVzO0YoRj8tSSVtc3VwRzYkRiUvRidGKTYkLUYjNiMtRi42I1EiaEYoLUYjNiMtRi42I1EleG9yZEYoLUY0NiNRKCZjb21tYTtGKEY5RjxGPy1GNDYjUSUmbHQ7RihGOQ==.The scheme used to compute the value at the mesh point NiM3JCIiIkkiaUc2Ig== is identical to that of the Leapfrog scheme with the exception that the value NiMmSSJ1RzYiNiQiIiFJImlHRiU= is replaced by the average of the values NiMmSSJ1RzYiNiQiIiJJImlHRiU= and NiMmSSJ1RzYiNiQhIiJJImlHRiU= for all occurrences in the scheme.
<Text-field style="Heading 3" layout="Heading 3" bookmark="bkmrk11">Constructing a Custom Method</Text-field>Construction of a new method or scheme for use by pdsolve is somewhat involved, and requires some basic Maple programming knowledge. In essence, you must construct a routine that derives the desired method for an arbitrary point NiMtSShtZmVuY2VkRzYkSSpwcm90ZWN0ZWRHRiYvSSttb2R1bGVuYW1lRzYiSSxUeXBlc2V0dGluZ0c2JEYmSShfc3lzbGliR0YpNiYtSSNtbkc2JEYmL0YoRio2I1EiMUYpLUkjbWlHNiRGJi9GKEYqNiNRJSZ4aTtGKS9JJW9wZW5HRilRJyZsc3FiO0YpL0kmY2xvc2VHRilRJyZyc3FiO0Yp, for an input PDE, and returns that information, and information on the method itself in the entries of an input table.Construction of new methods has the following limitations.- The PDE must be first order in time.- The scheme cannot use more than two additional stages.- The time and space step sizes are constant.- The scheme cannot use discrete values of the space variable that are outside the stencil of the method.The following is the code for the CenteredTime1Space method and is used as an example to describe what is needed.

`pdsolve/numeric/findif/CenteredTime1Space` := proc( PDE, # The PDE to be discretized u, # The dependent variable, with dependencies (e.g. u(x,t)) x, # The space independent variable t, # The time independent variable v, # The name to be used for discretization, v[timeidx,spaceidx] ix, # The value of the central space index h, # The space step size (symbolic) k, # The time step size (symbolic) parms, # List of additional parameters for the method (the index # for the 'method' argument. # e.g. for "method=CenteredTime1Space[forward]" the list # is ['forward']. INFO) # Input/Output table of informationlocal sb; # First validate that this method works for the input PDE if INFO["timeord"]<>1 or INFO["spaceord"]<>1 then error("The CenteredTime1Space scheme can only be used with first-order PDE"); elif parms=[] or not member(parms,{['forward'],['backward']}) then error("The CenteredTime1Space scheme requires a parameter, 'forward' or 'backward'"); end if; # Set output parameters INFO["directional"] := true; # Now compute the discretization of derivatives that may # appear in the PDE sb := diff(u,t)=(v[1,ix]-v[0,ix])/k,u=(v[1,ix]+v[0,ix])/2; if parms=['forward'] then sb := sb,diff(u,x)=(v[1,ix+1]-v[1,ix] + v[0,ix+1]-v[0,ix])/2/h, diff(u,x,t)=(v[1,ix+1]-v[1,ix]-v[0,ix+1]+v[0,ix])/k/h; else sb := sb,diff(u,x)=(v[1,ix]-v[1,ix-1] + v[0,ix]-v[0,ix-1])/2/h, diff(u,x,t)=(v[1,ix]-v[1,ix-1]-v[0,ix]+v[0,ix-1])/k/h; end if; # Now evaluate the PDE with respect to the discretization schemes and # adjust explicit occurrences of the time/space variables eval(PDE,{sb,x=x[ix],t=t+k/2});end proc:

Input DataThe input data is fairly well described by the comments present in the parameter list of the example, only a few items need be discussed.The name of the procedure for the method must be of the form `pdsolve/numeric/findif/<method name>`, as pdsolve checks for the presence of the routine based on the argument of the 'method' option.The input PDE is an expression (not an equation) that is equivalent to the PDE being numerically solved by pdsolve. If the input to pdsolve is an equation, it is converted to an expression. It is converted to diff notation (not operator notation), so if NiMtLSZJIkRHNiRJKnByb3RlY3RlZEdGKEkoX3N5c2xpYkc2IjYjIiIiNiNJInVHRio2JEkieEdGKkkidEdGKg== is present in the input PDE, this routine sees NiMtSSVkaWZmR0kqcHJvdGVjdGVkR0YlNiQtSSJ1RzYiNiRJInhHRilJInRHRilGKw== instead.The NiMuSSJ2RzYi input is the base name that should be used to construct the indexed names for the discretization, that is, the value at the mesh point NiM3JCIiIkkjaXhHNiI= should be denoted as NiMmSSJ2RzYiNiQiIiJJI2l4R0Yl.The returned expression is to be used to compute the discrete solution value at NiMmSSJ2RzYiNiQiIiJJI2l4R0Yl, where NiMuSSNpeEc2Ig== is the input parameter.The INFO table has entries that can be used to more easily determine if the method being derived is valid for the input PDE and is also used to output certain information about the discretization. In addition, the NiNRLGRpcmVjdGlvbmFsNiI= flag can be set as output.The INFO table has the following entries that can be used by this routine."timeord"The INFO["timeord"] entry holds an integer giving the differential order of the PDE with respect to the time variable."spaceord"The INFO["spaceord"] entry holds an integer giving the differential order of the PDE with respect to the space variable."mixed"The INFO["mixed"] entry holds boolean value indicating if mixed partial derivatives are present in the PDE."directional"The INFO["directional"] flag should be set to 'true' by the routine for any implicit methods where the specific solving unknown is important. Otherwise, numeric may shift the method depending on the location of the boundary conditions. If not set, it is assumed to be false.For example, the Box method applied to a first order PDE is of the same form if the boundary condition is given on the left, as if the boundary condition is given on the right. As a result, for this scheme, INFO["directional"] should be false (the default).Note: Explicit methods have INFO["directional"] set to true automatically, as there is only ever one discrete dependent variable value present in the scheme for a future time step.The rest is fairly straightforward. The routine should generate a difference scheme for the PDE, and the only unknowns present in the scheme should be the value of the dependent variable at mesh points, NiMmSSJ2RzYiNiRJKHRpbWVpZHhHRiVJKXNwYWNlaWR4R0Yl, the step sizes NiRJImhHNiJJImtHRiQ=, the time value at the 0 time step NiNJInRHNiI=, and the space value on the mesh NiMmSSJ4RzYiNiNJKXNwYWNlaWR4R0Yl.Additional NotesThe value of NiMuSSJ0RzYi used in the application of the output scheme is as at the NiMiIiE= time step, that is, if the discretization is to be used to compute the discrete solution values at NiMvSSJ0RzYiLCZJI3R2R0YlIiIiSSJrR0YlRig=, the time value NiNJInRHNiI= used in computing with the scheme would be NiNJI3R2RzYi. This means that schemes that are derived as differences at half mesh points or backward schemes that use the time value at the NiMuSSdmdXR1cmVHNiI= solution point must adjust the NiNJInRHNiI= value in the output scheme. In the latter case this can be accomplished by setting NiNJInRHNiI= to NiMsJkkidEc2IiIiIkkia0dGJUYm.The pdsolve command performs well for a direct discretization of the PDE, due to the optimization settings, so use of NiNJJ2V4cGFuZEdJKnByb3RlY3RlZEdGJA== or NiNJJ25vcm1hbEdJKnByb3RlY3RlZEdGJA== on the discretized PDE within the method procedure can degrade performance. It is best to experiment with this when writing a custom method.See Alsopdsolvepdsolve/numericpdsolve/numeric/educationpdsolve/numeric/method