tcompareage.m - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
 (HTM) git clone git://src.adamsgaard.dk/pism
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
       tcompareage.m (647B)
       ---
            1 function sumerrs = compareage(N)
            2 % COMPAREAGE  runs agetwo.m with goal of comparing first-order upwinding
            3 
            4 L = 10;
            5 Tf = 10.0;
            6 [x,a1,a2,v,t,a1sum,a2sum] = agetwo(N,Tf);
            7 sumerrs = [a1sum(end)-L*Tf; a2sum(end)-L*Tf];
            8 
            9 figure(1), plot(x,v), grid on
           10 title('scalar velocity v(x)')
           11 xlabel x, ylabel v
           12 
           13 set(0,'defaultlinemarkersize',8)
           14 figure(2), plot(x,a1,'-o',x,a2,'-o'), grid on
           15 legend('first method','second method (conserving)')
           16 title(sprintf('solution a(x,t) at t=%.4f',Tf))
           17 xlabel x, ylabel('age  a(x,t)')
           18 
           19 figure(3), plot(t,a1sum-L*t,t,a2sum-L*t), grid on
           20 legend('first method','second method (conserving)')
           21 title('conservation errors')
           22 xlabel t
           23