### 数学代写|微分方程代写differential equation代考|MATH2021

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

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• Advanced Probability Theory 高等概率论
• Advanced Mathematical Statistics 高等数理统计学
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 数学代写|微分方程代写differential equation代考|Numerical Methods

The first method to numerically simulate the diffusion equation is one that we have already used, namely the method of lines. With this method, we discretize the spatial region into a grid with points at $x_{j}=j \Delta x$, $j=0,1, \ldots, N$, and then write the diffusion equation approximately as the system of ordinary differential equations
$$\frac{d u_{j}}{d t}=\frac{D}{\Delta x^{2}}\left(u_{j+1}-2 u_{j}+u_{j-1}\right) .$$
At the endpoints, take the equations to be
$$\frac{d u_{0}}{d t}=\frac{2 D}{\Delta x^{2}}\left(u_{1}-u_{0}\right), \quad \frac{d u_{N}}{d t}=\frac{2 D}{\Delta x^{2}}\left(u_{j-1}-u_{N}\right) .$$
This choice follows from the approximation to the derivative of $u,\left.\frac{\partial u}{\partial x}\right|{x=j \Delta x} \approx \frac{u{j+1}-u_{j-1}}{2 \Delta x}$, so at the boundaries the zero derivative (Neumann) boundary condition implies that $u_{-1}=u_{1}$, and $u_{N+1}=u_{N-1}$. (The points at $j=-1$ and $j=N+1$ are called ghost points and are useful for this calculation, but are never actually computed.)

This system of equations is then simulated using a numerical ordinary differential equation solver. The Matlab code for this for Neumann or Robin boundary conditions is titled Diffusion_NK_via_MUL.m and for Dirichlet boundary conditions is titled Diffusion_Dirichlet_via_MOL.m.

It is convenient for future discussions to represent $u(j \Delta x, t)$ as a vector $\mathbf{u}(t)=\left(u_{j}\right)$, and then to rewrite (5.37) using vector/matrix notation as
$$\frac{d \mathbf{u}}{d t}=\frac{D}{\Delta x^{2}} A \mathbf{u}$$
where the matrix $A$ has diagonal elements $-2$, and first upper and lower off-diagonal elements 1 , except the first element of the upper diagonal and last element of the lower diagonal are both 2, i.e.,
$$A=\left(\begin{array}{ccccc} -2 & 2 & 0 & \cdots & 0 \ 1 & -2 & 1 & 0 & \cdots \ & & \vdots & & \ 0 & \cdots & 1 & -2 & 1 \ 0 & \cdots & 0 & 2 & -2 \end{array}\right)$$

## 数学代写|微分方程代写differential equation代考|Other Boundary Conditions

Everything discussed in the previous section was for Neumann boundary conditions. However, the only difference for the numerical methods with different boundary conditions is with the definition of the corner entries of the matrix $A$. For homogeneous Robin boundary conditions (5.23), we write the approximations
$$D\left(\frac{u_{1}-u_{-1}}{2 \Delta x}\right)=\delta u_{0}, \quad-D\left(\frac{u_{N+1}-u_{N-1}}{2 \Delta x}\right)=\delta u_{N}$$
which when substituted into the finite difference approximation of the diffusion equation (5.37) yields
$$\frac{d u_{0}}{d t}=\frac{D}{\Delta x^{2}}\left(2 u_{1}-2\left(1+\frac{\delta \Delta x}{D}\right) u_{0}\right)$$
$$\frac{d u_{N}}{d t}=\frac{D}{\Delta x^{2}}\left(2\left(-1-\frac{\delta \Delta x}{D}\right) u_{N}+2 u_{N-1}\right) .$$
This implies that the matrix $A$ in (5.40) needs to be modified slightly to have first and last diagonal elements
$$A_{1,1}=-2-2 \frac{\delta \Delta x}{D}, \quad A_{N+1, N+1}=-2-2 \frac{\delta \Delta x}{D}$$
For homogeneous Dirichlet boundary conditions, the unknown variables are $u_{j}$, $j=1,2, \ldots, u_{N-1}$, (two less than for Neumann and Robin conditions) and the finite difference approximation (5.37) for $u_{1}$ and $u_{N ~}$
$$\text { (5.56) } \frac{d u_{1}}{d t}=\frac{D}{\Delta x^{2}}\left(u_{2}-2 u_{1}\right), \quad \frac{d u_{N-1}}{d t}=\frac{D}{\Delta x^{2}}\left(-2 u_{N-1}+u_{N-2}\right)$$
(since $u_{0}=u_{N}=0$ ) and consequently, the matrix $A$ (which is now an $N-1 \times N-1$ matrix) is
$$A=\left(\begin{array}{ccccc} -2 & 1 & 0 & \cdots & 0 \ 1 & -2 & 1 & 0 & \cdots \ & & \vdots & & \ 0 & \cdots & 1 & -2 & 1 \ 0 & \cdots & 0 & 1 & -2 \end{array}\right)$$
For Dirichlet boundary conditions, the Matlab codes are FEuler_diffusion_dirichlet.m, BEuler_diffusion_Dirichlet.m, and CN_diffusion_Dirichlet.m for forward Euler, backward Euler, and Crank-Nicolson methods, respectively.

