### 数学代写|数值方法作业代写numerical methods代考|Common Schemes

statistics-lab™ 为您的留学生涯保驾护航 在代写数值方法numerical methods方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写数值方法numerical methods代写方面经验极为丰富，各种代写数值方法numerical methods相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 数学代写|数值方法作业代写numerical methods代考|Common Schemes

We now introduce a number of important and useful difference schemes that approximate the solution of Equation (2.1). These schemes will pop up all over the place in later chapters. Understanding how the schemes work in a simpler context will help you appreciate them when we tackle partial differential equations based on the Black-Scholes model. They also help in our understanding of notation, jargon, and syntax.
The main schemes are:

• Explicit Euler
• Implicit Euler
• Crank-Nicolson (or Box scheme)
• The trapezoidal method.
The explicit Euler method is given by:
\begin{aligned} &\frac{u^{n+1}-u^{n}}{k}+a^{n} u^{n}=f^{n}, n=0, \ldots, N-1 \ &u^{0}=A \end{aligned}

whereas the implicit Euler method is given by:
\begin{aligned} &\frac{u^{n+1}-u^{n}}{k}+a^{n+1} u^{n+1}=f^{n+1}, n=0, \ldots, N-1 \ &u^{0}=A \end{aligned}
Notice the difference: in Equation (2.10) the solution at level $n+1$ can be directly calculated in terms of the solution at level $n$, while in Equation (2.11) we must rearrange terms in order to calculate the solution at level $n+1$.

The next scheme is called the Crank-Nicolson or box scheme, and it can be seen as an average of explicit and implicit Euler schemes. It is given as (see notation in Equation (2.7)):
$\frac{u^{n+1}-u^{n}}{k}+a^{n, \frac{1}{2}} u^{n, \frac{1}{2}}=f^{n, \frac{1}{2}}, n=0, \ldots, N-1$ $u^{0}=A$ where $u^{n, \frac{1}{2}} \equiv \frac{1}{2}\left(u^{n}+u^{n+1}\right)$
It is useful to know that the three schemes can be merged into one generic scheme as it were by introducing a parameter $\theta$ (the scheme is sometimes called the Theta method):
\begin{aligned} &L(k) u^{n} \equiv \frac{u^{n+1}-u^{n}}{k}+a^{n, \theta} u^{n, \theta}=f^{n, \theta} \ &u^{n, \theta} \equiv \theta u^{n}+(1-\theta) u^{n+1}, 0 \leq \theta \leq 1 \ &f^{n, \theta} \equiv f\left(\theta t_{n}+(1-\theta) t_{n+1}\right) \end{aligned}
and the special cases are given by:
\begin{aligned} &\theta=1, \text { explicit Euler } \ &\theta=0, \text { implicit Euler } \ &\theta=\frac{1}{2}, \text { Crank-Nicolson. } \end{aligned}
The solution of Equation (2.13) is given by:
$$u^{n+1, \theta} \equiv u^{n+1,}=\frac{\left(1-k \theta a^{n, \theta}\right) u^{n}+k f^{n, \theta}}{1+k(1-\theta) a^{n, \theta}} .$$
This equation is useful because it can be mapped to $\mathrm{C}++$ code and will be used by other schemes by defining the appropriate value of the parameter $\theta$.

## 数学代写|数值方法作业代写numerical methods代考|Discrete Maximum Principle

Having developed some difference schemes, we would like to have a way of determining if the discrete solution is a good approximation to the exact solution in some sense. Although we do not deal with this issue in great detail, we do look at stability and convergence issues.

Definition 2.1 The one-step difference scheme $L(k)$ of the form (2.13) is said to be positive if:
$$L(k) w^{n} \geq 0, n=0, \ldots, N-1, w^{0} \geq 0$$
implies that $w^{n} \geq 0 \forall n=0, \ldots, N$. Here, $w^{n}$ is a mesh function defined at the mesh points $t_{n}$.

Based on this definition, we see that the implicit Euler scheme is always positive while the explicit Euler scheme is positive if the term:
$$1-k a^{n} \geq 0 \text { or } k \leq \frac{1}{a^{n}}, n \geq 0$$
is positive. Thus, if the function $a(t)$ achieves large values (and this happens in practice), we will have to make $k$ very small in order to produce good results. Even worse, if $k$ does not satisfy the constraint in (2.18) then the discrete solution looks nothing like the exact solution, and so-called spurious oscillations occur. This phenomenon occurs in other finite difference schemes, and we propose a number of remedies later in this book.
Definition $2.2$ A difference scheme is stable if its solution is based in much the same way as the solution of the continuous problem (2.1) (see Theorem 2.1), that is:
$$\left|u^{n}\right| \leq \frac{N}{\alpha}+|A|, \quad n \geq 0$$
where:
$$a\left(t_{n}\right) \geq \alpha, n \geq 0,\left|f\left(t_{n}\right)\right| \leq N, n \geq 0$$
and:
$$u^{0}=A$$

