# how i can solve the following PDE using periodic boundry coditions

26 Ansichten (letzte 30 Tage)
lulu am 28 Jan. 2020
Beantwortet: Josh Meyer am 30 Jan. 2020
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 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Josh Meyer am 30 Jan. 2020
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 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Boundary Conditions finden Sie in Help Center und File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by