Hi everyone.
I am trying to solve two coupled PDEs with pdepe MATLAB. However, I have some dificcualties regarding this problem. I appericiate if anyone can help me with this matter.
So the problem I'm trying to solve is:
du1/dt = (1/rho) * du2/dy
0 = -u2 + eta * (abs(du1/dy)+eps)^(n-1)*du1/dy
As you can see there is no transient term in the second equation.
I also know that I can simply put the second equation into the first equation, however, I need to have the outputs for both u1 and u2, and that's why I am splitting it in this form.
The boundry conditions are:
u1_l = 0
u2_r = 1
u1(t=0) = 0
u2(t=0) = 0
I have coded this problem as follows:
function [c,f,s] = pdefun(x,t,u,dudx)
global rho eta n
c = [1; 0];
f = [u(2)/rho; 0];
s = [0; eta*((abs(dudx(1))+eps)^(n-1))*dudx(1) - u(2)];
end
with the following BCs and ICs:
function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,t)
pl = [ul(1)-0; 0];
ql = [0; 1];
pr = [0; ur(2)-1];
qr = [1; 0];
end
function u0 = pdeic(x)
u0 = [0; 0];
end
And the main code for solving equation is:
global rho eta n H tf
rho = 100;
eta = 1;
n = 1.5;
H = 1;
tf = 20;
x = linspace(0,H,101);
t = linspace(0,tf,1001);
m = 0;
sol = pdepe(m,@pdefun,@pdeic,@pdebc,x,t);
u1 = sol(:,:,1);
u2 = sol(:,:,2);
By using these codes, I don't get a correct solution. Does anyone have any ideas?
Thank you,