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

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

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

## 数学代写|微分方程代写differential equation代考|Following Individual Particles

It may be that one is interested in following a single diffusing object. To do this, we make use of a fact about Brownian motion (which is the name for this process). Suppose one were able to precisely follow a particle and collect large amounts of data on its change of position, denoted $d x$, in a fixed time increment $d t$. Recall from above that the solution of the diffusion equation has the feature that the expected value of position of a particle is unchanging in time while the variance of position grows linearly in time with rate $2 D$. What this means for a fixed (small) time increment $d t$ is that $d x$ is random but distributed according to
$$d x=\sqrt{2 D d t} \mathcal{N}(0,1) .$$
In other words, $d x$ is a continuous random variable that is normally distributed with mean zero and variance 2 Ddt. The equation (4.1) is is called a stochastic differential equation as it specifies the change of position of the particle as a stochastic process, not as a deterministic process.

This, then, gives a formula for how to simulate a diffusion process. Specifically, let the position of the particle after $n$ time steps be denoted by $x_{n}$. Then, $x_{n}$ is updated by the formula
$$x_{n+1}=x_{n}+d x_{n},$$
where $d x_{n}$ is a random number chosen according to (4.1). The Matlab code that carries this out is entitled single_particle_diffusion.m, and ten examples of sample paths for a diffusing particle are shown in Figure 4.1.

## 数学代写|微分方程代写differential equation代考|Other Features of Brownian Particle Motion

Now that we know a little bit about how a diffusing particle moves, we can ask several other interesting questions. The first is to determine escape times. The question is as follows: How long, on average, does it take for a diffusing particle to escape from some region? In biological terms, how long does it take, on average, for a molecule that is made in the nucleus of a cell to diffuse to the boundary of the cell? Or, how long does it take a signaling molecule that is produced at the boundary of a cell to diffuse to the nucleus? A second question is, if there are two different places that a particle can escape from a region, what are the probabilities of escape through each exit? (This is called the splitting probability.)

Let’s begin by simulating this. First, for the exit time problem, simulate (using Matlab code first_exit_times.m) the motion of a Brownian particle on a one-dimensional line that starts at some position $0<x<L$, and let the simulation run until the particle hits $x=L$, with the additional restriction that the particle reflects off the boundary at $x=0$, i.e., the particle position is never allowed to be negative. For obvious reasons, the boundary at $x=0$ is called a reflecting boundary and the boundary at $x=L$ is called an absorbing boundary.

An example of a simulation result is shown in Figure $4.2$, where several sample particle trajectories (a) and a histogram of first exit times for a simulation with 1,000 particles (b) are shown, with $D=1$ and $L=1$. In Figure $4.3$ are shown the simulated mean first exit times plotted as a function of initial position.

To simulate the splitting probability, start the particle at some position between $x=0$ and $x=L$ and allow the simulation to run until either $x \geq L$ or $x \leq 0$ and record the fraction of time the simulation terminates with $x \geq L$, call this $\pi_{L}$. A plot of the result from a simulation using Matlab code splitting_probability.m is shown in Figure 4.4.

## 数学代写|微分方程代写differential equation代考|Following Several Particles

It is possible to follow a small number of particles using the above simulation method. However, it is definitely not possible if the particle numbers are large, say a mole. To follow the diffusion of a medium number (whatever that means) of particles, we adopt the model (3.4) and do a stochastic simulation of it.

The direct stochastic simulation of (3.4) can be done using the Gillespie algorithm. To describe this algorithm, we start with the simple example of exponential decay, modeled by the equation
$$\frac{d u}{d t}=-\alpha u .$$
Since we already know how to track the number of particles in a single compartment, we can think about multiple compartments. Suppose there are a total of $M$ particles that are distributed among $N$ boxes, arranged in a row. Let $u_{j}, j=1, \ldots, N$, represent the integer number of particles in box $j$. We assume that each particle can leave its box and move to one of its nearest neighbors by an exponential process with rate $2 \alpha$ if it is an interior box, and rate $\alpha$ if it is a boundary box. Consequently, the rate of reaction, where by reaction we mean leaving its box, is $r_{j}=2 \alpha u_{j}$ for $j=2, \ldots, N-1$, and $r_{j}=\alpha u_{j}$ for $j=1, N$. Now, pick three uniformly distributed random numbers between 0 and 1 ; the first, $R_{1}$, we use to determine when the next reaction occurs, and the second two, $R_{2}$ and $R_{3}$, we use to determine which of the possible reactions it is. As described in Chapter 1 , the time increment to the $n$th reaction, $\delta t_{n}$, is taken to he
$$\delta t_{n}=\frac{-1}{R_{\Sigma}} \ln R_{1},$$
where $R_{\Sigma}=\sum_{j=1}^{K} r_{j}$. Then, take $j$ to be the smallest integer for which $R_{2}<\rho_{j}=$ $\frac{1}{R_{\Sigma}} \sum_{i=1}^{j} r_{i}$, and if $2 \leq j \leq N-1$, take the particle in the $j$ th box to move to the right if $R_{3}>\frac{1}{2}$ and to the left if $R_{3} \leq \frac{1}{2}$. If $j=1$, the particle moves to the right, and if $j=N$ it moves to the left.

Matlab code to simulate this process is titled discrete_diffusion_via_Gillespie.m. One thing worth noting is that the process becomes less and less noisy, and much slower to simulate, as more particles are included in the system, suggesting that for a sufficiently large number of particles we need not (and should not) use a Gillespie algorithm, but rather a direct simulation of the diffusion equation.

dX=2Dd吨ñ(0,1).

Xn+1=Xn+dXn,

## 数学代写|微分方程代写differential equation代考|Following Several Particles

(3.4) 的直接随机模拟可以使用 Gillespie 算法来完成。为了描述这个算法，我们从指数衰减的简单例子开始，由方程建模

d在d吨=−一个在.

d吨n=−1RΣln⁡R1,

## 有限元方法代写

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