So i have the follwing system of pdes:
where . where .
The symmetry boundary conditions are:
The other two boundary conditions are given by:
At and
. Parameter values are: k1 = 5 ,k2 =6 , C=8.
So this is the function code:
function [c,f,s] = pdefun(x,t,u,dudx)
c = [1; 1];
if x <= 2
f = 5*dudx;
else
f = 6*dudx;
end
end
function u0 = pdeic(x)
u0 = [10; 0];
end
function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,t)
pl = [0; 0];
ql = [0; 0];
pr = [e; f];
qr = [g; h];
end
Then to solve the equation:
x = [0 0.1 0.2 0.3 0.4 0.45 0.475 0.5 0.525 0.55 0.6 0.7 0.8 0.9 0.95 0.975 0.99 1];
t = [0 0.001 0.005 0.01 0.05 0.1 0.5 1];
m = 2;
sol = pdepe(m,@pdefun,@pdeic,@pdebc,x,t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
To plot the solution:
surf(x,t,u1)
title('u_1(x,t)')
xlabel('Distance x')
ylabel('Time t')
Just asking how do you write down the boundary conditions to make it suitable for pdepe as the examples provided on the matlab website don't help much with putting the boundary conditions in the standard form?