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 comentario

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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Numerical Integration and Differential Equations en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 24 de Feb. de 2013

Comentada:

el 24 de Nov. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by