Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative. error

2 次查看(过去 30 天)
my boundries are
a(1)=1 a'(0)=0
b(1)=0 b'(0)=0
the code i used is
function [pl,ql,pr,qr] = pdex4bc(~,ul,~,ur,~)
pl = [0;ul(1)-1];
ql = [1;0];
pr = [0;ur(2)];
qr = [1;0];
but i get this following error
Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative
what is the wrong i did
  3 个评论
Mallikarjuna M
Mallikarjuna M 2022-3-4
I appled another boundary value for the same system i get the output but for only this boundary i couldn't get the boundary
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,:),'r')
hold on
%title('u1(x, t)')
%xlabel('Distance x')
%ylabel('u1(x,t)')
%figure
% --------------------------------------------------------------
function [c,f,s] = pdex4pde(~,~,u,DuDx)
phi=0.1;al=0.1; %These parameter values are used in Fig.2
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; 0];
% --------------------------------------------------------------
function [pl,ql,pr,qr] = pdex4bc(~,ul,~,ur,~)
pl = [0;ul(1)-1];
ql = [1;0];
pr = [0;ur(2)];
qr = [1;0];
Torsten
Torsten 2022-3-4
pl = [0;0];
ql = [1;1];
pr = [ur(1)-1;ur(2)];
qr = [0;0];
sets
a'(0) = 0, b'(0) = 0, a(1) = 1, b(1) = 0
And I think
F1=-9.*phi.^2.*(u(1)./1+u(1)+u(2));
F2=-9.*al.^2.*(u(2)./1+u(1)+u(2));
should read
F1=-9.*phi.^2.*u(1)./(1+u(1)+u(2));
F2=-9.*al.^2.*u(2)./(1+u(1)+u(2));

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 1-D Partial Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by