Write a MATLAB program that uses centered finite differences to solve the onedimensional diffusion equation for a

Question:

Write a MATLAB program that uses centered finite differences to solve the onedimensional diffusion equationd dx dc Doxode) = 0

for a spatially dependent diffusion coefficient D(x) = D0(1 − ax) and the boundary conditions c(0) = 1 and c(1) = 0. Compute the solution for a = 0, 0.2, 0.4, 0.6, and 0.8 using 11 nodes. Plot the concentration profiles versus position for each value of a on a single plot.

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: