m = 0;
x = linspace(0,1,41);
t = linspace(0,200,10);
sol = pdepe(m,@pdex5pde,@pdex5ic,@pdex5bc,x,t);
n = sol(:,:,1);
c = sol(:,:,2);
figure;
surf(x,t,c);
title('Distribution of fibronectin--c(x)');
xlabel('Distance x');
ylabel('Time t');
figure;
surf(x,t,n);
title('Distribution of ECs--n(x)');
xlabel('Distance x');
ylabel('Time t');
figure;
plot(x,n(end,:));
title('Final distribution of n(x).');
figure;
plot(x,c(end,:));
title('Final distribution of c(x).');
function [c,f,s] = pdex5pde(x,t,u,DuDx)
d = 1e-3;
a = 3.8;
S = 3;
r = 0.88;
N = 1;
c = [1; 1];
f = [ d*DuDx(1) - a*u(1)*DuDx(2)
DuDx(2) ];
s1 = S*r*u(1)*(N - u(1));
s2 = S*(u(1)/(u(1) + 1) - u(2));
s = [s1; s2];
function u0 = pdex5ic(x)
u0 = [1; 0.5];
if x >= 0.3 & x <= 0.6
u0(1) = 1.05 * u0(1);
u0(2) = 1.0005 * u0(2);
end
13 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652592
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652592
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652593
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652593
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652609
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652609
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652869
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652869
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652870
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652870
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652886
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652886
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652900
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652900
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652946
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652946
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652948
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_652948
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_654734
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_654734
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_654781
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_654781
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_654846
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_654846
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_654854
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/436597-why-the-code-is-not-running#comment_654854
Sign in to comment.