## Sideways velocity control Model

**Modelling sideways velocity control**

*Megachile willughbiella*males are able to fly sideways in the direction perpendicular to the body axis. This behaviour is sometimes apparent as part of the chasing behaviour. Sideways velocity control has also been found with the hoverfly

*Syritta pipiens*(Collet and Land, 1975) and the solitary wasp

*Odynerus spinipes*(Voss and Zeil, 1998).

Here the 2D model will be extended with sideways velocity control. The direction of the body, as a complex number, is given by exp(i.φ(k)). The direction perpendicular to the direction of the body is given by i* exp(i.φ(k)). For *Syritta,* the sideways velocity is approximately proportional to θ_{e} , defining the location of the female image on the male retina. This logical choice will be made here too.

The sideways velocity will be given by exp(i.φ(k))*i*K_{t}*θe_{filt}(k), here exp(i.φ(k)) is a unit vector in the direction of the body, exp(i.φ(k))*i is a unit vector in the direction perpendicular to the body-axis. The magnitude of the sideways velocity is proportional to θ_{e} . Here a filtered version of θ_{e} will be used to simulate the neural delay

θe_{filt}(k)=( exp(-T/τ_{f}))* θe_{filt}(k-1)+(1- exp(-T/τ_{f}))* θ_{e}(k). (1)

The constant of proportionality is K_{t}. The expression for the sideways velocity will be added to the expression for calculating the velocity v_{M}(k) via the filter with timeconstant τ.

v_{M}(k) without sideways velocity control :

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

v_{M}(k) with sideways velocity control :

v_{M}(k)=(exp(-T/τ))*v_{M}(k-1)+(1- exp(-T/τ))*[sp_{filt}(k)*exp(i.φ(k))+ exp(i.φ(k))*i*K_{t}*θe_{filt}(k)] (2)

*The complete 2D algorithm with sideways velocity control *:

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

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

θe_{filt}(k)=( exp(-T/τ_{f}))* θe_{filt}(k-1)+(1- exp(-T/τ_{f}))* θ_{e}(k).

v_{M}(k)=(exp(-T/τ))*v_{M}(k-1)+(1- exp(-T/τ))*[sp_{filt}(k)*exp(i.φ(k))+ exp(i.φ(k))*i*K_{t}*θe_{filt}(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