Now consider the discretized domain as shown in Fig. 40.1. The i is the column number which represents the spatial discritization of the domain. Similarly n is the row number which represents the time discretization. As discussed in Lecture No. 14, we can discretize the diffusion equation as follows.
(40.17)
(40.18)
Putting (40.17) and (40.18) in (40.13), we have
(40.19)
This is an explicit finite difference form of the equation (40.13). The equation (40.19) can be used to obtain the concentration at different time steps using iterative procedure as shown in Fig. 40.2. The iteration can be performed using any prgramming language. For C0=0, the solution of the one dimensional diffusion equation can be obtained using the following Matlab code. |
|
The solutions obtained using the code are shown in Fig. 40.3.
Fig. 40.3 Solution of the one dimensional diffusion equation |