![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/204237/image.png)
Implementing boundary condition in pdepe
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
From the general expression of a pde given here
![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199796/Untitled.png)
Could someone check if the following implementation of the boundary condition is correct?
function [pl,ql,pr,qr] = bcfun(xl,cl,xr,cr,t)
pl = cl -constant;
ql = 1;
pr = cr;
qr = 1;
end
0 comentarios
Respuestas (1)
Josh Meyer
el 15 de Feb. de 2019
The form for the boundary conditions expected by the solver is
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/204237/image.png)
Since you have a system of two equations, each p and q should be a two-element vector defining the left and right boundary conditions for each equation. Notice that the second term is written in terms of the flux, which you define as the f output in the pde function, and which can differ by component.
(For an example of setting boundary conditions with multiple equations, see the pdex4 example file by typing edit pdex4 in MATLAB.)
0 comentarios
Ver también
Categorías
Más información sobre Boundary Conditions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!