smart=function(xl,xu,n,u,v){ # # Function smart computes the smart flux limiter # appproximation of a first derivative # # Declare arrays ux=rep(0,n);phi=rep(0,n);r=rep(0,n) # # Grid spacing dx=(xu-xl)/(n-1); # # Tolerance for limiter switching delta=1.0e-05; # # Positive v if(v >= 0){ for(i in 3:(n-1)){ if(abs(u[i]-u[i-1])