How to solve a PDE where the boundary condition is an spatial ODE
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sachin Hegde
el 20 de Abr. de 2023
Comentada: Sachin Hegde
el 20 de Abr. de 2023
I have a PDE which i need to solve to get both the spatial and time related results. However i am confused as to how to pose the problem in matlab especially with the boundary conditions. I have attached the problem so that it is clear what i am talking about. The initial condition for lambda at t=0 is 0. The boundary conditions (at x = 0 and at x = L) is N_lambda = 0. Can anyone help me out here in defining the problem in matlab. Thank you very much in advance
0 comentarios
Respuesta aceptada
Bill Greene
el 20 de Abr. de 2023
In PDE of the type you show, especially when the PDE represents a physical phenomenon, terms like your N_lambda are referred to as the "flux." pdepe makes it easy to define boundary conditions where the flux equals a specified value, e.g. zero.
pdepe requires you to create a function to define your PDE. For your example it would look something like this:
function [c,f,s] = pdeDefinition(x,t,lam,dlamdx)
epsi=1;
Vm=2;
DLam=3;
nd=4;
ip=5;
F=6;
c = epsi/Vm;
f = DLam/Vm*dlamdx - nd*ip/F;
s = S+r;
end
The boundary condition function, which you also have to write, would look something like this.
function [pl,ql,pr,qr] = bcFunc(xl,lam_l,xr,lam_r,t)
pl = 0;
ql = 1;
pr = 0;
qr = 1;
end
6 comentarios
Bill Greene
el 20 de Abr. de 2023
Regarding the usage of pdepe in general, I strongly recommend starting with a simple PDE that you know the analytical solution to and experiment with that until you are comfortable with the syntax and options.
Más respuestas (0)
Ver también
Categorías
Más información sobre PDE Solvers en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!