Based on the fact that a scheme is stable and consistent (see Dahlquist and Björck (1974)), we can state in general that the error between the exact and discrete solutions is bounded by some polynomial power of the step-size $k$ :
$$\left|u^{n}-u\left(t_{n}\right)\right| \leq M k^{p}, \quad p=1,2, \ldots, n \geq 0$$
where $M$ is a constant that is independent of $k$. For example, in the case of schemes $2.10$, $2.11$ and $2.12$ we have:
Implicit Euler: $\left|u^{n}-u\left(t_{n}\right)\right| \leq M k, n=0, \ldots, N$
Crank-Nicolson (Box): $\left|u^{n}-u\left(t_{n}\right)\right| \leq M k^{2}, n=0, \ldots, N$
Explicit Euler: $\left|u^{n}-u\left(t_{n}\right)\right| \leq M k, n=0, \ldots, N$ if $1-a^{n} k>0$.
Thus, we see that the Box method is second-order accurate and is better than the implicit Euler scheme, which is only first-order accurate.

## 数学代写|数值方法作业代写numerical methods代考|Exponential Fitting

We now introduce a special class of schemes with desirable properties. These are schemes that are suitable for problems with rapidly increasing or decreasing solutions. In the literature these are called stiff or singular perturbation problems (see Duffy (1980)). We can motivate these schemes in the present context. Let us take the problem (2.1) when $a(t)$ is constant and $f(t)$ is zero. The solution $u(t)$ is given by a special case of (2.2), namely:
$$u(t)=A e^{-a t} .$$
If $a$ is large then the derivatives of $u(t)$ tend to increase; in fact, at $t=0$, the derivatives are given by:
$$\frac{d^{k} u(0)}{d t^{k}}=A(-a)^{k}, \quad k=0,1,2, \ldots$$
The physical interpretation of this fact is that a boundary layer exits near $t=0$ where $u$ is changing rapidly, and it has been shown that classical finite difference schemes fail to give acceptable answers when $a$ is large (typically values between 1000 and 10000). We get so-called spurious oscillations, and this problem is also encountered when solving one-factor and multifactor Black-Scholes equations using finite difference methods. We have resolved this problem using so-called exponentially fitted schemes. We motivate the scheme in the present context, and later chapters describe how to apply it to more complicated cases.

In order to motivate the fitted scheme, consider the case of constant $a(t)$ and $f(t)=0$. We wish to produce a difference scheme in such a way that the discrete solution is equal to the exact solution at the mesh points for this constant-coefficient case. We introduce a so-called fitting factor $\sigma$ in the new scheme:
$$\left{\begin{array}{l} \sigma\left(\frac{u^{n+1}-u^{n}}{k}\right)+a^{n, \theta} u^{n, \theta}=f^{n, \theta}, n=0, \ldots, N-1,0 \leq \theta \leq 1 \ u^{0}=A . \end{array}\right.$$
The motivation for finding the fitting factor is to demand that the exact solution of (2.1) (which is known) has the same values as the discrete solution of (2.24) at the mesh points.

Plugging the exact solution (2.22) into $(2.24)$ and doing some simple arithmetic, we get the following representation for the fitting factor $\sigma$ :
$$\sigma=\frac{a k\left(\theta+(1-\theta) e^{-a k}\right)}{1-e^{-a k}}$$
Having found the fitting factor for the constant coefficient case, we generalise to a scheme for the case (2.1) as follows:
\begin{aligned} &\sigma^{n, \theta} \frac{u^{n+1}-u^{n}}{k}+a^{n, \theta} u^{n, \theta}=f^{n, \theta}, n=0, \ldots, N-1,0 \leq \theta \leq 1 \ &u^{0}=A \ &\sigma^{n, \theta}=\frac{a^{n, \theta}\left(\theta+(1-\theta) e^{-a^{n, \theta} k}\right)}{1-e^{-a^{n}, \theta_{k}}} k . \end{aligned}
In practice we work with a number of special cases:
In the final case coth $(x)$ is the hyperbolic cotangent function.

## 数学代写|数值方法作业代写numerical methods代考|Common Schemes

• 显式欧拉
• 隐式欧拉
• Crank-Nicolson（或 Box 方案）
• 梯形法。
显式欧拉方法由下式给出：
在n+1−在nķ+一种n在n=Fn,n=0,…,ñ−1 在0=一种

θ=1, 显式欧拉  θ=0, 隐式欧拉  θ=12, 曲柄-尼科尔森。

## 数学代写|数值方法作业代写numerical methods代考|Discrete Maximum Principle

1−ķ一种n≥0 或者 ķ≤1一种n,n≥0

|在n|≤ñ一种+|一种|,n≥0

|在n−在(吨n)|≤米ķp,p=1,2,…,n≥0

## 数学代写|数值方法作业代写numerical methods代考|Exponential Fitting

dķ在(0)d吨ķ=一种(−一种)ķ,ķ=0,1,2,…

$$\left{σ(在n+1−在nķ)+一种n,θ在n,θ=Fn,θ,n=0,…,ñ−1,0≤θ≤1 在0=一种.\对。$$

σ=一种ķ(θ+(1−θ)和−一种ķ)1−和−一种ķ

σn,θ在n+1−在nķ+一种n,θ在n,θ=Fn,θ,n=0,…,ñ−1,0≤θ≤1 在0=一种 σn,θ=一种n,θ(θ+(1−θ)和−一种n,θķ)1−和−一种n,θķķ.

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。