Hello. I have trouble sovling following system of equations. Coud anyone please help me in this regard?
Here is the system of equations (containing 1 PDE coupled with 1 ODE) I have in mind:
u1_t = ((-eta_s - eta_p * u2)/rho) * u1_xxu2_t = -kn * u2 * u1_x + kp * (1 - u2)
The Boundry and Initial conditions are also as follow:
BC: u1(0,t) = 0 , u1(1,t) = 1IC: u1(x,0) = 0 , u2(0) = 0
Here is the code I'm using:
global rho eta_s eta_p kp knrho = 1000;eta_s = 5;eta_p = 1;kp = 0.1;kn = 0.3;x = [0 0.005 0.01 0.05 0.1 0.2 0.5 0.7 0.9 0.95 0.99 0.995 1];t = [0 0.005 0.01 0.05 0.1 0.5 1 1.5 2];m = 0;sol = pdepe(m,@pdefun,@pdeic,@pdebc,x,t);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [c,f,s] = pdefun(x,t,u,dudx)global rho eta_s eta_p kp knc = [1; 1];f = [ -( ( eta_s + eta_p*u(2) ) / ( rho ) ) * dudx(1) ; -kn * u(2) * u(1) ];s = [ 0 ; kp * ( 1 - u(2)) ];end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function u0 = pdeic(x)u0 = [0; 1];end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function [pl,ql,pr,qr] = pdebc(xl,ul,xr,ur,t)pl = [ul(1)-0; 0];ql = [0; 0];pr = [ur(1)-1; 0];qr = [0; 0];end
Best Answer