% 移流方程式を差分法で解くサンプルプログラム n=100; x=[1:n]'*(2*pi/n); u=sin(x); t=0; h=0.01; plot(x,u); for istep=1:10000 [u,t]=rk4(u,t,h,'adv'); if(rem(istep,20) == 0) plot(x,u) end end