Can I use pdepe to solve a nonlinear PDE system?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm trying to solve the following PDE system for ?(z,t) and v(z,t), using pdepe:
∂/∂z [(1/? + A)*∂v/∂z - v*∂?/∂z)] + [1/(1-?)]*[A*∂v/∂z *∂(1-?)/∂z - B*v/?^2] = 0
∂?/∂t = ∂/∂z[v*(1-?)]
where A and B are constants. The initial condition is
?(z,0) = 0.05
and the boundary conditions are
v(0,t) = 0
v(1,t) = - 0.1
The code I used is this [I use u(1) ≡ ? and u(2) ≡ v]:
function rbs
m = 0;
x = linspace(0,10,100);
t = linspace(0,10,100);
sol = pdepe(m,@rbs_pde,@rbs_ic,@rbs_bc,x,t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
% --------------------------------------------------------------
function [c,f,s] = rbs_pde(x,t,u,DuDx)
c = [0; 1];
f = [((1/u(1)) + (1/0.75))*DuDx(2) - u(2)*DuDx(1); (1 - u(1))*u(2)];
s = [-(1/(1 - u(1)))*DuDx(1)*DuDx(2) - (1/8000^2)*(1/(1 - u(1)))*u(2)/(u(1))^2; 0];
% --------------------------------------------------------------
function u0 = rbs_ic(x);
u0 = [1; 0];
% --------------------------------------------------------------
function [pl,ql,pr,qr] = rbs_bc(xl,ul,xr,ur,t)
pl = [0; ul(2)];
ql = [0; 0];
pr = [0; ur(2) + 1e-1];
qr = [0; 0];
However, I get the following error message:
Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial
derivative.
1 comentario
Bill Greene
el 7 de Sept. de 2018
What are the boundary conditions for ?? Your first equation has a second derivative of ? with respect to z so you need two boundary conditions.
Respuestas (0)
Ver también
Categorías
Más información sobre Boundary Conditions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!