Question: 1. Please write a Matlab program that uses centered finite differences to solve the following one-dimensional diffusion equation: d/dx (D(x)*dC/dx) = 0 for a spatially
1. Please write a Matlab program that uses centered finite differences to solve the following one-dimensional diffusion equation: d/dx (D(x)*dC/dx) = 0 for a spatially dependent diffusion coefficient D(x) = Do(1-ax) and 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. D0 is not given. Plot the concentration profiles versus position for the each value of a on a single plot. All I really need is for someone to solve the ODE equation given into explicit form. I can do the coding from there.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
