Plot not displayed correctly
Show older comments
I have a system of 3 differntal equations with the boundary condition.
S'(0,t) = 0, M(0,t) = 1, P(0,t) = 0.
S(1+delta,t) = 1, M(1+delta,t) = 0, P(1+delta,t) = 0.
where delta is the constant parameter which has a range of values how to include the (1+delta) boundary can any one please correct the code. I have attached the code here.
function non_steady_mediator
m = 0;
x = linspace(0,1);
t = linspace(0,1);
sol = pdepe(m,@pdex4pde,@pdex4ic,@pdex4bc,x,t);
u1 = sol(:,:,1);
u2= sol(:,:,2);
u3= sol(:,:,3);
%figure
plot(x, u1(end,:),'.',...
'MarkerEdgeColor',[0.39 0.83 0.07],...
'LineWidth',2,'MarkerSize',8)
%legend('numerical')
%surf(x,t,u2)
hold on
%title('u1(x, t)')
%xlabel('Distance x')
%ylabel('u1(x,t)')
%figure
% --------------------------------------------------------------
function [c,f,s] = pdex4pde(~,~,u,DuDx)
alpha=2;beta=5;gamma=3;sigma=0.5;varphi=2;omega=2;
c = [1;1;1];
f = [1;1;1].* DuDx;
F1=alpha^2.*u(1).*u(2)./u(1)+u(2);
F2=beta^2.*u(1).*u(2)./u(1)+u(2);
F3=gamma^2.*u(1).*u(2)./u(1)+u(2);
s = [F1;F2;F3];
% --------------------------------------------------------------
function u0 = pdex4ic(~)
u0 = [1;1;1];
% --------------------------------------------------------------
function [pl,ql,pr,qr] = pdex4bc(~,ul,~,ur,~)
pl = [0;ul(2)-1;ul(3)];
ql = [1;0;0];
pr = [ur(1)-1;ur(2);ur(3)];
qr = [0;0;0];
Accepted Answer
More Answers (0)
Categories
Find more on Boundary Conditions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!