Here is the code
%
function pdex51m = 0;x = 0:0.005:1;t = 0:0.01:1;options=odeset('Reltol',1e-10,'Abstol',1e-8);sol = pdepe(m,@pdex5pde,@pdex5ic,@pdex5bc,x,t,options);u1 = sol(:,:,1);u2 = sol(:,:,2);u3 = sol(:,:,3);% --------------------------------------------------------------
function [c,f,s] = pdex5pde(x,t,u,DuDx)A=1; Re=1; strainrate=1;c = [1; 1; Re]; n=1.2;alpha= [0; 1; strainrate].*DuDx ;f=alpha;f(1)=0;f(2)= alpha(3);f(3)= alpha(2);s = [A; (-u(2)/(1+u(1)^n)); 0 ] + [ - strainrate*u(1) ;0 ; 0].*flipud(DuDx);% --------------------------------------------------------------function u0 = pdex5ic(x)u0 = [0; 0;0]; % --------------------------------------------------------------function [pl,ql,pr,qr] = pdex5bc(xl,ul,xr,ur,t)pl = [0; 0; ul(3)]; ql = [1; 0;0]; pr = [0;0;ur(3)-1*heaviside(t-1e-15)]; qr = [1; 0;0];
Now I am getting the error "Error using daeic12 (line 77) This DAE appears to be of index greater than 1.
Error in ode15s (line 311) [y,yp,f0,dfdy,nFE,nPD,Jfac] = daeic12(odeFcn,odeArgs,t,ICtype,Mt,y,yp0,f0,…
Error in pdepe (line 317) [t,y] = ode15s(@pdeodes,t,y0,opts);
Error in pdex51 (line 6) sol = pdepe(m,@pdex5pde,@pdex5ic,@pdex5bc,x,t,options); " Please help me in this regard Thanks
Best Answer