%Math4090 2010 chapter 2 %tunnelEQ.m % function xp=tunnelEQ(t,x) global d P0 rho g h f L D gam xp=zeros(2,1); xp(1)=x(2); p0=P0/(rho*g*h); F=f*L/D; xp(2)=(1+p0*(1-(1/(1-x(1)))^gam)-(sign(x(2))*F*x(1)+1)*x(2)^2)/(x(1)+d/L)/2;