Hi everyone,
I tried to solve a Fisher Kolmogorov pde equation using pdepe. Matlab does not give any sign of error still I don't get what I was supposed to. I include my code:
x=linspace(0,1);
t=linspace(0,8*365);
m = 0;
u= pdepe(m,@heatcyl,@heatic,@heatbc,x,t);
surf(x,t,u)
xlabel('x')
ylabel('t')
zlabel('u(x,t)')
view([150 25])
figure
plot(t,u(100,:));
function [c,f,s]=heatcyl(x,t,u,dudx)
c = 1;
f = dudx;
s = 0.01*(1-u).*u;
end
%initial condition
function u0 = heatic(x)
u0 = 0.3*sech(0.3*x);
end
%boundary conditions
function [pl,ql,pr,qr] = heatbc(xl,ul,xr,ur,t)
pl = 0;
ql = 1;
pr = 0;
qr = 1;
end
I would expect, if I plot the solution at a certain time t , to get the classical plot :![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1220692/image.png)
Boundary condition are no flux conditions and the initial condition is the one indicated in the code
I also include the equation I start from:
Thanks in advance to anyone giving advice.