Pdepe: Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative.
Mostrar comentarios más antiguos
i am trying to solve the diffusion reaction using pdepe but it is showing an error like
Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative.
any problem with the boundary. x(0)=1,x'(1)=0, y(1)=1,x'(0)=0
function steady
m = 0;
x = linspace(0,1);
t = linspace(0,1000);
sol = pdepe(m,@pdex4pde,@pdex4ic,@pdex4bc,x,t);
u1 = sol(:,:,1);
%u2= sol(:,:,2);
%figure
plot(x, u1(end,:),'b')
hold on
%title('u1(x, t)')
%xlabel('Distance x')
%ylabel('u1(x,t)')
%figure
%plot(x, u2(end,:),'b')
%title('u2(x, t)')
%figure
% --------------------------------------------------------------
function [c,f,s] = pdex4pde(~,~,u,DuDx)
al=0.1;phi=0.0009;
c = [1;1];
f = [1;1].* DuDx;
F1=-9.*phi.^2.*(u(1)./1+u(1)+u(2));
F2=-9.*al.^2.*(u(2)./1+u(1)+u(2));
s = [F1;F2];
% --------------------------------------------------------------
function u0 = pdex4ic(~)
u0 = [0; 1];
% --------------------------------------------------------------
function [pl,ql,pr,qr] = pdex4bc(~,~,ul,ur,~)
%bi=10.0;
pl = [ul(1)-1;0];
ql = [0;1];
pr = [0;ur(2)-1];
qr = [1;0];
%qr = [0; bi*(1-ur(2))];
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Partial Differential Equation Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!