Matlab pdepe homogeneous surface diffusion
Afficher commentaires plus anciens
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 commentaire
Mathischan Maheswaran
le 24 Nov 2020
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
Réponses (0)
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!