Neumann boundary condition in a first order PDE

I'm trying to solve the following equation using PDEPE:
dC/dt + v * dC/dx = constant
With the boundary conditions:
C(t,0)=Cin dC(t,L)/dx=0
My question is how can I incorporate the second BC in the PDEPE syntax, if I should define f = [-v]. Is there any posibility to call the penultime value and make it equal to ur, so dC/dx=0? u(x_n) = u(x_(n-1))
Thanks for your cooperation!
Antonio

回答 (1 件)

Tom
Tom 2012 年 9 月 25 日
編集済み: Tom 2012 年 9 月 25 日

0 投票

In this case you want to set
pr = 0;
qr = -1/v; %to cancel out f

11 件のコメント

Antonio
Antonio 2012 年 9 月 25 日
編集済み: Antonio 2012 年 9 月 25 日
Thanks for your promt reply. In this case, I would have:
p + q*f = 0.... 0 + (1/-v)*(-v) = 0... 1 = 0
What I need is to set dC/dx = 0. But I can´t since there is no derivative in the flux term (f).
Tom
Tom 2012 年 9 月 25 日
編集済み: Tom 2012 年 9 月 25 日
The derivative is included in the q part, see the right hand boundary condition of example 1 of the pdepe help
Tom
Tom 2012 年 9 月 25 日
You don't need to- the gradient is included. Can you provide some example code?
Antonio
Antonio 2012 年 9 月 25 日
In that case f = dudx...that's why q is just equal to 1. But in my case the PDE is a first order and f equals a constant.
Antonio
Antonio 2012 年 9 月 25 日
編集済み: Antonio 2012 年 9 月 25 日
% dC/dt= -v * dC/dx - constant
function [c,f,s]=pde(u,t,x)
c=1;
f=-v;
s=-rp*(1-e)/e*.21;
%Boundary conditions
function [pl,ql,pr,qr] = pdebc(rl,ul,rr,ur,x,t)
global Cin
pl=[ul-Cin];
ql=[0];
pr=[?];
qr=[?];
Tom
Tom 2012 年 9 月 25 日
I just realised- all the times I've used PDEPE my f term has included dudx in it... What is the equation you are solving?
Antonio
Antonio 2012 年 9 月 25 日
A mass balance in an adsorption column.
Tom
Tom 2012 年 9 月 25 日
Can you post a link to the equation?
Antonio
Antonio 2012 年 9 月 25 日
編集済み: Antonio 2012 年 9 月 25 日
https://www.dropbox.com/sh/3vp4f4ea1l1346f/9yjY_UKgCI/Dibujo.jpg
Thanks for your help, Tom. For now, im taking the last term as constant
Tom
Tom 2012 年 9 月 25 日
I'm not sure how PDEPE can deal with two time terms, maybe it would be better to solve numerically in a for loop.
Antonio
Antonio 2012 年 9 月 25 日
About the last term (dq/dt), ill solve it differently. My problem now is this bc!

サインインしてコメントする。

質問済み:

2012 年 9 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by