ajmath

25 Reputation

4 Badges

5 years, 250 days

MaplePrimes Activity


These are replies submitted by ajmath

@Joe Riel 

 

I am trying to model systems of flashing fireflies, and illustrate the synchronisation of their flashes. I have come up with a simple model already.

 

>

> with(RandomTools[MersenneTwister]);

 

> N := 10; %number of oscillators

> K := 100; %number of times process is run

> phi := 5; %bump given to oscillators when one fires

> alpha := .5; %constant that affects extent to which size of firing populations affects bump

> S := Array([seq(GenerateInteger(range = 0 .. 100), i = 1 .. N)]);

>

>

for k from 1 to K do

V:=max(S):

t:=100-V:

for j from 1 to N do

S[j]:=S[j]+t:

S[j]:=S[j]+phi:

end do:

>

for j from 1 to N do

if S[j]>99 then S[j]:=0;

end if:

end do:

 

S:=S:

mu:=ArrayNumElems(S)-ArrayNumElems(S,NonZero);

>

for j from 1 to N do

if S[j]<>0 then S[j]:=S[j]+(exp(alpha*mu));

end if:

end do:

 

for j from 1 to N do

if S[j]>99 then S[j]:=0:

end if:

end do:

>

>

od;

 

 

I hope this is clear enough to understand.

 

I now wish to assign characteristics to each individual firefly (which is represented by each member of the array S). I want to be able to assign charateristics such as sensitivity to flashes, strength of flash etc to make the model more realistic.

 

I hope this clarifies my problem. Thankyou very much for your responses already.

 

Thanks

ode := {diff(phi(t), t, t) = -phi(t), phi(0) = (1/12)*Pi, (D(phi))(0) = 0}; integ := dsolve(ode, numeric); f := proc (tt) options operator, arrow; plots:-pointplot(eval([([sin, -cos])(phi(t))], integ(tt))) end proc; plots:-animate(f, [t], t = 0 .. 40, frames = 400, scaling = constrained, view = [-1 .. 1, -1 .. 1], symbol = cross);

 

 

I tried converting to plain text? i'm not sure if it's helpful like this..

Page 1 of 1