For movement in a plane the **1D model** will be generalized. Generalization of movement along the x-axis to movement in the plane will be effected by changing from real x to complex x+iy. Apart from the 2D position a new variable will occur, the direction of the long axis of the body. So the model is effctively 3D. The generalization from 1D to 2D is most easily effected using a discrete formulation of the 1D model. The basic 1D discrete model is formulated here, with T the sampletime and k.T the k^{th }sampling moment. In the model T=0.001, this will give a good approximation to the analog (continuous) system. A first order low pass filter for the speed sp, with timeconstant τ_{v}, is implemented as

sp_{filt}(k)=(exp(-T/τ_{v}))*sp_{filt}(k-1)+(1- exp(-T/τ_{v}))*sp

*The 1D model in discrete form*

Define startconditions for k=1

for k=2 to N_{end}

x_{M}(k)=x_{M}(k-1)+ v_{M}(k-1)*T

r(k) = x_{F}(k)-x_{M}(k)

sp=K_{r}*(|r(k)|-r_{ref})

sp_{filt}(k)=(exp(-T/τ_{v}))*sp_{filt}(k-1)+(1- exp(-T/τ_{v}))*sp

v_{M}(k)=(exp(-T/τ))*v_{M}(k-1)+(1- exp(-T/τ))*sp_{filt}(k)

end

In the 2D generalization x_{M} is a complex number indicating a position in the plane. In the same way x_{F} is a complex number. The direction of the long axis of the body is represented by a complex number Body=exp(i.φ). It is assumed that the body should point to the female. This will be effected by a separate “fixation” control system (Boeddeker and Egelhaaf, 2005).

*The fixation control system*

* *

for k=2 to N_{end}

φ(k)=φ(k-1)+ α_{filt}(k-1)*T

θ_{e}(k)=β(k)-φ(k)

d θ_{e}(k)=( θ_{e}(k)- θ_{e}(k-1))/T

α(k)=KrB*sin(θ_{e}(k))+KdB*d θ_{e}(k)

α_{filt}(k)=( exp(-T/τ_{f}))* α_{filt}(k-1)+(1- exp(-T/τ_{f}))*α(k)

end

The sine of the error angle θ_{e} is amplified by the proportional gain KrB and the velocity dθ_{e}is amplified by KdB to obtain the rotation to be applied to the body direction. A low pass filter is used to model the neural and mechanical delay. To combine both loops it is assumed that the speed in the position loop is a real number. v_{M} is in the 2D case a complex number calculated by :

v_{M}(k)=(exp(-T/τ))*v_{M}(k-1)+(1- exp(-T/τ))*sp_{filt}(k)***exp(i.φ(k))**

In steady state, with constant sp_{filt }and φ, v_{M }will assume the value sp_{filt}*exp(i.φ), this is a vector in the direction of the male body axis with size sp_{filt} (sp_{filt} may be negative).

*The complete 2D algorithm *:

*Define startconditions for k=1*

for k=2 to N_{end}

x_{M}(k)=x_{M}(k-1)+ v_{M}(k-1)*T

r(k) = x_{F}(k)-x_{M}(k)

sp=K_{r}*(|r(k)|-r_{ref})

sp_{filt}(k)=(exp(-T/τ_{v}))*sp_{filt}(k-1)+(1- exp(-T/τ_{v}))*sp

φ(k)=φ(k-1)+ α_{filt}(k-1)*T

v_{M}(k)=(exp(-T/τ))*v_{M}(k-1)+(1- exp(-T/τ))*sp_{filt}(k)*exp(i.φ(k))

θ_{e}(k)=β(k)-φ(k)

d θ_{e}(k)=( θ_{e}(k)- θ_{e}(k-1))/T

α(k)=KrB*sin(θ_{e}(k))+KdB*d θ_{e}(k)

α_{filt}(k)=( exp(-T/τ_{f}))* α_{filt}(k-1)+(1- exp(-T/τ_{f}))*α(k)

*Change over to a small reference distance to initiate a chase.*

*Collision detection*

end

The model needs 9 parameters : 3 timeconstants, 3 gains ( the gain for distance control and two gains for bodyrotation) the reference distance before and after the backward part of the path and a threshold to change over from high to low reference distance to initiate a chase after the female. The starting values are the values of v_{M} (direction and size), the position and the body direction. The starting values are adapted from the experiment with fine tuning to obtain a better fit between model and experiment. An example of the results to be obtained with the model is given **here.**