how i can solve the following PDE using periodic boundry coditions

조회 수: 22 (최근 30일)
lulu
lulu 2020년 1월 28일
답변: Josh Meyer 2020년 1월 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

채택된 답변

Josh Meyer
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개)

카테고리

Help CenterFile Exchange에서 Boundary Conditions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by