function yp = signal_mod3(t,y,N) % signal_mod3.m % % System of equations based on Mahaffy feedback system % Basic linear array of cells, information from nearest neighbor and % average on boundary % Default parameters for model a = 10; k = 10; n = 4; b = 0.1; alph = 1.2; bet = 10; kb = 2; n2 = 2; gam = 0.069; m = 0.1; for i = 1:N, X(i) = y(2*i-1); Y(i) = y(2*i); end Xave = mean(X); Yave = mean(Y); for j = 1:N, if (j == 1) yt(1) = a/(1 + k*Y(1)^n) - b*X(1); yt(2) = -alph*X(1)*Y(1) + bet*(Xave + X(2))^n2/(1+kb*(Xave + X(2))^n2) - gam*Y(1) + m*(Yave + Y(2) - 2*Y(1)); elseif (j == N) yt(2*N-1) = a/(1 + k*Y(N)^n) - b*X(N); yt(2*N) = -alph*X(N)*Y(N) + bet*(Xave + X(N-1))^n2/(1+kb*(Xave + X(N-1))^n2) - gam*Y(N) + m*(Yave + Y(N-1) - 2*Y(N)); else yt(2*j-1) = a/(1 + k*Y(j)^n) - b*X(j); yt(2*j) = -alph*X(j)*Y(j) + bet*(X(j-1)+ X(j+1))^n2/(1+kb*(X(j-1)+ X(j+1))^n2) - gam*Y(j) + m*(Y(j-1) + Y(j+1) - 2*Y(j)); end end yp = yt'; % Random ICs y0 = rand(100,1); % Simulate % [t,y] = ode23(@signal_mod3,[0,500],y0,[],N); % plot(t,y);grid;