Global Index (short | long) | Local contents | Local Index (short | long)
This script calls | |
---|---|
This buffer is for notes you don't want to save, and for Lisp evaluation. If you want to create a file, visit that file with C-x C-f, then enter the text in that file's own buffer. real*8 ddt,ddcoef,dranold,drannew,coef1,coef2 c ddt=dt ddcoef=dcoef dranold=0. coef1=(1.0-0.5*ddt*ddcoef)/(1.0+0.5*ddt*ddcoef) coef2=ddt/(1.0+0.5*ddt*ddcoef) iseed=1385729 c return c entry randomwind (rannew) c drannew = coef1*dranold+coef2*(ran(iseed)-0.5) c dranold=drannew rannew=drannew c return c end c dcoef = 1.39e-4 dcoef = 1/(12*7200); dt = 7200. ddt=dt; ddcoef=dcoef; dranold=0.; coef1=(1.0-0.5*ddt*ddcoef)/(1.0+0.5*ddt*ddcoef); coef2=ddt/(1.0+0.5*ddt*ddcoef); dranold = 0; for i = 1:10000; drannew(i) = coef1*dranold+coef2*(rand(1)-0.5); dranold = drannew(i); end [p,f] = spectrum(drannew, 1024, 512); subplot(3,1,2); plot(f, p(:,1));