how i can solve the following PDE using periodic boundry coditions

8 次查看(过去 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 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by