Matlab pdepe homogeneous surface diffusion

Hi guys. I'm trying to model the diffusion equation below using matlab pdepe function.
dq/dt=D/r2 *d[r2(dq/dt)/dr
Initial condition: at t=0, q=0
BC1: at r=0, dq/dr=0
BC2: at r=R, Ddq/dr = kf(C-Cf)
kf, C, and Cf are unknown, so we need this equation:
dC/dt = -3kf*Vm/RV*(C-Cf) , subject to t=0, C=C0 vs*dq/dt = vl*dC/dt
How should I write the boundary condition then?
I used, Ddq/dr - vs*RV/(3*vl*Vm)* dq/dt = 0
so in the matlab file, I wrote:
sol = pdepe (m,@pdex1pde,@pdex1ic,@pdex1bc,x,t); surf (x,t,sol) ---- function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t) global sol
pr= vs*RV/(3*vl*Vm)*sol;
end
but I just got a linear plane in the plot of x vs t for sol. Could you please point out where/what is wrong with my coding?
Thanks a lot.

1 个评论

Hello,
I cannot help you but i am also stuck with the resolution of intraparticle diffusion in pdepe. Did you solve it at the end ?
If yes can you show me?
Thank you
Math

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by