how i can solve the following PDE using periodic boundry coditions
9 ビュー (過去 30 日間)
古いコメントを表示
clear all,close all
x=linspace(0,1,50);
t=linspace(0,1,50);
m=0;
eqn=@(x,t,u,dudx)transistorPDE(x,t,u,dudx,C);
ic=@(x)transistorIC(x,C);
sol=pdepe((m,eqn,ic,transistorBC,x,t);
function [c,f,s]=transistorPDE(x,t,u,dudx,C)
a=0.1;
c=1;
f=0;
s=-a*dudx;
end
function u0=transistorIC(x,C)
L=1;
u0=exp(-(x-L/2)^2);
end
function [pl,ql,pr,qr]=transistorBC(xl,ul,xr,ur,t)
pl=ul;
ql=0;
pr=pl;
qr=0;
end
0 件のコメント
採用された回答
Josh Meyer
2020 年 1 月 30 日
Periodic boundary conditions require that when something leaves one boundary with a certain velocity, it enters the boundary on the other side with the same velocity. In other words:
So, you would need to modify your values for the qL and qR coefficients in transistorBC to incorporate the flux term (which generally includes the above partial derivative). The boundary conditions are written in the standardized form:
The flux term f is defined in the main pdefun function. In your case, you have f = 0 so would not be able to do this without also redefining your flux term (which would also change what equation you're solving).
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!