Page 1 of 1

Waves in cellular automata

Posted: October 22nd, 2014, 7:10 am
by martin.novy
If you would allow, say, 2 * 8 bits per cell, or 2 * 16 bits per cell, I have recently programmed waves in cellular automata:
  • circular waves
    Image
  • quarter-circle
    Image
  • Schrodinger equation, wave-packet = particle ...
    (1-dim CA in this image)
    Image
More info is in the comments of https://www.youtube.com/watch?v=CnPbv4V3Yeg

I may be able to reduce the number of bits to 2 * 4 per cell.

waves10.m

Posted: October 22nd, 2014, 7:47 am
by martin.novy

Code: Select all

yfix = 127
niter= 40  
kdiv=   11  
nosc= 2 * 16 
sli= 0.1 
colormap(autumn(256))

more off
y=zeros(nosc,nosc);
dy=zeros(nosc,nosc);

rnuly = zeros(1,nosc);

for i=1:niter
	
	y += dy ;
	dy += diff( roundb(  diff( [rnuly ; y ; rnuly] ) / kdiv) ) ;
	dy += diff( roundb(  diff( [rnuly;  y' ; rnuly] ) / kdiv) )  ' ;  %'
	
	y(nosc/2,nosc/2) = yfix ; 

	surf(y)
	caxis ([0 yfix/10])
	sleep(sli)
	
end