Information Technology Reference
In-Depth Information
i=1:m; % row index
j=1:n; % column index
left_j=[n,1:n-1]; right_j=[2:n,1]; % indexes of cells on the left and right
up_i=[m,1:m-1]; low_i=[2:m,1];
% indexes of cells upper and lower
x=0.0001*(rand(m,n)-0.5);
% initialization of the initial state with small random val-
ues
% LINE A % the feed-forward contribution
ffwd=z+B(1)*u1+B(2)*u2+B(3)*u3+B(4)*u4+B(5)*u5+B(6)*u6+B(7)*u7+B(8)*u8+B(9)*u9;
for s=1:round(T/Delta_T)
y=0.5*(abs(x+1)-abs(x-1)); % compute the outputs for all neighbors
y9=y(up_i,left_j); y8=y(up_i,j); y7=y(up_i,right_j);
y6=y(i,left_j); y5=y; y4=y(i,right_j);
y3=y(low_i,left_j); y2=y(low_i,j); y1=y(low_i,right_j);
% LINE B % the recurrent contribution
recur=A(1)*y1+A(2)*y2+A(3)*y3+A(4)*y4+A(5)*y5+A(6)*y6+A(7)*y7+A(8)*y8+A(9)*y9;
x=(1-Delta_T)*x+Delta_T*(ffwd+recur);
% update the state dynamics following equa-
tion (1)
%display the new output
image(20*y+32); axis image; colormap jet
title(['Time: ',num2str(s*Delta_T),' PRESS ANY KEY TO CONTINUE']);
% wait for next step
waitforbuttonpress
end
This new cell is in fact a implementation of the standard (linear coupling) CNN
model of Chua and ang [7]. It can easily evolved into a nonstandard model by
simply changing INE A and INE B acco rdingly. The continuous time dynamics
associated to (3.1) is emulated on the discrete-time computer using a simple inte-
gration method; namely, the Euler's method. Therefore, in addition to gene pa-
rameters this new cell has to specify two dynamic parameters. The first, Delta_T
indicates the step sie and the smallest th e better will be the approximation of the
continuous time dynamics. The second, T , represents the integration time period.
sually the user may choose such a va
lue that corresponds to a steady state
dynamics in the output.
In order to simulate a coupled CA one should use the above file in conjunc-
tion with a file called CC., which is
simply obtained from a copy of the
C.M file after changing the name
of cell function from CCEL to
CCCE.
sing the values in the file above, the dynamics of the CNN will be first
observed, and from time to time a figure will show the CA output. The visuali-
ation of the CNN steps is useful for first experiments and it allows one to choose
the two dynamic parameters. owever, if one wants to see only the CA output,
the visualiation lines in the above file should be ignored (by inserting % in front
of them).
ike in the previous cases, a wide range of systems can be simulated, by prop-
erly re-editing the above file after proper changes of the gene or/and various
parameters of the dynamics (i.e. the number of steps).
Search WWH ::




Custom Search