## 数学代写|微分方程代写differential equation代考|Birth-Death with Diffusion

Suppose that there is some population or chemical species $U$ that diffuses on an infinite domain and experiences either decay, as in
$$U \stackrel{\alpha}{\longrightarrow} \emptyset,$$
or birth via asexual duplication as in
$$U \stackrel{\alpha}{\longrightarrow} 2 U$$
Setting $u=[U]$, the equation describing the evolution of this population is
$$\frac{\partial u}{\partial t}=D \frac{\partial^{2} u}{\partial x^{2}}+\sigma \alpha u,$$
where $\alpha>0, \sigma=-1$ for decay, and $\sigma=1$ for growth.
As an example, suppose that signaling molecules are produced at some point, and that the target of the signal is some distance away. Specifically, many copies of a transcription factor may be made when only one is needed to activate transcription of a gene. What percentage, if any, of the signaling molecules reach the target before they degrade? Roughly $10^{8}$ sperm cells are initially released to reach the oocyte in human fertilization when only one is required. What are the consequences of releasing fewer sperm cells? This could also be a model to determine the distribution of seeds falling

to the ground after release from a seed pod into the air. This seed dispersal problem is discussed more in Chapter $13 .$

Let’s begin our study of this problem of diffusion with decay with a stochastic simulation. To do this, we modify the algorithm from Chapter 4 that simulates diffusing particles to account for the possibility of degradation. At each time step, the particle can move or degrade, and if it degrades, its motion is terminated. The Matlab code to implement this is titled decay_probability.m, and the result of a simulation is shown in Figure 6.1. What we see in this figure may be a bit surprising; the distribution of decay position is clearly not a Gaussian distribution. But what is it?

## 数学代写|微分方程代写differential equation代考|Numerical Methods

d在jd吨=DΔX2(在j+1−2在j+在j−1).

d在0d吨=2DΔX2(在1−在0),d在ñd吨=2DΔX2(在j−1−在ñ).

d在d吨=DΔX2一个在

## 数学代写|微分方程代写differential equation代考|Other Boundary Conditions

D(在1−在−12ΔX)=d在0,−D(在ñ+1−在ñ−12ΔX)=d在ñ

d在0d吨=DΔX2(2在1−2(1+dΔXD)在0)

d在ñd吨=DΔX2(2(−1−dΔXD)在ñ+2在ñ−1).

(5.56) d在1d吨=DΔX2(在2−2在1),d在ñ−1d吨=DΔX2(−2在ñ−1+在ñ−2)
（自从在0=在ñ=0)，因此，矩阵一个（现在是一个ñ−1×ñ−1矩阵）是

## 数学代写|微分方程代写differential equation代考|Birth-Death with Diffusion

∂在∂吨=D∂2在∂X2+σ一个在,

## 有限元方法代写

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 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。