function [ fval ] = F(t,x,u,ux,duxx) % % Written by: % -- % John L. Weatherwax 2005-06-15 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- fval(1) = duxx(1) - v(x)*ux(1); function [ vout ] = v(x) % % Written by: % -- % John L. Weatherwax 2005-06-15 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- if( x >= 0 & x < 0.5 ) vout(1) = 1000; elseif( x == 0.5 ) xGrid200 = 0.49750; xGrid201 = 0.5; xGrid202 = 0.50500; vout(1) = ((xGrid201-xGrid200)*1.0 + (xGrid202 - xGrid201)*1000.0)/(xGrid202-xGrid200); else vout(1) = 1; end