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