ABSTRACT Title of dissertation: RECONSTRUCTION, ANALYSIS AND SYNTHESIS OF COLLECTIVE MOTION Biswadip Dey, Doctor of Philosophy, 2015 Dissertation directed by: Professor P. S. Krishnaprasad Dept. of Electrical & Computer Engineering As collective motion plays a crucial role in modern day robotics and engi- neering, it seems appealing to seek inspiration from nature, which abounds with examples of collective motion (starling flocks, fish schools etc.). This approach to- wards understanding and reverse-engineering a particular aspect of nature forms the foundation of this dissertation, and its main contribution is threefold. First we identify the importance of appropriate algorithms to extract param- eters of motion from sampled observations of the trajectory, and then by assuming an appropriate generative model we turn this into a regularized inversion problem with the regularization term imposing smoothness of the reconstructed trajectory. First we assume a linear triple-integrator model, and by penalizing high values of the jerk path integral we reconstruct the trajectory through an analytical approach. Alternatively, the evolution of a trajectory can be governed by natural Frenet frame equations. Inadequacy of integrability theory for nonlinear systems poses the ut- most challenge in having an analytic solution, and forces us to adopt a numerical optimization approach. However, by noting the fact that the underlying dynamics defines a left invariant vector field on a Lie group, we develop a framework based on Pontryagin’s maximum principle. This approach toward data smoothing yields a semi-analytic solution. Equipped with appropriate algorithms for trajectory reconstruction we analyze flight data for biological motions, and this marks the second contribution of this dissertation. By analyzing the flight data of big brown bats in two different settings (chasing a free-flying praying mantis and competing with a conspecific to catch a tethered mealworm), we provide evidence to show the presence of a context specific switch in flight strategy. Moreover, our approach provides a way to estimate the behavioral latency associated with these foraging behaviors. On the other hand, we have also analyzed the flight data of European starling flocks, and it can be concluded from our analysis that the flock-averaged coherence (the average cosine of the angle between the velocities of a focal bird and its neighborhood center of mass, averaged over the entire flock) gets maximized by considering 5-7 nearest neighbors. The analysis also sheds some light into the underlying feedback mechanism for steering control. The third and final contribution of this dissertation lies in the domain of control law synthesis. Drawing inspiration from coherent movement of starling flocks, we introduce a strategy (Topological Velocity Alignment) for collective motion, wherein each agent aligns its velocity along the direction of motion of its neighborhood center of mass. A feedback law has also been proposed for achieving this strategy, and we have analyzed two special cases (two-body system; and an N -body system with cyclic interaction) to show effectiveness of our proposed feedback law. It has been observed through numerical simulation and robotic implementation that this approach towards collective motion can give rise to a splitting behavior. RECONSTRUCTION, ANALYSIS AND SYNTHESIS OF COLLECTIVE MOTION by Biswadip Dey Dissertation submitted to the Faculty of the Graduate School of the University of Maryland, College Park in partial fulfillment of the requirements for the degree of Doctor of Philosophy 2015 Advisory Committee: Professor P. S. Krishnaprasad, Chair/Advisor Professor S. I. Marcus Professor A. L. Tits Dr. E. W. Justh Professor D. Levy, Dean’s Representative c© Copyright by Biswadip Dey 2015 Dedicated to Shawon and my parents ii Acknowledgments First and foremost, I would like to thank my advisor, Prof. P. S. Krishnaprasad for giving me an invaluable opportunity to work on challenging and extremely in- teresting problems over the past five and half years. He has always made himself available for help and advice, and there has never been an occasion when I have vis- ited his office and he has not given me time. His attention to detail and dedication to exceptional scientific writing have made each of our manuscripts a work of art. Furthermore, his standards of excellence in research and teaching, and his passion for science, have been a continuous source of inspiration. It has been a pleasure to work with and learn from such an extraordinary individual. I would also like to thank Prof. Steve Marcus, Prof. Andre Tits, Dr. Eric Justh and Prof. Doron Levy for agreeing to serve on my dissertation committee and for sparing their invaluable time reviewing the manuscript. I am particularly thankful to Prof. Tits for providing me guidance in improving the quality of Chapter 4. I am indebted to the research group of Prof. Andrea Cavagna and Prof. Cynthia Moss, for sharing with me their experimental data on starling murmuration and bat foraging. These data formed the foundation for our analysis (in Chapter 5 and 6) on flight strategies and steering control mechanism. This acknowledgement will be incomplete without recognizing the support of my teachers from the Bachelor’s and Master’s program at Jadavpur University and iii IIT Bombay, respectively. In particular, Prof. Tapan Kumar Ghoshal, Prof. Ravi Banavar, Prof. Madhu Belur, Prof. Harish Pillai have played very instrumental roles in shaping my interest in control theory and motivating me towards research. My friends and colleagues at the Intelligent Servosystems Laboratory have enriched my graduate life in many ways and they deserve a special mention. I am particularly thankful to Kevin Galloway, Matteo Mischiati, Ben Flom, Yunlong Huang, Vidya Raju, Udit Halder for all the stimulating discussions and feedback. It has been a pleasure to collaborate with Kevin and Udit during the last leg of this journey. I would like to take this opportunity to acknowledge help and support from the staff members of the Electrical and Computer Engineering Department and the Institute for Systems Research. In particular, I would like to thank Ms. Pamela White, Ms. Alexis Jenkins, Ms. Regina King, Ms. Beverly Dennis and Ms. Melanie Prange. With Pam and Beverly’s assistance, I never had to think about my con- ference registrations and travel arrangements. Also, the technical support from the ECE Department computing facilities help desk is highly appreciated. Many other friends outside the lab have been great sources of conversation, inspiration, motivation and sometimes just pure fun. Agniv, Anup, Arijit, Arya, Barna, Dipankar, Jiaul, Pritam, Rajibul, Ranchu, Ranjith, Shinkyu, Siddharth, Soumyadip, Srimoyee and Udit - thank you all for making my time at College Park such a memorable one. I am also fortunate for my enduring friendships with Mrinmoy and Trishit, the best buddies one can ever ask for. No accomplishment of mine has been made without the strong support of iv family. My parents are a source of inspiration and have always done everything in their power to make my dreams a reality. My wife Shawon has been a great companion on this journey, lovingly sharing with me all the sacrifices, bitterness and happiness of our lives, and playing a leading role in sorting out our very own 2-body problem. I am grateful for all her support, care and love. I gratefully acknowledge the financial supports from the Air Force Office of Scientific Research under AFOSR Grant No. FA9550-10-1-0250 and FA2386-12-1- 3002 (FY2012 DURIP); from the Office of Naval Research under ODDR&E MURI Program Grant No. N000140710734; from the Army Research Laboratory under ARL/ARO MURI Program Grant No. W911NF-13-1-0390; and from the Kulkarni Foundation Summer Research Fellowship. v Table of Contents 1 Introduction 1 1.1 Background and Motivation . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 Mathematical Preliminaries . . . . . . . . . . . . . . . . . . . . . . . 9 1.3.1 Self-steering Particle Model . . . . . . . . . . . . . . . . . . . 9 1.3.2 Pursuit Strategies and Feedback Laws . . . . . . . . . . . . . 12 I Reconstruction of Collectives 18 2 Data Smoothing through Nonlinear Optimization - Mathematical Programming 19 2.1 Regularized Inversion Problem . . . . . . . . . . . . . . . . . . . . . . 22 2.2 Some Practical Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.2.1 Numerical Integration for the Group Dynamics . . . . . . . . 24 2.2.2 Parametrization of SOp3q Using Cayley Transform . . . . . . 27 2.2.3 Customization for Mathematical Programming . . . . . . . . . 29 2.2.4 Multi-stage Approach for Optimization . . . . . . . . . . . . . 31 2.3 Ordinary Cross Validation for the Regularized Inversion Problem . . 33 2.4 Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 vi 3 Data Smoothing through Linear Quadratic Optimal Control 38 3.1 Problem Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 3.2 A Control Theoretic Approach . . . . . . . . . . . . . . . . . . . . . . 42 3.2.1 Path Independence Lemma and Its Application to Data Smooth- ing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 3.2.2 Linearity of Reconstruction . . . . . . . . . . . . . . . . . . . 59 3.3 An Alternative Co-state Based Approach . . . . . . . . . . . . . . . . 62 3.4 Ordinary Cross Validation for Optimal λ Selection . . . . . . . . . . . 67 3.5 Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 4 Data Smoothing through Nonlinear Optimization - Maximum Principle 77 4.1 Data smoothing in a Euclidean setting . . . . . . . . . . . . . . . . . 78 4.2 Data smoothing problems in a Finite Dimensional Matrix Lie group setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 4.3 A Quick Revisit to Lie-Poisson Reduction . . . . . . . . . . . . . . . 99 4.4 Example I: Data Smoothing on SOp3q . . . . . . . . . . . . . . . . . 102 4.4.1 Maximum Principle . . . . . . . . . . . . . . . . . . . . . . . . 104 4.4.2 Frechet Derivative of the Fit Error . . . . . . . . . . . . . . . 105 4.4.3 Reduced Dynamics and Jump Discontinuities on so˚p3q . . . . 107 4.4.4 Explicit Solution of the Reduced Dynamics . . . . . . . . . . . 109 4.5 Example II: Data Smoothing on SEp2q . . . . . . . . . . . . . . . . . 111 4.5.1 Maximum Principle . . . . . . . . . . . . . . . . . . . . . . . . 114 4.5.2 Frechet Derivative of the Fit Error . . . . . . . . . . . . . . . 115 4.5.3 Reduced Dynamics and Jump Discontinuities on se˚p2q . . . . 117 4.5.4 Explicit Solution of the Reduced Dynamics . . . . . . . . . . . 119 4.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 vii II Analysis of Collectives 121 5 Analysis of Bat Foraging in Two Different Contexts 122 5.1 Experiment Details and Reconstruction of Trajectories . . . . . . . . 124 5.2 Pre-processing of Trajectory Data . . . . . . . . . . . . . . . . . . . . 127 5.3 Analysis of Flight Strategy . . . . . . . . . . . . . . . . . . . . . . . . 132 5.4 Analysis of Steering Control . . . . . . . . . . . . . . . . . . . . . . . 137 5.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 6 Analysis of Flocking in European Starlings 149 6.1 Experiment Details and Trajectory Reconstruction . . . . . . . . . . 151 6.2 Analysis of Flight Strategy and Underlying Steering Control . . . . . 154 6.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 III Synthesis of Collectives 162 7 Flocking through Topological Velocity Alignment (TVA) 163 7.1 Topological Velocity Alignment (TVA) Strategy . . . . . . . . . . . . 164 7.2 TVA Strategy for a Planar 2-agent System . . . . . . . . . . . . . . . 168 7.2.1 State Space and Its Reduction onto Shape Space . . . . . . . . 169 7.2.2 Shape Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . 171 7.2.3 Analysis of TVA Feedback Law . . . . . . . . . . . . . . . . . 174 7.2.4 Extension to a Three Dimensional Setting . . . . . . . . . . . 180 7.3 TVA Strategy for an N -agent System with Cyclic Interaction . . . . . 181 7.3.1 State Space and Its Reduction onto Shape Space . . . . . . . . 182 7.3.2 Shape Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . 184 7.3.3 Analysis of TVA Feedback Law . . . . . . . . . . . . . . . . . 189 7.4 Algorithm for an N -agent System in a Three-Dimensional Setting . . 194 7.5 Implementation on Mobile Robot Testbed . . . . . . . . . . . . . . . 196 viii 7.5.1 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . 196 7.5.2 Experiment I . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 7.5.3 Experiment II . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 7.5.4 Experiment III . . . . . . . . . . . . . . . . . . . . . . . . . . 200 8 Conclusion and Future Works 203 8.1 Summary of Contributions and Future Directions of Research . . . . 203 8.1.1 Reconstruction of Collectives . . . . . . . . . . . . . . . . . . 203 8.1.2 Analysis of Collective Behavior in Nature . . . . . . . . . . . . 210 8.1.3 Synthesis of Collective Motion . . . . . . . . . . . . . . . . . . 213 ix List of Figures 1 Natural Frenet frame for a curve in 3-dimensional space . . . . . . . . 11 2 Pursuit strategies: CP & MC . . . . . . . . . . . . . . . . . . . . . . 15 3 Multi resolution approach to solve optimization problem . . . . . . . 32 4 Inclusion of virtual points to take care of the missing data points . . 33 5 Reconstruction of a circular helix . . . . . . . . . . . . . . . . . . . . 36 6 Reconstruction of a curve on a sphere . . . . . . . . . . . . . . . . . . 72 7 Performance comparison: synthetic data . . . . . . . . . . . . . . . . 72 8 Reconstruction of a bat-insect trajectory pair . . . . . . . . . . . . . 74 9 Performance comparison: bat-insect trajectory pair (κ) . . . . . . . . 75 10 Performance comparison: bat-insect trajectory pair (ν) . . . . . . . . 75 11 Lie-Poisson Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . 101 12 Unicycle Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 13 A typical example of trajectory reconstruction (bat-mantis) . . . . . . 125 14 This figure shows the distribution of optimal values of regularization parameter (λ˚) used to reconstruct trajectories for bat-bat interactions.126 15 This figure shows the distribution of optimal values of regularization parameter (λ˚) used to reconstruct trajectories for bat-mantis inter- actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 x 16 This figure shows the CDF for contiguous durations of following and converging (Class I) flight segments. . . . . . . . . . . . . . . . . . . 131 17 Segmentation of flight behavior for the bat-bat interaction . . . . . . 131 18 Segmentation of flight behavior for the bat-mantis interaction . . . . 132 19 Strategy comparison for bat-bat interaction . . . . . . . . . . . . . . 133 20 Strategy comparison for bat-bat interaction (class I) . . . . . . . . . . 134 21 CDF comparison for bat-bat interaction . . . . . . . . . . . . . . . . 134 22 Strategy comparison for bat-mantis interaction . . . . . . . . . . . . . 135 23 Strategy comparison for bat-mantis interaction (class I) . . . . . . . . 135 24 CDF comparison for bat-mantis interaction . . . . . . . . . . . . . . . 136 25 Comparison of CATD and CP feedback laws for bat-bat interaction . 141 26 Residual analysis of CATD feedback law for bat-bat interaction . . . 142 27 Residual analysis of CP feedback law for bat-bat interaction . . . . . 142 28 Comparison of CATD and CP feedback laws for bat-mantis interaction143 29 Residual analysis of CATD feedback law for bat-mantis interaction . 144 30 Residual analysis of CP feedback law for bat-mantis interaction . . . 144 31 Cross validation (OCV) results for flocking events . . . . . . . . . . . 152 32 Reconstruction of flocking events . . . . . . . . . . . . . . . . . . . . 153 33 Variation of flock averaged coherence w.r.t. neighborhood size . . . . 157 34 Variation in correlation of curvatures w.r.t. neighborhood size and behavioral latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 35 Individual trajectories along with their frame vectors . . . . . . . . . 165 36 Variation of Θi with change in angle between xi and xNi . . . . . . . 167 37 Illustration of scalar shape variables for a 2-agent system . . . . . . . 171 38 Illustration of TVA strategy for a 2 agent system . . . . . . . . . . . 176 39 Phase portraits for the restricted dynamics . . . . . . . . . . . . . . . 179 xi 40 Illustration of an N -agent cyclic interaction system . . . . . . . . . . 182 41 Illustration of scalar shape variables for an N -agent cyclic interaction system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 42 Pioneer 3-DX Mobile Robot . . . . . . . . . . . . . . . . . . . . . . . 197 43 Experimental Setup at ISL, University of Maryland, College Park . . 198 44 Experiment I: 8 agents, Flocking . . . . . . . . . . . . . . . . . . . . 199 45 Experiment II: 8 agents, Splitting . . . . . . . . . . . . . . . . . . . . 200 46 Experiment III: 6 agents, Perturbation . . . . . . . . . . . . . . . . . 201 xii List of Tables 2.1 Variation of OCV estimate of λ with different values of signal-to-noise ratio (SNR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.1 Theoretically plausible feedback laws for constant absolute target di- rection (CATD/MC) and classical pursuit (CP). . . . . . . . . . . . . 138 5.2 Summary of the statistical analysis of steering control laws for bat-bat pursuit events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 5.3 Summary of the residual analysis of steering control laws for bat-bat pursuit events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 5.4 Summary of the statistical analysis of steering control laws for bat- mantis pursuit events . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 5.5 Summary of the residual analysis of steering control laws for bat- mantis pursuit events . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 6.1 Summary of Flocking Events . . . . . . . . . . . . . . . . . . . . . . . 154 6.2 Summary of the statistical analysis of steering control laws for starling flocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 xiii List of Abbreviations CATD Constant Absolute Target Direction CP Classical Pursuit DMI Directed Mutual Information MC Motion Camouflage OCV Ordinary Cross Validation ODE Ordinary Differential Equation PMP Pontryagin’s Maximum Principle ROS Robot Operating System SNR Signal to Noise Ratio TVA Topological Velocity Alignment UAV Unmanned Air Vehicle Notations SEpnq Special Euclidean group of dimension n SOpnq Special orthogonal group of dimension n Sn n-dimensional sphere sepnq Lie algebra of SEpnq sopnq Lie algebra of SOpnq In Identity matrix of size nˆ n SOp3q Lie-group of 3ˆ 3 orthogonal Matrices sop3q Vector space of 3ˆ 3 skew-symmetric matrices Opǫq Big O-notation (Infinitesimal asymptotics) xiv Chapter 1: Introduction 1.1 Background and Motivation Collective motion plays a pivotal role in modern robotics and engineering, es- pecially in the area of search and rescue missions (Andriluka et al. [2010]; Liu & Nejat [2013]; Marques et al. [2006]), surveillance (Ahmadzadeh et al. [2006]; Bethke et al. [2009]; Harmon [1987]; Kingston et al. [2008]; Li et al. [2008]; Quigley et al. [2005]), environmental monitoring (Dunbabin & Marques [2012]; Elfes et al. [1998]; Leonard et al. [2010]; Pinto et al. [2013]; Tokekar et al. [2010, 2013]) etc. On the other hand, examples of collective motion can be observed in a variety of natural settings. Fish schools [Gautrais et al., 2009], locust migratory bands [Bazazi et al., 2008], pigeon flights [Nagy et al., 2010], starling murmurations [Ballerini et al., 2008b] - examples are ubiquitous in nature. The reasons for living in a group are relatively well studied, and researchers have attributed a range of evolutionary factors be- hind group motion, including better defense against predator attack [Carere et al., 2009], energy efficient movement due to aerodynamic (Cutts & Speakman [1994]; Weimerskirch et al. [2001]) or hydrodynamic [Herskin & Steffensen, 1998] coupling, information sharing [Miller et al., 2013], cooperative food collection [Beekman et al., 2001], and others. However, the individual-level interaction mechanisms, that give 1 rise to group level collective behavior, are not yet well-understood. Therefore, it seems to be a relevant effort to explore the underlying strategies and control laws governing collective motion, because it is not only beneficial from the perspective of engineering adaptation and exploitation, but it will also further our basic sci- entific understanding of nature. Also, with recent advances in bio-inspired designs for unmanned vehicles (Roberts et al. [2014]; Sfakiotakis et al. [2014]; Tan et al. [2006]), the importance of understanding the interaction mechanism (governing col- lective behavior) is becoming more and more prominent. The primary objective of this dissertation is to contribute to both the analysis of collective motion arising in natural settings, and the synthesis of biomimetic, decentralized algorithms for collective motion. As the first step towards our goal, we identify the need to recover a trajectory, along with its higher order derivatives, from a finite set of discrete, probably noisy, observations. Generally, in the field of neuroethology and bio-inspired robotics, the research is often aimed towards exploration of the underlying strategies and steering control laws governing pursuit (Chiu et al. [2010]; Olberg et al. [2000]) and collective motion (Ballerini et al. [2008b]; Nagy et al. [2010]), and an integral part of this study involves analysis of relevant parameters of motion (namely curvature, speed, lateral acceleration etc.). Although the existing techniques for trajectory reconstruction use cubic splines or smoothing filters, in many cases they lack appropriate physical justification. From a broader perspective, the problem of recovering a smoothened signal from noisy observations appears in many areas of science and engineering, and belongs to a broader class of ill-posed (due to non-uniqueness, high sensitivity 2 to noise) inverse problems. In our approach, we tackle the lack of well-posedness of this inverse problem by the method of regularization (Tikhonov [1963]; Wahba [1990]), and embed this problem into a proper hypothesis space. With an intention to leverage the tech- niques from optimal control theory, we introduce generative models (governed by differential equations) with inputs, states and outputs, and construct the hypothesis space as output of this generative model (given an input). This framework allows us to turn data smoothing into a continuous time optimal control problem with intermediate state costs, and the choice for path cost specifies the regularization imposed on the data. Some initial works along a similar line have previously been carried out by Magnus Egerstedt, Clyde Martin and their collaborators. Zhang et al. [1997] have introduced the idea that spline functions can be constructed using techniques from linear control theory, and developed polynomial interpolating splines using linear generative models. Later, by adopting a variational approach for linear time in- variant generative models, Shan et al. [2000] develops the necessary framework to recover a smoothing input (scalar) from noisy samples of output data (scalar). How- ever, this analysis does not provide much insight about extending the results for a linear multi input multi output system. Later works (Kano et al. [2008]; Zhou et al. [2005, 2006]) along this line address some related aspects, and a book by Egerstedt & Martin [2010] provides a nice survey of the key developments along this line. Alternatively one can describe the trajectory using a nonlinear generative model (probably evolving on a Lie group), and by choosing appropriate control 3 inputs, this problem can be cast as a data smoothing problem in a sub-Riemannian setting. Over the last two decades, Peter Crouch, Fatima Silva Leite and their col- laborators, by adopting a variational approach, have been exploring the problem of data smoothing in Riemannian contexts wherein the number of control inputs is same as the dimension of the underlying state space (Crouch & Leite [1991, 1995]; Jakubiak et al. [2006]; Machado et al. [2010]). In a more recent work, Brody et al. [2012] and Burnett et al. [2013], while studying the data smoothing problem in a quantum state transfer context, have used higher order Lagrangian (involving higher order derivatives of control inputs) to impose smoothness of the reconstructed tra- jectory. As recently highlighted in the work of Ben-Yosef & Ben-Shahar [2012], this regularization based approach towards data smoothing can be used to address prob- lems in computer vision. Drawing inspiration from neuro-physiological aspects of the primary visual cortex (V1), in particular the ice-cube model [Hubel, 1995], this recent work suggests that a curve completion problem can be formulated as a data smoothing problem on SEp2q. Equipped with an appropriate algorithm for trajectory reconstruction and parameter extraction, we set our next goal as analyzing flight trajectory data and exploring feedback laws underlying pursuit and collective motion in natural settings. Although the history of studying collective motion in nature dates back to the first half of the last century [Spooner, 1931], studying collective behavior from a reverse engineering perspective did not start until very recently. Complete understanding of the sensory perception and motor control governing collective motion (or even 4 pursuit) still remains an open problem. Individual members of the group are believed to use simple and plausible rules (control laws) which can be represented in a co- ordinate free manner, or in other words the laws should depend only on the relative motion information. One of the primary aims of this dissertation is to study the underlying mechanism of starling flocks. Although researchers have studied different aspects of flocking behavior in European starlings Ballerini et al. [2008a,b]; Cavagna et al. [2010]; Young et al. [2013], the interaction laws are not yet understood. By modelling the individual members as self driven particles under gyroscopic control, we aim to gather some insight for this relatively unexplored aspect. The existing models for collective motion can be classified into two distinct categories: (i) Eulerian or continuum; and (ii) Lagrangian or individualistic. The Eulerian model uses a set of partial differential equations to describe the spatio- temporal evolution of the group density of a collective. Although this modeling approach does not appear to be very relevant in the context of robotic implementa- tions, it has shown its effectiveness in analyzing densely packed collectives (Kudrolli et al. [2008]; Topaz et al. [2006]; Zhang et al. [2010]). On the other hand, in a more individualistic Lagrangian approach the dynam- ics of each member is influenced by the state of the other members of group (this survey paper by Vicsek & Zafeiris [2012] provides a comprehensive review of the research along these lines). Although the first algorithm for collective motion was developed by Aoki [1982] for simulating the motion of a fish school, it is not the most well-known paper in the field. Boids algorithm, proposed in a later work by Reynolds [1987], is more famous in the context of collective motion. However, both 5 of these approaches consider three different modes of interaction between the indi- viduals, namely, (i) velocity alignment with the neighbors; (ii) approach towards the flock center of mass; and (iii) collision avoidance. It was also noted that collective behavior emerges in a leaderless manner. Almost a decade later, Vicsek et al. [1995] introduced the notion of self driven particles for collective motion. By assuming equal and constant speed for individual agents, this work demonstrates the emergence of ordered motion in a planar setting. This flocking behavior is achieved by updating an agent’s direction (at each time step) by the average direction of motion of its neighbors (i.e., agents within a fixed distance from the focal agent). Later, Jadbabaie et al. [2003] gave the much needed theoretical explanation for this flocking behavior. However, a later note by Bertsekas & Tsitsiklis [2007] has shown that the main convergence results of this work can be perceived as a special case of some earlier results by Tsitsiklis et al. [1986]. A more recent work by Cucker & Smale [2007] describes the evolution of a flock by considering a polynomial decay of the influence between individuals in the flock as they separate in space. A common theme in this line of works is that individual agents are assumed to governed by first-order dynamics, which allows us to interpret the consensus dynamics as a discrete analogue of heat equation. However, a recent work by Attanasi et al. [2014] suggests that directional information within a flock propagates with an almost constant speed, which is much faster than the diffusive transport of information predicted by first-order models with heat-like aspects. This observation provides sufficient justification to look beyond first-order consensus algorithms. Interestingly, over the last few years a shift of 6 attention towards second-order consensus algorithms has been noticed in the control community too (Olfati-Saber [2006]; Ren [2008]; Ren & Atkins [2005]; Yu et al. [2010, 2011]). In this dissertation we propose a strategy for collective motion which can explain how local interactions between neighbors can influence the agents to align their headings in a single common direction. Moreover, this strategy, which we refer as topological velocity alignment (TVA), has wave-like aspects and can explain fast propagation of information across the flock. 1.2 Thesis Outline In Chapter 2, we define the problem of trajectory reconstruction as a nonlinear optimization problem and approach it from a mathematical programming perspec- tive. By assuming the natural Frenet frame equations as the underlying generative model, and penalizing high rates of change in curvatures and speed, we turn the trajectory reconstruction problem into a regularized inverse problem. This regular- ized inverse problem can be viewed as an optimization over an infinite dimensional function space. We introduce mathematical reparametrization (via Caley trans- form, exponential mapping etc.) of the underlying variables to make the problem tractable, and then use a numerical routine (fminunc [fminunc]) to solve the op- timization. Also, by noting the importance of cross validation in this context, we perform ordinary cross validation to compute an optimal amount of regularization. As the previous approach was computationally very demanding, and doesn’t guarantee minimization in a global sense, we develop an alternative linear formu- 7 lation of the trajectory reconstruction problem in Chapter 3. By using a triple integrator as the underlying generative model for trajectory evolution, we regularize the problem by trading total fit-error against high values of the jerk path inte- gral. Then, by using techniques from linear quadratic optimal control theory, this approach yields an analytic solution for the true minimum of this problem. In Chapter 4, we develop a framework to address data smoothing problems arising in a nonlinear setting. Then, by using a modified version of Pontryagin’s maximum principle, we derive the necessary conditions for a solution of the regu- larized inversion problem. Moreover, as the natural Frenet frame equations for a trajectory can be viewed as a left-invariant dynamics on a Lie group, we extend this result to address data smoothing in a matrix Lie group setting. We end this chapter by discussing two example problem on (on SOp3q and SEp2q, respectively). Then we delve into the analysis of natural occurrences of collective motion. In Chapter 5, we consider the most basic form of collective motion, namely a dyadic in- teraction between two individuals (conspecific and contraspecific). Here, we analyze the flight trajectory data provided by our collaborators from Auditory Neuroethol- ogy Laboratory, Department of Psychology, University of Maryland, and show ev- idences in favor of context specific switch in bat flight strategy. Our analysis also provides an estimate of the sensorimotor delay, associated with the pursuit behavior. Chapter 6 describes the flight strategy analysis of flocking behavior in Euro- pean starlings. Here, we begin by extracting speed and curvatures from the sampled dataset of observed positions. Then we perform correlation analysis to investigate the feedback mechanism for steering control governing coordinate motion of the 8 flocks. Finally, drawing inspiration from our findings in the previous chapter, we pro- pose a flight strategy, called topological velocity alignment (TVA), along with a plausible control law in Chapter 7. This strategy can perceived as a restriction in the underlying state space, wherein each member of the flock align its velocity along the velocity of its neighborhood of center of mass. We complement our theoreti- cal analysis of the proposed control law (in some special cases) by providing some implementation results. 1.3 Mathematical Preliminaries Now we briefly describe some mathematical concepts which we will use through- out this thesis. 1.3.1 Self-steering Particle Model The trajectory of a single particle moving in three dimensional space can be described by a function r : r0, Tfinals Ñ R3, where Tfinal ą 0. If t “ tpsq is a smooth, real valued function and rptq is a curve in R3, we call the curve βpsq fi rptpsqq a reparametrization of the curve r. We assume rptq to be a reg- ular curve, i.e. 9rptq ‰ 0 @t P r0, Tfinals. Now we define the arc length parameter as sptq “ şt 0 ‖ 9rpσq ‖ dσ. Under the regularity assumption, sptq is a continuous, strict monotone increasing function and hence invertible. Therefore a reparametrization of a curve can be obtained by using the arc length as the parameter and this partic- 9 ular parametrization has a special feature. Any curve parametrized using arc length parameter will have unit speed. Let rmodpsq be the reparametrization of rptq using arc length parameter. The evolution of rmodpsq in three dimensional space can be described using the Frenet- Serret framing of this curve, as this is standard in differential geometry [do Carmo, 1976]. But this approach requires the curve to be at least thrice continuously dif- ferentiable and we need the curvature (κpsq “‖ r2modpsq ‖) to be positive to avoid degeneracy in defining the normal direction. The requirement of non-zero curvature everywhere poses serious difficulties in this particular problem of our consideration (as the trajectories, to be reconstructed, may have point of inflection) and hence the Frenet-Serret framing is not the best choice for our purpose. So we use an alternate framing of the curve, the Natural Frenet frame, which is also known as the Relatively Parallel Adapted Frame [Bishop, 1975]. The natural Frenet frame is an alternative approach to define a moving frame that is well-defined even when the curve has vanishing second derivative. The natural Frenet frame is based on the observation that, while the unit tangent vector xptq for a given curve is unique, we can choose two unit vectors pyptq, zptqq on the plane perpendicular to xptq such that txptq,yptq, zptqu defines a right-handed orthogonal frame. The evolution of the frame along the length of the 10 xp0qyp0q zp0q xpt1q ypt1q zpt1qxpt2q ypt2q zpt2q rptq Figure 1: Natural Frenet frame for a curve in 3-dimensional space. trajectory is governed by 9rptq “ νptqxptq 9xptq “ νptq puptqyptq ` vptqzptqq 9yptq “ ´νptquptqxptq 9zptq “ ´νptqvptqxptq, (1.1) where ν is the speed and (u,v) are the natural curvatures of the trajectory. In this approach for framing a regular curve, we can choose the initial orientation of the frame at our will as yp0q and zp0q can be chosen arbitrarily, in contrary to the Frenet-Serret frame equations where all three frame vectors are uniquely defined 11 once the curve is given (under a hypothesis of positive curvature). From uptq and vptq (which can be viewed as Cartesian components of the curvature) we can obtain the curvature κptq and the torsion τptq using the following set of relations: κptq “ a u2ptq ` v2ptq, θptq “ arctan ˆ vptq uptq ˙ , τptq “ dθptqdt . 1.3.2 Pursuit Strategies and Feedback Laws 1.3.2.1 Classical pursuit In classical pursuit (CP) the follower (pursuer) moves directly towards the evader (target). By representing the evader position by re, pursuer position by rp, and pursuer direction of motion by xp, we can define a contrast function (Λ) as Λ “ xp ¨ r |r| , (1.2) to measure how closely the leader-follower relationship matches the CP strategy, where r “ rp ´ re. This contrast function can be interpreted as the cosine of the angle between the baseline vector and the velocity of the pursuer and Λ “ ´1 implies that the pursuer is on the CP manifold. Proposition 1.1 (Galloway et al. [2010], Proposition 1). Let us assume that the dynamics of the pursuer (rp) and the evader (re) trajectories be governed by the natural Frenet frame equations, with (νp, up, vp) and (νe, ue, ve) being the speed and 12 curvatures, respectively. Consider the feedback control law given by up “ 1 νp ” ´ µ ` yp ¨ r |r| ˘ ´ 1|r| ´ zp ¨ ` 9rˆ r|r| ˘¯ı (1.3) vp “ 1 νp ” ´ µ ` zp ¨ r |r| ˘ ` 1|r| ´ yp ¨ ` 9rˆ r|r| ˘¯ı where µ ą 0 is the feedback gain. Then Λptq Ñ ´1 as t Ñ 8, whenever Λp0q R t1,´1u. Proof. We begin by differentiating Λ along the trajectories of the generative model for both pursuer and evader. 9Λ “ 9xp ¨ r |r| ` xp ¨ d dt ˆ r |r| ˙ “ νp pupyp ` vpzpq ¨ r |r| ` 1 |r|xp ¨ ˆ 9r´ ˆ 9r ¨ r|r| ˙ r |r| ˙ . (1.4) Now we define the transverse component of the relative velocity as w “ 9r´ ˆ 9r ¨ r|r| ˙ r |r| , and by using the BAC-CAB identity, a ˆ pb ˆ cq “ b ¨ pa ˆ cq ´ c ¨ pa ˆ bq, for arbitrary vectors a, b and c, we note that w “ 9r ˆ r |r| ¨ r |r| ˙ ´ r|r| ˆ r |r| ¨ 9r ˙ “ r|r| ˆ ˆ 9rˆ r|r| ˙ . (1.5) 13 As the feedback law is governed by (1.3) and the transverse component of the relative velocity can be expressed as a vector triple product (1.5), we can re-write (1.4) as 9Λ “ ´µ «ˆ yp ¨ r |r| ˙2 ` ˆ zp ¨ r |r| ˙2ff ` 1|r|xp ¨w ´ 1|r| „ˆ zp ¨ ˆ 9rˆ r|r| ˙˙ˆ yp ¨ r |r| ˙ ´ ˆ yp ¨ ˆ 9rˆ r|r| ˙˙ˆ zp ¨ r |r| ˙ “ ´µ «ˆ r |r| ¨ r |r| ˙2 ´ ˆ r |r| ¨ xp ˙2ff ` 1|r|xp ¨w ´ 1|r| pzp ˆ ypq ¨ ˆˆ 9rˆ r|r| ˙ ˆ r|r| ˙ “ ´µ ` 1´ Λ2 ˘ ` 1|r| rxp ¨w ´ pyp ˆ zpq ¨ws . (1.6) Now yp ˆ zp “ xp because txp,yp, zpu forms an orthonormal triad. Therefore, we have 9Λ “ ´µ ` 1´ Λ2 ˘ , (1.7) and it is clear from (1.7) that whenever Λ P p´1, 1q it results in 9Λ ă 0. In fact it can be concluded that the level sets of tΛ “ 1u and tΛ “ ´1u are two invariant manifolds under the closed loop dynamics. Moreover, by assuming Λp0q ‰ ˘1, we have Λptq “ Ke ´2µt ` 1 Ke´2µt ´ 1 (1.8) where the constant K is defined as K “ Λ0`1Λ0´1 . Since e ´2µt Ñ 0 as t Ñ 8, we have Λptq Ñ ´1 as tÑ 8. 14 (a) Classical Pursuit (CP). (b) Motion Camouflage (MC). Figure 2: These figures illustrate the strategies to be examined, namely (a) Classical Pursuit and (b) Motion Camouflage. The red curve and arrow represents the evader trajectory, along with its velocity. In a similar way, the blue curve and arrow represents the pursuer trajectory, along with its velocity. The black lines corresponds to the baselines connecting the pursuer with the evader. 1.3.2.2 Motion camouflage In motion camouflage (MC) (with respect to infinity) the follower approaches the leader in such a way that the relative velocity does not have any transverse component with respect to the baseline vector [Justh & Krishnaprasad, 2006]. Mo- tion camouflage with respect to infinity is a stealthy pursuit because it nullifies the motion parallax. Similar to CP one can define a contrast function to measure how closely the leader-follower relationship matches the MC strategy. One such contrast function is given by Γ “ r|r| ¨ 9r | 9r| , (1.9) where the baseline vector is defined as r “ rp ´ re. One can easily check that Γ is the cosine of the angle between the baseline vector and the relative velocity 15 of the follower with respect to the leader. Moreover Γ “ ´1 implies that the follower is on the MC manifold. MC is also referred as the constant absolute target direction strategy (CATD) because the direction of the baseline vector remains fixed throughout the pursuit. Now we recall the following result by Reddy et al. [2006] to show finite time accessibility of motion camouflage in three dimensions. Proposition 1.2 (Reddy et al. [2006]). Let us assume that the dynamics of the pursuer (rp) and the evader (re) trajectories are governed by the natural Frenet frame equations, with (νp, up, vp) and (νe, ue, ve) being the speed and curvatures, respectively. Consider the feedback control law given by up “ ´µ ´ zp ¨ ` 9rˆ r|r| ˘¯ (1.10) vp “ µ ´ yp ¨ ` 9rˆ r|r| ˘¯ . Moreover we assume the following hypotheses to be true: (A1) 0 ă νlowp ď νp ď νhighp ă 8, where νlowp and νhighp are constants. (A2) 0 ă νlowe ď νe ď νhighe ă 8, where νlowe and νhighe are constants. (A3) νe{νp ď νMAX ă 1, where νMAX is a constant. (A4) ue and ve are piecewise continuous, and a u2e ` v2e is bounded. (A5) 9νe and 9νp are piecewise continuous; | 9νe| ă αe and | 9νp| ă αp where αe and αp are finite constants. (A6) Γp0q ă 1 and |rp0q| ą 0. 16 Then motion camouflage is accessible in finite time using high-gain feedback, i.e. by choosing µ ą 0 to be sufficiently large. In a later work Reddy et al. [2007] have shown that motion camouflage is acces- sible in finite time even when some amount of delay is incorporated into the feedback law (under some constraints on the feedback gain, delay and relative speed). 17 Part I Reconstruction of Collectives 18 Chapter 2: Data Smoothing through Nonlinear Optimization - Math- ematical Programming The problem of recovering a smoothened signal from noisy observations ap- pears in many areas of science and engineering, and belongs to a broader class of inverse problems. By noting that naive solutions are non-unique and highly sensi- tive to noise, it can be concluded that this inverse problem is ill-posed. However, this lack of well-posedness can be tackled through a regularized approach (Tikhonov [1963]; Wahba [1990]). The main idea behind regularization is to embed the prob- lem of interest into a hypothesis space and minimize a cost functional expressed as a sum of two terms: (i) misfit of a hypothesis to observed data; and (ii) a penalty functional accounting for complexity of a hypothesis. In our context, we build the hypothesis space by introducing generative models governed by ordinary differential equations with inputs, states and outputs. This yields the hypothesis as output of the generative model, given an input (control). This set-up allows us to turn data smoothing into a continuous time optimal control problem with intermediate state costs. Regularization, in our context, necessitates penalizing sharp turns in the tra- jectory. By assuming an appropriate generative model for trajectory evolution, this 19 problem of trajectory reconstruction can be formulated as an optimization prob- lem, wherein the regularization term is treated as the Lagrangian, and the fit-errors (between observed data and smoothened data obtained from the generative model) constitute the intermediate and terminal costs. This problem becomes quite rele- vant when we attempt to analyze the strategies and feedback mechanisms governing biological collectives (starling flocks, foraging bats) because the analysis requires studying parameters of motion (speed, curvatures etc.) and this information is available only after the inverse problem has been solved. An important aspect of this approach is to estimate an optimal value for the relative weight of the regularization term with respect to the sum of fit-errors, and then use this estimated value to reconstruct the smoothened signal by solving the optimization problem. In our study, relative weight of the regularization term has been represented by introducing a smoothing parameter (λ) into the optimization cost. Clearly, the choice of this smoothing parameter is critical to the nature of a reconstructed trajectory. It controls the balance between the goodness of fit and the smoothness of the regression function. The optimization algorithm will produce a very wiggly estimate for low values of the smoothing parameter, and at large values the goodness of fit will deteriorate. So a trade-off is required to choose an appropriate value for the smoothing parameter. As the value of λ varies from 0 to 8, the estimate transforms itself from an interpolant of given data points to a geodesic best fitting the data points in a least square manner. The estimation of the smoothing parameter has been done using ordinary cross validation technique. The main idea behind the cross validation technique 20 is the partitioning of given dataset into two subsets, namely the estimation subset and the validation subset. Once the signal is reconstructed using data from the estimation subset, the validation subset is used to examine the performance of the reconstruction. Cross validation attempts to minimize error between the predicted signal and the original signal over the validation data. The inherent nonlinearity of the underlying generative model results in the following interesting features: • System nonlinearity makes it very difficult to obtain a closed form solution for the transition matrix of the underlying generative model, and hence we need to use geometric integration methods. • Lack of closed form solution for the cross validation cost function forces us to compute the cost over a finite set of smoothing parameter values. • The cross validation technique has an inherent parallel structure which can be exploited to accelerate the computational process. Although the main ideas that we pursue in this chapter are similar to the ones developed by Reddy [2007], they differ in the following aspects: • In contrast to the previous approach we have used the initial position (rp0q) as an optimizing variable. Earlier work assumed the initial position to be same as the first data point (r0). • We have used different ways to parametrize the rotation matrix for initial frame orientation (Cayley transform, instead of Euler angles) and the speed of the trajectory (using an exponential function we have shown bijection between R and R`). 21 • The most distinctive difference lies in the way we choose a smoothing param- eter (i.e. λ in (2.1)). In comparison to previously adopted heuristic approach, we implemented an algorithmic way (ordinary cross validation) to select an optimal value for the smoothing parameter. 2.1 Regularized Inversion Problem Treating the feature point as a self-steering particle in three dimensions, a natural generative model for its position rp¨q is given by the natural Frenet frame equations (1.1), and the existence and uniqueness of this generative model has pre- viously been discussed in the work of Bishop [1975]. Now, drawing inspiration from findings in biomechanics, we impose regularization by trading total fit-error against high rates of change in speed and curvatures. Hence, by letting triuNi“0 denote the set of observed positions, one can formulate trajectory reconstruction as the following optimal control problem Minimize rx,y,zspt0q, rpt0q,u,v,ν ˜ Nÿ i“0 }rptiq ´ ri}2 ` λ tNż t0 ` 9u2 ` 9v2 ` 9ν2 ˘ dt ¸ subject to System dynamics: Natural Frenet Frame (1.1), rx y zspt0q P SOp3q, rpt0q P R3, u : rt0, tN s Ñ R, v : rt0, tN s Ñ R, ν : rt0, tN s Ñ R`, (2.1) where the smoothing parameter (λ ą 0) is evaluated through the method of cross validation. 22 Alternatively, we can pack the position vector rptq, along with frame vectors xptq, yptq and zptq, inside a 4ˆ 4 matrix gptq defined as gptq “ » ——– Rptq rptq 0 1 fi ffiffifl P SEp3q, (2.2) where Rptq fi rxptq yptq zptqs P SOp3q represents the frame moving along the trajectory. Then, by letting ξ0 “ E14; ξ2 “ E13 ´ E31; ξ3 “ E21 ´ E12 represent the standard basis elements of sep3q, and teiu4i“1 represent the set of standard basis vec- tors in R4, the nonlinear generative model, i.e. the natural Frenet frame equations, of a curve (1.1) can be expressed as 9g “ gξ r “ “ e1 e2 e3 ‰Tge4, (2.3) where ξ is given by ξ “ ν ` ξ0 ` uξ3 ´ vξ2 ˘ “ » ——————————– 0 ´νu ´νv ν νu 0 0 0 νv 0 0 0 0 0 0 0 fi ffiffiffiffiffiffiffiffiffiffifl . (2.4) Clearly, this generative model (2.3) can be perceived as a left-invariant dy- namics on SEp3q, and hence the problem of trajectory reconstruction (2.1) can be treated as a data smoothing problem in a sub-Riemannian setting wherein the 23 number of controls (3) is strictly less than the state-space dimension (6). Although some initial results along this line has been proposed by Brody et al. [2012] and Dey & Krishnaprasad [2014a], further work is required before it leads us to a solution for this problem (2.1). On the other hand, we can treat (2.1) as an optimization problem with constraints (due to the nonlinear generative model) on SEp3q. Then, by expressing the trajectory rp¨q as a function of speed (νp¨q) and curvatures (up¨q, vp¨q), it can be turned into an unconstrained optimization problem. The difficul- ties associated with obtaining a closed form solution of gp¨q forces us to use special approximation techniques. Remark 2.1. It should be noted that λ, the smoothing parameter in the optimization problem (2.1), is not a unit-free quantity. Rather, it has a dimension of rL4T s where L and T represents the dimension of length and time, respectively. Also, to avoid a dimension mismatch inside the integrand of the cost function (2.1), we assume that a unit scaling factor of dimension rL´4T 2s has been applied to 9ν2. 2.2 Some Practical Issues 2.2.1 Numerical Integration for the Group Dynamics One can easily check that the solution for natural Frenet frame equation (2.3) can be expressed as gptq “ gp0qΦT pt, t0q, t P rt0, tN s, (2.5) 24 where the state transition matrix Φpt, t0q is computed as the limit point of the following Peano-Baker series Φpt, t0q “ I4 ` tż t0 ξT pσ1qdσ1 ` tż t0 ξT pσ1q σ1ż t0 ξT pσ2qdσ2dσ1 ` ¨ ¨ ¨ , t ě t0. (2.6) However, finding a closed form solution for Φpt, t0q for any general ξp¨q is very challenging, and this difficulty forces us to adopt a numerical approach. As the dynamical constraint evolves over SEp3q, special care has to be taken while choosing a suitable numerical approach because otherwise numerical computation might force gptjq to leave the manifold for some j P t0, 1, 2, ¨ ¨ ¨ , Nu. To address this issue we adopt a geometric integration method which ensures that the solution will lie on SEp3q at every sample point. However, this advantage is gained at the cost of some freedom on the choice of speed and curvatures, in particular by assuming the speed and curvatures to be piecewise-constant functions. Now we consider a refined partition of the time interval rt0, tN s, given by tt0 “ t0r ă t1r ă t2r ă ¨ ¨ ¨ ă tKr “ tNu, where the length of these Kr number of equal intervals is given as δ “ tN´t0Kr . By using the semi-group property of state transition matrices, we have Φptkr , t0q “ Φptkr , tpk´1qrqΦptpk´1qr , tpk´2qrq ¨ ¨ ¨Φpt2r , t1rqΦpt1r , t0q, 25 and this provides a recursive representation of gptkrq, given by gptkrq “ gptpk´1qrqΦ T ptkr , tpk´1qrq. (2.7) Now, by exploiting the piecewise-constant nature of speed and curvatures, we assume uptq “ uk, vptq “ vk and νptq “ νk over the interval rtk´1r , tkrq. These assumptions make ξp¨q constant on rtk´1r , tkrq, and as a consequence the state-transition matrix ΦT ptkr , tpk´1qrq can be represented as Φptkr , tpk´1qrq “ » ——————————– cospδαkνkq ukαk sinpδαkνkq vk αk sinpδαkνkq 0 ´ukαk sinpδαkνkq pv2k`u2k cospδαkνkqq α2k ukvkpcospδαkνkq´1q α2k 0 ´ vkαk sinpδαkνkq ukvkpcospδαkνkq´1q α2k pu2k`v2k cospδαkνkqq α2k 0 1 αk sinpδαkνkq ukp1´cospδαkνkqq α2k vkp1´cospδαkνkqq α2k 1 fi ffiffiffiffiffiffiffiffiffiffifl , (2.8) where αk “ a u2k ` v2k. Finally, by using the expressions from (2.2) and (2.8), (2.7) yields the following recursive equations to represent evolution of the trajectory rp¨q, along with the natural Frenet frame Rp¨q, Rptkq “ Rptk´1q » ——————– cospδαkνkq ´ukαk sinpδαkνkq ´ vk αk sinpδαkνkq uk αk sinpδαkνkq pv2k`u2k cospδαkνkqq α2k ukvkpcospδαkνkq´1q α2k vk αk sinpδαkνkq ukvkpcospδαkνkq´1q α2k pu2k`v2k cospδαkνkqq α2k fi ffiffiffiffiffiffifl (2.9) rptkq “ rptk´1q ` 1 α2k rαk sinpδαkνkqxptk´1q ` ukp1´ cospδαkνkqqyptk´1q `vkp1´ cospδαkνkqqzptk´1qs . (2.10) 26 Thus we have have solved the differential equation and a closed form solution for the trajectory has been achieved under the piecewise constant assumption. 2.2.2 Parametrization of SOp3q Using Cayley Transform Moreover, we let initial orientation of the natural frame (Rpt0q) to be another variable for optimization. But Rpt0q lies on a nonlinear manifold (SOp3q), and an optimization on a manifold is not as straightforward as an one on a Euclidean space Rn. This forces us to adopt a suitable way to parametrize SOp3q. Although there are various methods for parametrizing SOp3q, we choose the approach using Cayley transform. There is another popular approach using the Euler angles but this approach suffers from the singularity issue which arises from the fact that SOp3q and S1 ˆ S1 ˆ S1 are not equivalent topologically. Clearly, for any Θ P SOp3q and any x P R3, we have ă Θx,Θx ą“ă x,ΘTΘx ą ñ ă Θx,Θx ą“ă x, x ą as Θ P SOp3q ñ ă Θx,Θx ą ´ ă x, x ą“ 0 ñ ă pΘ` I3qx, pΘ´ I3qx ą“ 0. (2.11) Now we introduce a new variable z defined as z “ pΘ` I3qx. By assuming ´1 not to be an eigen-value of Θ, we can show that pΘ ` I3q is invertible and its column 27 space is the full space R3. Then (2.11) can be equivalently represented as ă z, pΘ ´ I3qpΘ` I3q´1z ą“ 0, @z P R3. (2.12) It can easily be concluded from (2.12), that pΘ´ I3qpΘ` I3q´1 is a skew-symmetric matrix. Hence we introduce Ψ P sop3q defined as Ψ “ pΘ´ I3qpΘ` I3q´1, (2.13) and thus we have shown that almost every element in SOp3q (excluding a small set) can be mapped to sop3q. On the other hand, for every Ψ˜ P sop3q, we can define Θ˜ “ pI3 ´ Ψ˜q´1pI3 ` Ψ˜q (as the eigen-values of Ψ˜ are pure imaginary). As Θ˜ doesn’t have any eigen value at -1, Ψ˜ can be represented as Ψ˜ “ pΘ˜´ I3qpΘ˜` I3q´1. Then for any x P R3, we have ă x, pΘ˜´ I3qpΘ˜` I3q´1x ą“ 0. (2.14) Now we introduce z “ pΘ˜` I3q´1x, and this allows us to express (2.14) as ă pΘ˜` I3qz, pΘ˜´ I3qz ą “ 0 for any z P R3, or equivalently, Θ˜T Θ˜ “ I3. (2.15) 28 Moreover, we have detpΘ˜q “ 1. Thus we can conclude that the map f : sop3q Ñ SOp3q Ψ ÞÑ pI3 ´Ψq´1pI3 `Ψq (2.16) is injective, but not surjective. A thin set U on SOp3q, defined as U fi tΘ P SOp3q : detpΘ` I3q “ 0u, does not have any inverse image under this f . Thus the parametrization of SOp3q using Cayley transform does not suffer from singularity issues. As each element in sop3q can be identified with an element in R3 (through the inverse hat operator) and vice-versa, we can reformulate an optimization problem over SOp3qzU as an optimization problem over R3. 2.2.3 Customization for Mathematical Programming As the speed (νp¨q “ | 9rp¨q}) is allowed only to be positive, we introduce a new variable ν˜ defined as ν˜p¨q “ lnpνp¨qq. In other words νp¨q “ eν˜p¨q. This parametriza- tion along with the usage of Cayley transform and assumption for piecewise constant control inputs allows us to transform the original optimization problem (2.1) into an equivalent optimization problem over Rl, where l is a large integer of appropri- ate value. Now we assume uniform sampling of the trajectory and let rtk´1, tks be partitioned into M equal sub intervals, i.e. tk ´ tk´1 “ Mδ where δ is de- fined as δ “ tN´t0MN . We define U to be the sequence of piecewise constant curvatures tu1, u2, u3, ¨ ¨ ¨ , uNMu. In a similar fashion, V and Ξ represent the sequences of piece- wise controls tv1, v2, v3, ¨ ¨ ¨ , vNMu and tν˜1, ν˜2, ν˜3, ¨ ¨ ¨ , ν˜NMu, respectively. Now, by 29 letting qRp0q P R3 define the initial orientation of the natural Frenet frame through Cayley transform, the equivalent optimization problem can be written as: min U P RNM ,V P RNM ,Ξ P RNM qRp0q P R3, rp0q P R3 ˜ Nÿ j“0 Cj ¸ (2.17) subject to the constraints Rptkq “ Rptk´1q » ——————– cospδkαkeν˜kq ´ukαk sinpδkαke ν˜kq ´ vkαk sinpδkαke ν˜kq uk αk sinpδkαke ν˜kq pv 2 k`u2k cospδkαkeν˜k qq α2k ukvkpcospδkαkeν˜k q´1q α2k vk αk sinpδkαke ν˜kq ukvkpcospδkαkeν˜k q´1qα2k pu2k`v2k cospδkαkeν˜k qq α2k fi ffiffiffiffiffiffifl rptkq “ rptk´1q ` 1 α2k “ αk sinpδkαkeν˜kqxptk´1q ` ukp1´ cospδkαkeν˜kqqyptk´1q `vkp1´ cospδkαkeν˜kqqzptk´1q ‰ where αk “ a u2k ` v2k. Moreover, the cost associated with each interval is given by Cj “ }rptjq ´ rj}2 ` λ jMÿ i“pj´1qM`1 1 δ “ pui ´ ui´1q2 ` pvi ´ vi´1q2 ` e2ν˜ipν˜i ´ ν˜i´1q2 ‰ for any j P t1, 2, 3, ¨ ¨ ¨ , N ´ 1, Nu and C0 “‖ rpt0q ´ r0 ‖2 . 30 Thus, as a consequence of these numerical adjustments (reformulation over a re- stricted search space of piecewise constant functions) and various reparametriza- tions (Cayley transform, exponential function), we end up solving an optimization problem over R3NM`6. 2.2.4 Multi-stage Approach for Optimization We adopt a multi resolution approach for achieving faster convergence in the optimization problem. In this approach, we first sample the data points, i.e. rj ’s at a coarse resolution and run the optimization routine to yield a better control input. Then we use the midpoint rule to interpolate the optimized control inputs and use this finer set as an initial search point for the next step optimization with higher resolution. Another important fact requires attention while going into a finer data set. If the finer data set consisted of even number of data points, then we have to include an extra data point at the end. The curvature and speed value from the last interval of the coarse data set are extended to handle this situation. This process has been explained pictorially in Fig 3. We keep on repeating this process until all the data points are used. Once all the data points are taken into consideration we focus our attention to the missing data points1 within a trajectory, and by introducing some virtual points (as shown in Fig.(4)) we attempt to have uniformly sampled curvature and speed data. These set of virtual points equipartition the whole duration of the 1As three-dimensional position data, in most of the cases, is obtained via stereo-reconstruction from multiple planar images, occlusion gives rise to missing data points in the raw dataset. Also, leaving-out-one strategy for OCV is another source of missing data points. 31                                                                                                        Application of Midpoint Rule Application of Midpoint Rule Optimization Routine Cinii`2 Copti`1 Cinii`1 Copti Fine Data Coarse Data Figure 3: This figure illustrates the multi resolution approach used in solving the optimization problem (2.17). The original data set (with 23 data points) is downsampled twice to yield a coarse data set with 6 data points. Once the control inputs are optimized for the coarse data set, we apply mid-point rule, along with extrapolation, to generate the initial search points for the intermediate resolution data set with 12 data points. Then, after optimization has been carried out for this stage, we apply mid-point rule to obtain the initial search points for the original data set. trajectory without incurring any extra fitting cost, but we consider the smoothness cost associated with them. As a result the optimization yields better result. We also proceed beyond the given resolution by dividing the interval between two consecutive data points (real or virtual) into smaller sub-intervals, i.e. our approach is capable of up-sampling. Thus we obtain more finely interpolated values of speed (ν) and curvatures (u and v). 32 Optimization Routine Inclusion of Virtual Points Copti`1 Cinii`1 Copti Virtual Data Point Real Data Point Figure 4: This figure illustrates the inclusion of virtual points to take care of the missing data points. 2.3 Ordinary Cross Validation for the Regularized Inversion Problem Ordinary cross validation (OCV) was first proposed by Allen [1974] (in the context of regression) and Wahba & Wold [1975] (for smoothing splines). The main idea behind cross validation is to use a subset of the given dataset to obtain a parameter estimate and to use the rest of the data to validate the performance under that estimate. However, cross validation does not use one subset solely for one purpose (estimation or validation); it allows each data point to be used for both purposes. For instance, we can divide the data set into m subsets; compute an estimate from all the subsets but one; and validate the estimate using the left-out subset. Then, we perform the estimation-validation after leaving out a different 33 subset. This process is repeated multiple times until every possible subset has been considered for validation. In our work we use “leaving-out-one” strategy for perform OCV. Here, an estimate for the trajectory is obtained using all but one data points (by solving an optimization problem), and then the prediction error is computed at the left out data point. Once this process has been repeated for each data point, the prediction errors are summed to yield the ordinary cross validation cost, and an optimal value of the regularization parameter (λ) is chosen in such a way that it minimizes the OCV cost. In what follows we provide a brief description of the ordinary cross validation procedure for the regularized inversion problem of our interest (2.1). Let rkλp¨q be a minimizer of the following optimization problem: min ¨ ˚˝ Nÿ j“0 j‰k }rptjq ´ rj}2 ` λ tNż t0 ` 9u2pσq ` 9v2pσq ` 9ν2pσq ˘ dσ ˛ ‹‚ (2.18) subject to the dynamical constraint given by (2.3), where gptq and ξptq are defined in (2.2) and (2.4), respectively. It it worth mentioning here that we solve this optimization problem (2.18) for ordinary cross validation, by transforming it into an equivalent optimization over a high dimensional Euclidean space with discrete constraints (following the guidelines described in Section 2.2). Then the ordinary cross validation cost V0pλq is defined as V0pλq “ 1 N ` 1 Nÿ j“0 }rjλptjq ´ rj}2, (2.19) 34 and the corresponding OCV estimate for λ is given by λ˚ “ argmin λą0 pV0pλqq . (2.20) 2.4 Numerical Results As a demonstration of concept for our proposed approach, we devise six toy problems related to reconstruction of a circular helix with radius r “ 0.2 and pitch 2πh with h “ 0.25. Hence the helix can be parametrized as pr sinpωtq, r cospωtq, hωtq with ω “ 1?r2`h2 being a speed normalizing factor. 46 equi-spaced noisy observations are made along the length of the helix (from t0 “ 0 to tN “ 3.6 time units). These six toy problems under consideration vary only in terms of observation noise, which is independent and identically distributed zero mean Gaussian in each of these six cases. The variance varies from problem to problem which is equivalent to a changing the Signal-to-Noise ratio (SNR). As expected, our numerical experiments show that there is a strong relation- ship between SNR and an OCV estimate for the smoothing parameter pλ˚q (Ta- Prob. No. Noise Std. Deviation (σ) OCV Estimate of λ (λ˚) SNR 1 0.005 1.50ˆ 10´6 40 2 0.010 2.50ˆ 10´6 20 3 0.015 9.00ˆ 10´6 13.33 4 0.020 7.50ˆ 10´6 10 5 0.040 1.50ˆ 10´5 5 6 0.050 2.60ˆ 10´4 4 Table 2.1: Variation of OCV estimate of λ with different values of signal-to-noise ratio (SNR). 35 −0.2 −0.1 0 0.1 0.2 −0.2 −0.1 0 0.1 0.2 0 0.5 1 1.5 2 2.5 y−a xis x−axis z − a x is Reconstructed Curve Sampled Data Ground Truth Figure 5: This figure illustrates the reconstruction of a circular helix (standard deviation of the zero-mean observation noise 0.020). ble 2.1). Moreover, from these observations, we can conclude that λ˚ varies almost proportionally with the inverse of SNR for higher values of SNR. Once we obtain an OCV estimate for the smoothing parameter (λ˚), we recon- struct the trajectory from the observed data points. The reconstructed trajectory for one of the problems is shown in Fig 5. 2.5 Conclusion In this chapter, we have formalized the inverse problem of trajectory recon- struction. Using a nonlinear generative model, we have defined this data smoothing problem as an optimization problem, and treated it from a mathematical program- ming perspective. Although lack of integrability refrains us from getting a semi- 36 analytic solution, we have been able to reformulate the problem over a restricted search space of piecewise constant functions, and then, by exploiting numerical reparametrization (Cayley transform, exponential function), we solved it numeri- cally over a very high dimensional Cartesian space. However, this numerical op- timization is non-convex, computationally very demanding, and can at best lead to a local minimum. Finally, we would like to conclude this chapter by mentioning that this algorithm has been applied to reconstruct flight trajectories of bat foraging events (as discussed in Chapter 5). 37 Chapter 3: Data Smoothing through Linear Quadratic Optimal Con- trol Earlier we have noticed (in Chapter 2) that lack of an integrability theory prevents us from solving the trajectory reconstruction problem (with natural Frenet frame as the underlying generative model) in an analytic way. Although we have solved it numerically over a restricted search space of piecewise constant functions, this numerical optimization problem is non-convex, computationally very demand- ing, and can at best lead to a local minimum. On the other hand, by noting that the steering controls can be expressed in terms of lateral acceleration 9x, we present an alternative linear generative model (in Section 3.1), and exploit the well-developed integrability theory of linear-quadratic optimal control to obtain an analytic solution. Our proposed generative model is fundamentally a triple integrator driven by jerk, the derivative of acceleration, as the control input, and we impose regularization by trading total fit-error against high values of the jerk path integral.1 1A preliminary version of this work can be found in a previous paper by Dey & Krishnaprasad [2012]. Also, a significant portion of this chapter has been taken verbatim from a pre-print by Dey & Krishnaprasad [2014b]. 38 3.1 Problem Formulation The primary objective of this work is to reconstruct a trajectory and extract relevant parameters of motion (namely speed, curvatures, etc.) from a given time series of observed positions (from motion capture system, GPS data) in a three dimensional space. To ensure smoothness of the reconstructed trajectory we penal- ize high values of the jerk path integral which is very significant in the context of physiological movement. As described in the literature of locomotion and manipu- lation (Flash & Hogan [1985]; Todorov & Jordan [1998]), the 2/3-power law 2 can be interpreted as a consequence of the minimization of jerk path integral. Let triuNi“0 be the set of observed positions. Then we are interested in finding a trajectory r : rt0, tN s Ñ R3 to minimize the following cost: Nÿ i“0 }rptiq ´ ri}2 ` λ tNż t0 }rp3qptq}2dt where p¨qpkq implies the k-th derivative of a function, if it exits. Similar to the nonlinear optimization problem (2.1) mentioned in Section 2.1, the regularization parameter λ forces a balance between goodness of fit and smoothness of the trajec- tory. The trajectory dynamics, or in other words the underlying generative model, 2The power law says that the speed of an endpoint is inversely proportional to the 1/3-rd power of curvature of the end effector. 39 is given by 9rptq “ vptq 9vptq “ aptq (3.1) 9aptq “ uptq where vp¨q, ap¨q and up¨q represent the velocity, acceleration and jerk respectively. Then the cost can be expressed as: Nÿ i“0 }rptiq ´ ri}2 ` λ tNż t0 }uptq}2dt. Now we define a state-vector x : rt0, tN s Ñ R9 as: x fi » ——————– r v a fi ffiffiffiffiffiffifl . (3.2) Moreover, the input and output of the underlying dynamical system is represented by u : rt0, tN s Ñ R3 and y : rt0, tN s Ñ R3, respectively. Clearly, u “ u and y “ r for the problem under consideration. Therefore the underlying generative model for a trajectory can be represented in the following compact form, 9xptq “ Axptq `Buptq yptq “ Cxptq, (3.3) 40 where A “ » ——————– 0 I3 0 0 0 I3 0 0 0 fi ffiffiffiffiffiffifl ;B “ » ——————– 0 0 I3 fi ffiffiffiffiffiffifl ;C “ „ I3 0 0  . (3.4) It is obvious that the system dynamics (3.3) is both controllable and observable. Now we can pose our trajectory reconstruction problem as a special case of the following linear-quadratic optimal control problem with intermediate state costs: Minimize xpt0q,u Jpxpt0q, uq “ Nÿ i“0 }yptiq ´ ri}2 ` λ tNż t0 uT ptquptqdt subject to System dynamics (3.3), xpt0q P R9, u P U , (3.5) where U is the space of real-valued functions defined on the interval rt0, tN s. Now we establish a relationship between the linear (3.1) and non-linear (1.1) generative models for trajectory evolution. First we show that the velocity, acceler- ation and jerk of a trajectory can be expressed in terms of the parameters of motion obtained from the nonlinear generative model (2.1), namely speed, curvatures and the frame vectors. v “ νx a “ 9νx` uν2y ` vν2z u “ p:ν ´ ν3pu2 ` v2qqx` p3uν 9ν ` 9uν2qy ` p3vν 9ν ` 9vν2qz. , /////. //////- (3.6) From (3.6) it becomes clear that the particular penalty term in (3.5) carries a similar, 41 although not the same, effect as the penalty term considered in (2.1). Alternatively, speed and curvatures can be expressed in terms of velocity, acceleration and jerk of the trajectory, and it enables us to use the results of (3.5) for curvature based analysis of strategies and steering control laws. This inverse map is given by, ν “ }v} x “ v}v} 9x “ 1ν pa´ pa ¨ xqxq κ “ } 9x}ν τ “ v¨paˆuq}vˆa}2 , , ////////////. ////////////- (3.7) where κ and τ denote the classical curvature and torsion of the trajectory, respec- tively. One can view (3.6) and (3.7) as a dictionary between two alternative view- points for trajectory generation. 3.2 A Control Theoretic Approach As λ has a positive value, the constrained optimization in (3.5) can be viewed as a relaxed version of the well-studied fixed endpoint optimal control problem. We begin by applying a standard tool from the theory of least squares, namely the path independence lemma for trajectories of linear systems [Brockett, 1970]. Now onwards, we will not show explicit time dependence for brevity of notation wherever doing so does not create any ambiguity. In this section we consider a broader class of generative models whose dynamics 42 is governed by a linear time invariant system (3.3), with A P Rnˆn, B P Rnˆm and C P Rpˆn (i.e. an m-input, p-output system with n-states). We only assume that the pair rA,Bs is controllable and the pair rA,Cs is observable. 3.2.1 Path Independence Lemma and Its Application to Data Smooth- ing Consider the quadratic form xT ptqKptqxptq, where K : rt0, tN s Ñ Rnˆn is a symmetric matrix-valued function. Then, along any trajectory of the underlying dynamical system (3.5), we have t´i`1ż t`i d ` xTKx ˘ “ t´i`1ż t`i ˆ xTK pAx`Buq ` pAx`BuqT Kx` xT 9Kx ˙ dt ñ t´i`1ż t`i » ——– x u fi ffiffifl T » ——– ATK `KA ` 9K KB BTK 0 fi ffiffifl » ——– x u fi ffiffifl dt ` xT ptiqKpt`i qxptiq ´ xT pti`1qKpt´i`1qxpti`1q “ 0. (3.8) Adding (3.8) over pt`0 , t´1 q, ¨ ¨ ¨ , pt`N´1, t´Nq we obtain tNż t0 » ——– x u fi ffiffifl T » ——– ATK `KA` 9K KB BTK 0 fi ffiffifl » ——– x u fi ffiffifl dt` x T pt0qKpt´0 qxpt0q ` Nÿ i“0 xT ptiq ` Kpt`i q ´Kpt´i q ˘ xptiq ´ xT ptNqKpt`NqxptN q “ 0. (3.9) 43 As the quantity given by (3.9) equals to zero for any u P U and any K differentiable over pt`i , t´i`1q @i P t0, 1, 2, ¨ ¨ ¨ , N ´ 1u, a multiple of it can be added to the cost Jpxpt0q, uq without incorporating further changes. Hence we have, Jpxpt0q, uq “ λxT pt0qKpt´0 qxpt0q ´ λxT ptNqKpt`N qxptNq ` Nÿ i“0 ` rTi ri ´ 2xT ptiqCT ri ˘ ` Nÿ i“0 xT ptiq “ λ ` Kpt`i q ´Kpt´i q ˘ ` CTC ‰ xptiq ` λ tNż t0 » ——– x u fi ffiffifl T » ——– ATK `KA` 9K KB BTK Im fi ffiffifl » ——– x u fi ffiffifl dt. (3.10) As (3.10) holds true for any choice of K, at this point we make the following as- sumptions on K, 9Kptq “ ´ATKptq ´KptqA `KptqBBTKptq, Kpt`N q “ 0, (3.11) Kpt`i q ´Kpt´i q “ ´ 1 λC TC. With these assumptions (3.11), the cost Jpxpt0q, uq can be represented as Jpxpt0q, uq “ λxT pt0qKpt´0 qxpt0q ` Nÿ i“0 ` rTi ri ´ 2xT ptiqCT ri ˘ ` λ tNż t0 }BTKptqxptq ` uptq}2dt. (3.12) 44 Now consider the linear functional xT ptqηptq, where η : rt0, tN s Ñ Rn is a vector valued function. Then, t´i`1ż t`i d ` xTη ˘ “ t´i`1ż t`i ` xT 9η ` pAx`BuqTη ˘ dt ñ t´i`1ż t`i » ——– x u fi ffiffifl T » ——– AT η ` 9η BT η fi ffiffifl dt` x T ptiqηpt`i q ´ xT pti`1qηpt´i`1q “ 0. (3.13) Adding (3.13) over pt`0 , t´1 q, pt`1 , t´2 q, ¨ ¨ ¨ , pt`N´1, t´N q we obtain tNż t0 » ——– x u fi ffiffifl T » ——– ATη ` 9η BTη fi ffiffifl dt` x T pt0qηpt´0 q ` Nÿ i“0 xT ptiq ` ηpt`i q ´ ηpt´i q ˘ ´ xT ptNqηpt`Nq “ 0. (3.14) As the quantity given by (3.14) equals to zero for any u P U and any η differentiable over pt`i , t´i`1q @i P t0, 1, 2, ¨ ¨ ¨ , N ´ 1u, a multiple of it can be added to the cost Jpxpt0q, uq in (3.12) without causing any change. Hence we have, Jpxpt0q, uq “ λ ` xT pt0qKpt´0 qxpt0q ` xT pt0qηpt´0 q ˘ ´ λxT ptNqηpt`Nq ` Nÿ i“0 xT ptiq “ λ ` ηpt`i q ´ ηpt´i q ˘ ´ 2CT ri ‰ ` Nÿ i“0 rTi ri ` λ tNż t0 ¨ ˚˚ ˝ » ——– x u fi ffiffifl T » ——– ATη ` 9η BTη fi ffiffifl` }B TKx` u}2 ˛ ‹‹‚dt. (3.15) 45 As (3.15) holds true for any choice of η, we make the following assumptions on η, 9ηptq “ ´ ` AT ´KptqBBT ˘ ηptq, ηpt`N q “ 0, (3.16) ηpt`i q ´ ηpt´i q “ 2 λC T ri. With these assumptions (3.16), the cost Jpxpt0q, uq can be represented as Jpxpt0q, uq “ λ “ xT pt0qKpt´0 qxpt0q ` xT pt0qηpt´0 q ‰ ´ λ4 tNż t0 }BTηptq}2dt ` Nÿ i“0 rTi ri ` λ tNż t0 }uptq `BT ˆ Kptqxptq ` 12ηptq ˙ }2dt. (3.17) From (3.17) it is clear, that by choosing uptq “ uoptptq fi ´BT ˆ Kptqxptq ` 12ηptq ˙ , (3.18) we have Jpxpt0q, uoptq “ λ ` xT pt0qKpt´0 qxpt0q ` xT pt0qηpt´0 q ˘ ` Nÿ i“0 rTi ri ´ 1 4λ tNż t0 }BTηptq}2dt. (3.19) As λ ą 0, it is apparent from (3.19), that the necessary and sufficient condition for the cost to be minimized is, u “ uopt and xT pt0qKpt´0 qxpt0q ` xT pt0qηpt´0 q be minimized over xpt0q P Rn. 46 Therefore, xoptpt0q “ arg min xpt0qPRn ` xT pt0qKpt´0 qxpt0q ` xT pt0qηpt´0 q ˘ , or in other words, the optimal initial state satisfies the following condition “ Kpt´0 q ‰ xoptpt0q ` 1 2ηpt ´ 0 q “ 0. (3.20) Hence, we have Jmin “ Nÿ i“0 rTi ri ´ λ » –xToptpt0qKpt´0 qxoptpt0q ` 1 4 tNż t0 }BTηptq}2dt fi fl . (3.21) It is clear from definition (3.5) that the cost is never negative, and hence Jmin ě 0 or in other words xToptpt0qKpt´0 qxoptpt0q ` 1 4 tNż t0 }BTηptq}2dt ď 1λ Nÿ i“0 rTi ri. Proposition 3.1 (Brockett [1970]). A Riccati equation of the form 9Kptq “ ´KptqA´ ATKptq `KptqBBTKptq (3.22) KpT q “ Q, has a symmetric, positive semi-definite solution Kptq for t ď T whenever the termi- 47 nal value Q is symmetric, positive semi-definite, and the pair rA,Bs is controllable. Moreover, the solution can be represented as Kptq “ e´AT pt´T q ˜ Q´Q „` Gpt, T q ˘´1 `Q ´1 Q ¸ e´Apt´T q (3.23) where Gpt, T q is a controllability Grammian-like quantity. Proof for Proposition.3.1. The adjoint system corresponding to the Riccati equation (3.22) is d dt » ——– η1 η2 fi ffiffifl “ » ——– A ´BBT 0 ´AT fi ffiffifl » ——– η1 η2 fi ffiffifl and the associated transition matrix can be represented as » ——– φ11 φ12 φ21 φ22 fi ffiffifl pt, T q “ φpt, T q “ » ——– eApt´T q eApt´T qGpt, T q 0 e´AT pt´T q fi ffiffifl where, Gpt, T q fi ´ tż T eApT´σqBBT eAT pT´σqdσ is positive definite for any t ă T because of controllability of the pair rA,Bs. Hence the solution for (3.22) can be represented as, Kptq “ „ φ21pt, T q ` φ22pt, T qQ „ φ11pt, T q ` φ12pt, T qQ ´1 “ e´AT pt´T qQ „ eApt´T q ` In `Gpt, T qQ ˘´1 “ e´AT pt´T qQ ˆ In `Gpt, T qQ ˙´1 e´Apt´T q. 48 Now by applying the matrix inversion lemma, ` E ´ FH´1G ˘´1 “ E´1 ` E´1F ` H ´GE´1F ˘´1GE´1, and by letting E “ In, F “ ´In, G “ Q and H “ ` Gpt, T q ˘´1 we obtain ˆ In `Gpt, T qQ ˙´1 “ In ´ ˆ` Gpt, T q ˘´1 `Q ˙´1 Q. As Gpt, T q ą 0 for any t ă T , its inverse is also positive definite for any t ă T . Then positive definiteness of “` Gpt, T q ˘´1 ` Q ‰´1 is directly implied from the fact that the terminal condition Q is positive semi-definite. By defining Mptq fi ` Gpt, T q ˘´1, we have Kptq “ e´AT pt´T qQ „ Q´Q “ Mptq `Q ‰´1Q  Qe´Apt´T q. As M ą 0 (implicit dependency on time t is not shown for the sake of clarity) and Q “ QT ě 0, there exists a non-singular matrix P such that P TQP “ Λ P TMP “ In where Λ is a diagonal matrix with non-negative entries. With the above expressions 49 from simultaneous diagonalization, we have Q ´Q “ M`Q ‰´1Q “ pP T q´1 „ Λ´ Λ ` In ` Λ ˘´1Λ  P´1. (3.24) Now, by assuming Λ “ diagpλ1, ¨ ¨ ¨ , λnq, λi ě 0, we obtain ` In ` Λ ˘´1 “ diagp 11` λ1 , ¨ ¨ ¨ , 11` λn q ñΛ ` In ` Λ ˘´1Λ “ diagp λ 2 1 1` λ1 , ¨ ¨ ¨ , λ 2 n 1` λn q ñΛ´ Λ ` In ` Λ ˘´1Λ “ diagp λ11` λ1 , ¨ ¨ ¨ , λn1` λn q. Therefore Λ´ Λ ` In ` Λ ˘´1Λ is a positive semi-definite diagonal matrix, and hence from (3.24), Q ´Q “ M`Q ‰´1Q is a symmetric positive semi-definite matrix. Hence, Kptq is symmetric, positive semi-definite for any t ă T . With assurance on the existence of solution, we make the following claim regarding the form of the Riccati equation solution. Lemma 3.2. The solution of the Riccati equation (3.11) assumes the form Kpt´i q “ 1 λ Nÿ k“i ΦΣpti, tkqCTCΦTΣpti, tkq for any i P t0, 1, ¨ ¨ ¨ , Nu where Σptq “ ´pA´ 12BBTKptqqT and ΦΣ is the transition matrix for Σ. Proof for Lemma.3.2. We will use mathematical induction to prove the above claim. From the boundary and jump conditions in (3.11) it is obvious that the claim holds 50 true for i “ N . Now we assume that it holds true for i “ m` 1, or in other words Kpt´m`1q “ 1 λ Nÿ k“m`1 ΦΣptm`1, tkqCTCΦTΣptm`1, tkq. Using uniqueness of solution, one can easily verify that Kptq “ ΦΣpt, tm`1qKpt´m`1qΦTΣpt, tm`1q satisfies the Riccati differential equation 9Kptq “ ´ATKptq ´KptqA`KptqBBTKptq for any t P ptm, tm`1q. Therefore, Kpt´mq “ Kpt`mq ` 1 λC TC “ ΦΣptm, tm`1qKpt´m`1qΦTΣptm, tm`1q ` 1 λC TC “ 1λ Nÿ k“m`1 ΦΣptm, tkqCTCΦTΣptm, tkq ` 1 λΦΣptm, tmqC TCΦTΣptm, tmq “ 1λ Nÿ k“m ΦΣptm, tkqCTCΦTΣptm, tkq. Hence the claim is proved, as it holds true for i “ m. Now we concentrate on the dynamics of η given by (3.16) and introduce a new 51 time-varying matrix Σ˜ptq “ ´pA´BBTKptqqT . Then the dynamics of η can be represented as 9ηptq “ Σ˜ptqηptq (3.25) for any t P pti, ti`1q, i P t0, 1, ¨ ¨ ¨ , N´1u. By letting ΦΣ˜ denote the transition matrix for (3.25), we can make the following claim regarding the solution for η variables. Lemma 3.3. ηpt`i q “ ´ 2 λ Nÿ k“i`1 ΦΣ˜pti, tkqCT rk ηpt´i q “ ´ 2 λ Nÿ k“i ΦΣ˜pti, tkqCT rk Proof for Lemma.3.3. We will use mathematical induction to prove the above claim. From the boundary and jump conditions in (3.16) it is obvious that the claim holds true for i “ N as, ηpt`Nq “ 0 ηpt´Nq “ ´ 2 λC T rN . 52 Now we assume that it holds true for i “ m` 1, or in other words ηpt`m`1q “ ´ 2 λ Nÿ k“m`2 ΦΣ˜ptm`1, tkqCT rk ηpt´m`1q “ ´ 2 λ Nÿ k“m`1 ΦΣ˜ptm`1, tkqCT rk. Using the dynamics of η, given by (3.25), we have the following relationship ηpt`mq “ ΦΣ˜ptm, tm`1qηpt´m`1q “ ´ 2 λΦΣ˜ptm, tm`1q Nÿ k“m`1 ΦΣ˜ptm`1, tkqCT rk “ ´2λ Nÿ k“m`1 ΦΣ˜ptm, tkqCT rk. (3.26) Using the jump condition at tm, we obtain ηpt´mq “ ηpt`mq ´ 2 λC T rm “ ´2λ Nÿ k“m`1 ΦΣ˜ptm, tkqCT rk ´ 2 λΦΣ˜ptm, tmqC Trm “ ´2λ Nÿ k“m ΦΣ˜ptm, tkqCT rk. (3.27) From (3.26) and (3.27) it is clear that the claim holds true for i “ m. Hence the claim is proved. Now we focus into the problem of our interest, i.e. the problem of trajectory reconstruction through minimization of the jerk path integral. By exploiting the particular structure of A, B and C (given by (3.4)), namely the triple-integrator property, we claim observability for the p´ΣT , Cq pair. 53 Proposition 3.4. p´ΣT , Cq forms an observable pair for the trajectory reconstruc- tion problem (3.3,3.4). Proof for Proposition.3.4. K is a symmetric matrix by definition, and hence one can assume the following block structure for K, Kptq “ » ——————– K11ptq K12ptq K13ptq KT12ptq K22ptq K23ptq KT13ptq KT23ptq K33ptq fi ffiffiffiffiffiffifl . With this particular structure for K, we have the following expression of ΣT ptq for the jerk path integral minimization problem, ΣT ptq “ » ——————– 0 ´I3 0 0 0 ´I3 1 2KT13ptq 12KT23ptq 12K33ptq fi ffiffiffiffiffiffifl . (3.28) Now, for the sake of convenience, we use Silverman-Meadows rank condition [Sil- verman & Meadows, 1967] to prove our claim. To do so, we define the matrix Qobv as Qobvptq “ “ S0ptq S1ptq ¨ ¨ ¨ Sn´1ptq ‰ where Siptq’s are computed recursively using Sk`1ptq “ ´ΣptqSkptq ` 9Skptq, S0ptq “ CT . (3.29) 54 The Siptq’s will assume the following form, S0ptq “ » ——————– I3 0 0 fi ffiffiffiffiffiffifl , S1ptq “ » ——————– 0 I3 0 fi ffiffiffiffiffiffifl , S2ptq “ » ——————– 0 0 I3 fi ffiffiffiffiffiffifl , S3ptq “ ´ 1 2 » ——————– K13ptq K23ptq K33ptq fi ffiffiffiffiffiffifl , and so on. Hence it can be immediately concluded that the pair p´ΣT , Cq is ob- servable as the rank of Qobvptq is 9 for any t P R` Y t0u. Theorem 3.5. For the trajectory reconstruction problem (3.3,3.4), the optimal ini- tial condition (given by (3.20)) is uniquely solvable for almost any time index set ttiuNi“0. Proof for Theorem.3.5. From proposition 1 we have, Kpt´0 q “ 1 λ Nÿ k“0 ΦΣpt0, tkqCTCΦTΣpt0, tkq “ 1λ Nÿ k“0 ΦT´ΣT ptk, t0qCTCΦ´ΣT ptk, t0q “ 1λ » ——————————– C CΦ´ΣT pt1, t0q ... CΦ´ΣT ptN , t0q fi ffiffiffiffiffiffiffiffiffiffifl T » ——————————– C CΦ´ΣT pt1, t0q ... CΦ´ΣT ptN , t0q fi ffiffiffiffiffiffiffiffiffiffifl “ 1λC TC. Now we investigate the rank of C because the solvability of (3.20) is equivalent to 55 the fact of C having full rank. To do so we consider the following system 9ξptq “ ´ΣT ptqξptq γptq “ Cξptq, (3.30) which is observable (proposition 3.3 ). We can easily show that the j-th derivative of its output can be represented as γpjqptq “ STj ptqΦ´ΣT pt, tiniqξptiniq where Sjptq’s are defined in (3.29). Let ξ1 ‰ ξ2 be two different choice of initial state ξpt0q for the system (3.30) and γiptq be its output corresponding to the initial condition ξpt0q “ ξi. Now we define, Yi fi » ——————————– γipt0q γipt1q ... γiptNq fi ffiffiffiffiffiffiffiffiffiffifl “ Cξi. Now we claim that the outputs of (3.30), corresponding to two different initial conditions ξ1 ‰ ξ2, do not match identically over any interval T Ă R` Y t0u, or in other words, there is no such interval T Ă R` Y t0u such that γ1ptq “ γ2ptq for any t P T. 56 We can prove our claim by contradiction. Let CΦ´ΣT pt, t0qξ1 “ CΦ´ΣT pt, t0qξ2 for all t belonging to some interval T. Then the derivatives, when they exist, should match for any t˚ in the interior of T, i.e. dj dtj ˆ CΦ´ΣT pt, t0qξ1 ˙ˇˇ ˇˇ t˚ “ d j dtj ˆ CΦ´ΣT pt, t0qξ2 ˙ˇˇ ˇˇ t˚ ñ » ——————————– ST0 ptq ST1 ptq ... STn´1ptq fi ffiffiffiffiffiffiffiffiffiffifl Φ´ΣT pt˚, t0qξ1 “ » ——————————– ST0 ptq ST1 ptq ... STn´1ptq fi ffiffiffiffiffiffiffiffiffiffifl Φ´ΣT pt˚, t0qξ2 ñQTobvptqΦ´ΣT pt˚, t0q ˆ ξ1 ´ ξ2 ˙ “ 0 ñξ1 “ ξ2. But it contradicts our initial assumption about inequality of ξ1 and ξ2, thereby proves the claim. Hence Cξ1 ‰ Cξ2 for almost any time index set ttiuNi“0. Therefore Kpt´0 q is positive definite almost surely because C has full rank almost surely. When the rank condition fails, i.e. Cξ1 “ Cξ2, we can consider an arbitrary close perturbation of the original time index. For any given ǫ ą 0 we can choose a 57 perturbed time index set tt˜iuNi“0, such that the following conditions holds true, t0 “ t˜0, Nÿ i“1 |ti ´ t˜i| ă ǫ, and, » ——————————– C CΦ´ΣT pt˜1, t˜0q ... CΦ´ΣT pt˜N , t˜0q fi ffiffiffiffiffiffiffiffiffiffifl has full rank. Therefore (3.20) can be uniquely solved, for almost any time index set ttiuNi“0. As Kpt´0 q is shown to be a symmetric, invertible and positive definite matrix, for almost any time index set ttiuNi“0, the optimal initial condition can be represented as xoptpt0q “ ´ 1 2 “ Kpt´0 q ‰´1 ηpt´0 q “ 1 λ “ Kpt´0 q ‰´1 Nÿ k“0 ΦΣ˜pt0, tkqCT rk. (3.31) Remark 3.1. The work by Magnus Egerstedt, Clyde Martin and their collabora- tors (Egerstedt & Martin [2010]; Kano et al. [2008]; Shan et al. [2000]; Zhou et al. [2005, 2006]) provides an alternative view for exploiting linear optimal control for smooth interpolation. Their work provides a framework to recover a scalar input from sampled observations of scalar output data by solving a regularized optimal con- trol problem, similar to the one given in (3.5). However, this work uses a variation approach and makes some extra assumption to ensure smoothness. This variational approach can also be viewed from a learning theoretic perspective. On the other hand, 58 our approach exploits the integrability of linear-quadratic optimal control problems, and the observations introduce jumps in the optimal control input. Moreover, our results can be used to construct control theoretic splines for multi-input multi-output systems if the optimal initial condition is uniquely solvable from (3.20). Remark 3.2. Moreover, our results can be generalized to reconstruct any trajec- tory whose evolution is governed by a linear time invariant generative model. Given the pair rA,Bs (rA,Cs) is controllable (observable) and the optimal initial condition (xopt) is uniquely solvable from 3.20, one can use our approach for data smoothing. In particular, trajectory reconstruction by penalizing high values of the snap, crackle or pop (4th, 5th or 6th derivative of position, respectively) path integrals, will not af- fect the structure for higher order integrators, and hence it can be easily shown that Prop 3.4 holds true for those cases. Therefore our approach has a natural exten- sion to tackle trajectory reconstruction through penalizing higher order derivatives of motion. 3.2.2 Linearity of Reconstruction Under the action of an optimal control input uopt the system dynamics can be represented as 9xptq “ “ A´BBTKptq ‰ xptq ´ 12BB Tηptq “ ´Σ˜T ptqxptq ´ 12BB Tηptq, (3.32) 59 or in other words it can be viewed as a time-varying linear system with η being the input, and the state xptq can be expressed as xptq “ Φ´Σ˜T pt, t0qxoptpt0q ´ 1 2 tż t0 Φ´Σ˜T pt, σqBBTηpσqdσ “ ΦTΣ˜pt0, tqxoptpt0q ´ 1 2 tż t0 ΦTΣ˜pσ, tqBB Tηpσqdσ. (3.33) Therefore the reconstructed states can be represented (at sampling time instances ttiuNi“0) as, xptkq “ ΦTΣ˜pt0, tkqxoptpt0q ´ 1 2 tkż t0 ΦTΣ˜pσ, tkqBB Tηpσqdσ “ ΦTΣ˜pt0, tkqxoptpt0q ´ 1 2 kÿ i“1 » – tiż ti´1 ΦTΣ˜pσ, tkqBB Tηpσqdσ fi fl “ ΦTΣ˜pt0, tkqxoptpt0q ´ 1 2 kÿ i“1 » – tiż ti´1 ΦTΣ˜pσ, tkqBB TΦΣ˜pσ, tiqηpt´i qdσ fi fl “ ΦTΣ˜pt0, tkqxoptpt0q ´ 1 2 kÿ i“1 » – tiż ti´1 ΦTΣ˜pσ, tkqBB TΦΣ˜pσ, tiqdσ fi fl ηpt´i q “ ΦTΣ˜pt0, tkqxoptpt0q ` 1λ kÿ i“1 « tiż ti´1 ΦTΣ˜pσ, tkqBB TΦΣ˜pσ, tiqdσ ˆ ˜ Nÿ j“i ΦΣ˜pti, tjqCT rj ¸ff “ ΦTΣ˜pt0, tkqxoptpt0q ` 1λ Nÿ i“1 «minti,kuÿ j“1 ¨ ˚˝ tjż tj´1 ΦTΣ˜pσ, tkqBB TΦΣ˜pσ, tjqdσ ˛ ‹‚ˆ ΦΣ˜ptj , tiq ff CT ri. 60 As the optimal initial condition is linear in observed data points, the smoothened position at time tk can also be expressed as a linear combination of observed posi- tions. rptkq “ 1 λ Nÿ i“0 “ CFλpk, iqCT ‰ ri (3.34) where Fλpk, iq “ ΦTΣ˜pt0, tkq “ Kpt´0 q ‰´1 ΦΣ˜pt0, tiq ` minti,kuÿ j“1 ¨ ˚˝ tjż tj´1 ΦTΣ˜pσ, tkqBB TΦΣ˜pσ, tiqdσ ˛ ‹‚ (3.35) Remark 3.3. As the coefficients Fpk, iq’s depend only on the sampling time in- stances, namely t0, ¨ ¨ ¨ , tN , and the underlying system dynamics, these coefficients can be pre-computed. Remark 3.4. This approach can be perceived as a global alternative to Savitzky- Golay smoothing filters (Savitzky & Golay [1964]; Schafer [2011]), wherein the fil- tered outputs are obtained by fitting a least square polynomial (locally) through the observed data points. In our approach the local nature is absent, instead each of the filtered outputs depends on the complete data set. But because of this global nature our approach has its own drawback. This method, in its true form, cannot be used in real-time as it requires all the observations together. Remark 3.5. The significance of the word “smoothing” is twofold in this context. Firstly this approach penalizes high values of jerk path integral and thereby yields a smoothened trajectory. Moreover, it uses data from both past and future to estimate the present position and thus justifies the usage of “smoothing” in estimation context. 61 Remark 3.6. The formulation of the problem is an example of fixed interval smooth- ing. One can use this as a building block and proceed to obtain a fixed lag smoothing algorithm. The path is quite intuitive. 3.3 An Alternative Co-state Based Approach Although we have developed an analytic method to solve data smoothing, the procedure is computationally demanding because it involves solving a differential Riccati equation. Now, to make computations more tractable, we represent the solution in terms of co-state variables, defined as, pptq fi Kptqxptq ` 12ηptq. (3.36) Then the optimal control input (3.18) and system dynamics (3.3) will have the form uoptptq “ ´BTpptq 9xptq “ Axptq ´BBTpptq, and the dynamics of the co-states is given by 9pptq “ 9Kptqxptq `Kptq 9xptq ` 12 9ηptq “ ´A Tpptq. (3.37) 62 Therefore the optimal trajectory between two observation times can be viewed as the base integral curve of the following system d dt » ——– xptq pptq fi ffiffifl “ » ——– A ´BBT 0 ´AT fi ffiffifl » ——– xptq pptq fi ffiffifl . (3.38) From (3.38) it is apparent that the dynamics of p is decoupled from that of x. Now we’ll focus on the jump conditions for the co-states ppt`i q ´ ppt´i q “ “ Kpt`i q ´Kpt´i q ‰ xptiq ` 1 2 “ ηpt`i q ´ ηpt´i q ‰ “ 1λC T pri ´ rptiqq . (3.39) We also have the following terminal condition ppt`N q “ Kpt`NqxptN q ` 1 2ηpt ` Nq “ 0 as both Kpt`N q and ηpt`Nq are equal to zero, and by letting xpt0q “ xoptpt0q, (3.20) yields, ppt´0 q “ Kpt´0 qxpt0q ` 1 2ηpt ´ 0 q “ 0. Now we introduce a new variable, namely incremental time, defined as ∆i fi 63 ti`1 ´ ti i P t0, 1, ¨ ¨ ¨ , N ´ 1u. From (3.38) we have pptq “ e´AT pt´tiqppt`i q t P pti, ti`1q (3.40) ppt`i`1q “ ppt´i`1q ` 1 λC T pri`1 ´ Cxpti`1qq “ e´AT∆ippt`i q ´ 1 λC TCxpti`1q ` 1 λC T ri`1 (3.41) for i P t0, 1, ¨ ¨ ¨ , N ´ 1u. From the dynamics of x in (3.38), we have xpti`1q “ eApti`1´tiqxptiq ´ ti`1ż ti eApti`1´σqBBTppσqdσ “ eA∆ixptiq ´ ti`1ż ti eApti`1´σqBBT e´AT pσ´tiqppt`i qdσ “ eA∆ixptiq ´ eA∆i » – ti`1ż ti eApti´σqBBT e´AT pσ´tiqdσ fi fl ppt`i q. (3.42) From (3.41) and (3.42) we obtain the following matrix representation for forward- propagation of xptiq and ppt`i q » ——– xpti`1q ppt`i`1q fi ffiffifl “ » ——– eA∆i ´eA∆iWi ´ 1λCTCeA∆i ” e´AT∆i ` 1λCTCeA∆iWi ı fi ffiffifl » ——– xptiq ppt`i q fi ffiffifl ` » ——– 0 1 λCT fi ffiffifl ri`1 (3.43) 64 where Wi is defined as Wi “ ti`1ż ti eApti´σqBBT e´AT pσ´tiqdσ “ ∆iż 0 e´AτBBT e´AT τdτ pτ “ σ ´ tiq. (3.44) From (3.44) it is apparent that the controllability Gramian Wi depends only on the inter-sample intervals, not explicitly on the sampling instances. Moreover,the Gramian is invertible as the underlying system (3.3) is controllable. By defining a discrete time state vector as zi “ “ xT ptiq pT pt`i q ‰T , (3.43) can be represented as the following discrete time system zi`1 “ Λizi ` Γri`1 (3.45) where Λi and Γ are defined as Λi “ » ——– eA∆i ´eA∆iWi ´ 1λCTCeA∆i ” e´AT∆i ` 1λCTCeA∆iWi ı fi ffiffifl Γ “ » ——– 0 1 λCT fi ffiffifl . Lemma 3.6. Λi is invertible for any i P t0, 1, ¨ ¨ ¨ , N ´ 1u. 65 Proof for Lemma.3.6. Λi “ » ——– eA∆i ´eA∆iWi ´ 1λCTCeA∆i ” e´AT∆i ` 1λCTCeA∆iWi ı fi ffiffifl “ » ——– In 0 ´ 1λCTC In fi ffiffifl » ——– eA∆i ´eA∆iWi 0 e´AT∆i fi ffiffifl “MΥi (3.46) (3.46) gives a block LU-factorization for Λi and both M and Υi are invertible for any i. Hence, Λi is invertible for any i. From (3.45) we obtain zk “ ˜ k´1ź i“0 Λi ¸ » ——– xpt0q 1 λCT pr0 ´ Cxpt0qq fi ffiffifl` kÿ i“1 ˜ k´1ź j“i Λj ¸ Γri “ ˜ k´1ź i“0 Λi ¸´ » ——– In ´ 1λCTC fi ffiffiflxpt0q ` Γr0 ¯ ` kÿ i“1 ˜ k´1ź j“i Λj ¸ Γri “ ˜ k´1ź i“0 Λi ¸ » ——– In ´ 1λCTC fi ffiffiflxpt0q ` kÿ i“0 ˜ k´1ź j“i Λj ¸ Γri (3.47) where ś represents left multiplication. As ppt`Nq “ 0, xpt0q can be obtained by 66 solving the following equation r0 Ins ˜ N´1ź i“0 Λi ¸ » ——– In ´ 1λCTC fi ffiffifl xpt0q “ ´ r0 Ins Nÿ i“0 ˜ N´1ź j“i Λj ¸ Γri. (3.48) From the way (3.48) has been obtained, it can be inferred that (3.48) is an alternative form of (3.20). Hence, it can be concluded from Theorem 3.4 that for the trajectory reconstruction problem (3.3,3.4) of our interest, (3.48) yields a unique solution for the optimal initial condition for almost any time index set ttiuNi“0. Once xpt0q is obtained by solving (3.48), the trajectory can be reconstructed using (3.38) and the jump conditions given by (3.39). Remark 3.7. The limiting case of λ “ 0 signifies the exact fitting problem, and hence can be represented as an optimal control problem with both initial and final points lying on an affine space. Although this problem can be solved by applying suitable transversality conditions, it will result in non-unique state trajectories. Remark 3.8. The proposed algorithm for data smoothing is fast, with complexity of the order of sample size (OpNq). 3.4 Ordinary Cross Validation for Optimal λ Selection As discussed earlier (in Section 2.3), ordinary cross validation (OCV) performs reconstruction by considering a subset of the whole data set, and then computes the fit-error at left-out data points. After this step has been repeated for all possible subsets, the fit errors are summed up. This sum of errors can be perceived as a 67 Algorithm 1 Algorithm for trajectory smoothing Data: Time index - ttiuNi“0; Data - triuNi“0; Smoothing Parameter - λ ą 0 Define: A, B and C for i = 0 to N ´ 1 do ∆tÐ ti`1 ´ ti Compute the Gramian W “ ∆tż 0 e´AσBBT e´ATσdσ —Due to special structures in A and B, W have a closed form solution (involving polynomial functions of ∆t). Υi Ð „ eA∆t ´eA∆tW 0 e´AT∆t  end M Ð „ I 0 ´ 1λCTC I  Γ Ð „ 0 1 λCT  Initialize: P0 Ð I Initialize: S0 Ð Γr0 for i = 1 to N do Pi ÐM ˚ Υi´1 ˚ Pi´1 Si ÐM ˚Υi´1 ˚ Si´1 ` Γri end Define: A Ð “ 0 I ‰ ˚ PN ˚Mp:, 1q Define: B Ð “ 0 ´ I ‰ ˚ SN Solve optimal initial condition: xoptpt0q “ A´1B. for i = 0 to N ´ 1 do zi Ð Pi ˚Mp:, 1q ˚ xoptpt0q ` Si xptiq Ð “ I 0 ‰ ˚ zi end Result: Compute reconstructed position - rptiq “ CXptiq, i P t0, 1, . . . , Nu. sampled variance of the estimator for that particular amount of regularization. Our objective is to pick the amount of regularization (λ-parameter) which minimizes this sample variance. In our case, we have adopted the leaving-out-one strategy for OCV, wherein all-but-one data point is used for reconstruction. Now we’ll briefly discuss the ordinary cross validation procedure for the tra- jectory smoothing problem. Let ` xkλpt0q, ukλp¨q ˘ be a minimizer of the following op- 68 timization problem: Minimize xpt0q,u ¨ ˚˝ Nÿ j“0 j‰k }yptjq ´ rj}2 ` λ tNż t0 uT pσqupσqdσ ˛ ‹‚ (3.49) subject to the constraints given by (3.3). Then the ordinary cross validation cost V0pλq is defined as V0pλq “ 1 N ` 1 Nÿ k“0 }rk ´ Cxkλptkq}2. (3.50) Finally we pick up an optimal value of the regularization parameter as λ˚ “ argmin λą0 pV0pλqq . (3.51) For the problem under consideration, the special structure of the underlying dynam- ical system yields a nice form for the ordinary cross validation cost. Now we solve the optimization problem (3.49) by following the path described in Section 3.3. By following the co-state approach we can conclude that the optimal trajectory will be a base integral curve of the associated Hamiltonian vector field, with suitable jump conditions on the co-state variables. It can be easily observed that the co-state variables are continuous at the left-out point, without any jump. Then with a little bit of algebra we can show that xkλp0q, an optimal initial condition, 69 will satisfy a modified form of (3.48), in particular r0 Ins ˜ N´1ź i“k MΥi ¸ Υk´1 ˜ k´2ź i“0 MΥi ¸ » ——– In ´ 1λCTC fi ffiffifl x k λp0q “ ´ r0 Ins k´1ÿ i“0 ˜ N´1ź j“k MΥj ¸ Υk´1 ˜ k´2ź j“i MΥj ¸ Γri ´ r0 Ins Nÿ i“k`1 ˜ N´1ź j“i MΥj ¸ Γri (3.52) where Υi’s are obtained by factorization of Λi’s, as mentioned in Lemma 4.1. There- fore the reconstruction error encountered at the k-th data point can be represented as rk ´ Cxkλptkq “ rk ´ C » ——– In 0 fi ffiffifl T Υk´1 ¨ ˚˚ ˝ k´2ź i“0 MΥi » ——– In ´ 1λCTC fi ffiffifl x k λp0q ` k´1ÿ i“0 ˜ k´2ź j“i MΥj ¸ Γri ˛ ‹‹‚ (3.53) when we start the trajectory from xkλpt0q and apply the optimal input ukλ. From (3.52) it is quite clear that λ affects xkλpt0q through M , Γ and “ In ´ 1λCTC ‰ , and hence the reconstruction error is a vector of rational functions in λ. Now we can represent the cross validation cost, V0pλq, associated with this particular problem as V0pλq “ 1 N ` 1 Nÿ k“0 ˆ rTk rk ` ` xkλptkq ˘T CTCxkλptkq ´ 2rTk Cxkλptkq ˙ . (3.54) 70 As we have the (somewhat) closed form for the OCV cost, given by (3.54), we are now ready to write down the first order necessary condition for the optimality of the regularization parameter λ. We can easily check that the optimal value, λ˚, will satisfy the following first order condition Nÿ k“0 ¨ ˚˚ ˝ ` Cxkλ˚ptkq ´ rk ˘T C » ——– In 0 fi ffiffifl T Υk´1 ˛ ‹‹‚ ˆ ˜ B Bλ « k´2ź i“0 MΥi » ——– In ´ 1λCTC fi ffiffifl x k λp0q ` k´1ÿ i“0 ˜ k´2ź j“i MΥj ¸ Γri ff λ˚ ¸ “ 0. (3.55) Remark 3.9. The optimal value of the regularization parameter (λ˚) depends on the signal-to-noise ratio (higher SNR will cause a lower value for λ˚). In many practical applications SNR might not be constant during data capture (in case of position measurement using multi-camera network this might occur because of poor calibration around the edges of the capture volume), and in that case using the same λ will result in an erroneous reconstruction. However our algorithm works fine for piecewise constant values of λ, with transitions occurring at the sampling instances ttiuNi“1 (this can be shown rigorously with a little modification in the application of path independence lemmas). In that case the optimal values for λ (for different segments of the trajectory) can be computed by minimizing the OCV cost over a grid of possible λ-values (each dimension signifying a particular segment of the flight). 71 Figure 6: This figure illustrates the reconstruction of a curve on a sphere. 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 4.75 4.8 4.85 4.9 4.95 5 5.05 5.1 5.15 5.2 5.25 Time (sec) D i s t a n c e f r o m O r i g i n Linear Model Nonlinear Model (a) This subplot shows the distance of the re- constructed curves from the center of the un- derlying sphere. Jerk path integral minimiza- tion based approach yields a curve which is closer to the sphere (in an average sense). 0 0.4 0.8 1.2 1.6 2 0 .4 .8 1.2 Time (sec) C l a s s i c a l C u r v a t u r e Linear Model Nonlinear Model (b) This subplot shows the classical curvature of the reconstructed curves. The curve, ob- tained by minimization of jerk path integral, has a curvature value greater than (almost al- ways) the theoretical limit, i.e. 0.2. Figure 7: The proposed algorithm, when applied to reconstruct a spiral on a sphere, performs better than the nonlinear optimization based algorithm. 72 3.5 Numerical Results First we test our algorithm on a synthetic data set; the sampled trajectory data is obtained by adding an i.i.d. Gaussian noise (mean = 0, and standard deviation = 0.15) to a spiral on a sphere of radius 5, and the number of samples used was N “ 201. The reconstruction (Fig 6) through nonlinear optimization yields an average fit error of 0.0599, whereas the proposed approach (3.5) yields an average fit error of 0.0684. However, we compute two other metrics for performance comparison, namely the distance of the curve from the center of the sphere (Fig 7a) and the curvature of the reconstructed trajectory (Fig 7b). By analyzing these two metrics it can be concluded that the proposed approach does a better job in trajectory reconstruction. Next, with permission from Kaushik Ghose and Cynthia Moss at the Auditory Neuroethology Laboratory (BATLAB), Department of Psychology, University of Maryland, we apply our algorithm to reconstruct a bat-insect trajectory pair. The trajectory data was collected by Kaushik Ghose, and has previously been reported in the context of prey capture flight strategies by echolocating bats [Ghose et al., 2006]. The particular event, that we consider, had a flight duration of around 1.93s, and the corresponding data capture rate was set at 240fps. In this case, the average fit error for the reconstruction of bat trajectory (Fig 8) through nonlinear optimization is 2.2401ˆ 10´4, whereas the proposed approach yields a smaller error of 7.6142 ˆ 10´5. Similarly, for the insect trajectory, our approach gives a better fit (2.3913 ˆ 10´5 compared to 1.2966 ˆ 10´4). From Fig 10a and Fig 10b we can 73 0 0.5 1 1.5 1 1.5 −0.5 0 0.5 1 1.5 2 2.5 y-D irect ion (m) x-Direction (m) z- D ir ec ti on (m ) Bat- Raw Data Bat - Linear Model Bat - Nonlinear Model Insect - Raw Data Insect - Linear Model Insect - Noninear Model Figure 8: This figure illustrates the reconstruction of a bat-insect trajectory pair. notice that the reconstructed speeds from two different regularization approaches are almost equal for both trajectories, while the same does not hold true for the evolution of curvature (Fig 9a and Fig 9b). 3.6 Conclusion Using a simple linear generative model for trajectories (a triple integrator, with jerk as the control input), we have developed a tool to obtain analytic solutions to the inverse problem of trajectory reconstruction. Our approach casts the problem in a linear framework with quadratic cost, and solve it by using techniques from linear quadratic optimal control theory. Moreover, it has been shown that the 74 0 0.5 1 1.5 20 0.5 1 1.5 2 2.5 3 3.5 Time (sec) C u r v a t u r e − κ Linear Model Nonlinear Model (a) It shows the evolution of curvature(κ) for the bat trajectory.. 0 0.5 1 1.5 20 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Time (sec) C u r v a t u r e − κ Linear Model Nonlinear Model (b) It shows the evolution of curvature(κ) for the insect trajectory. Figure 9: There is noticeable difference in the curvature profile obtained from two different ap- proaches. 0 0.5 1 1.5 21.5 2 2.5 3 3.5 4 4.5 Time (sec) S p ee d (m / s) Linear Model Nonlinear Model (a) It shows the evolution of speed(ν) for the bat trajectory. 0 0.5 1 1.5 21.8 1.9 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 Time (sec) S p ee d (m / s) Linear Model Nonlinear Model (b) It shows the evolution of speed(ν) for the insect trajectory. Figure 10: The reconstructed speeds from two different approaches are almost the same. reconstructed positions can be expressed as a linear combination of measured data. After trying the algorithm on synthetic data, we have applied it to reconstruct flight trajectories of European starling flocks (as discussed in Chapter 6). Although this approach overcomes the issues associated with the numerical optimization based 75 technique, it should be noted here that not all problem can be cast in a linear quadratic framework, and that provides motivation for the next chapter. 76 Chapter 4: Data Smoothing through Nonlinear Optimization - Max- imum Principle As discussed earlier, the problem of reconstructing an underlying smooth signal from sampled noisy observations arises in many areas of science and engineering (e.g. trajectory reconstruction [Dey & Krishnaprasad, 2012], control theoretic splines [Egerstedt & Martin, 2010] and quantum splines [Brody et al., 2012]), and in many cases the underlying generative model, along with the regularizing penalty term, do not allow us to cast the data smoothing problem in a linear quadratic framework. One such example is the nonlinear version of the trajectory reconstruction problem [(2.1), discussed in Section 2.1]. A quick reference to (3.6) reveals that this problem can never be cast in a linear quadratic framework, and one needs appropriate tools for data smoothing in nonlinear settings. However, the previous results towards this direction are restricted to problems in a Riemannian setting (Burnett et al. [2013]; Crouch & Leite [1991, 1995]; Jakubiak et al. [2006]; Machado et al. [2010]). Although these works use calculus of variation based techniques, our earlier works on data smoothing in a linear quadratic framework (in particular, Section 3.3) has provided some insight about the applicability of Pontryagin’s maximum principle [Pontryagin et al., 1962; Sussmann & Willems, 1997] in a sub-Riemannian setting. 77 This chapter1 focuses its attention on the nonlinear aspects of data smoothing, and develops a general framework to address data smoothing problems from a control theoretic perspective. Section 4.1 of this chapter presents a modified version of the maximum principle to solve data smoothing problems on Rn, and this modified maximum principle introduces jump discontinuities in the costate variables. Later, in Section 4.2 we extend our result to address data smoothing problems in finite dimensional Lie group settings. This framework, being a modified (extended) version of Pontryagin’s maximum principle, can easily be exploited to solve problems in sub- Riemannian setting as well (as demonstrated in Sections 4.4 and 4.5). 4.1 Data smoothing in a Euclidean setting In this section we propose the modified maximum principle to address data smoothing problems in a Euclidean setting. By introducing a nonlinear generative model as 9qptq “ f ` t, qptq, uptq ˘ , (4.1) 1A significant portion of this chapter has been reproduced from a paper by Dey & Krishnaprasad [2014a]. 78 the data smoothing problem can be formulated as the following optimal control problem on Rn: Minimize qpt0q,u Jpqpt0q, uq “ tNż t0 L ` t, qptq, uptq ˘ dt` Nÿ i“0 F pqptiq, qiq subject to System dynamics (4.1), xpt0q P Rn, u P U , (4.2) where U is the space of piecewise continuous functions defined on the interval rt0, tN s. Moreover, F pqptiq, qiq denotes the fit-error incurred at the i-th data point qi (at time ti), and the Lagrangian Lpt, q, uq introduces regularization into the data smoothing problem. Before going into the details of necessary conditions for a sub-Riemannian op- timal control problem, we focus on a special case, namely the Riemannian dynamics given by fpt, q, uq “ u. Clearly, for this special case, (4.2) can be perceived as a calculus of variation problem. Clearly, first variation of the cost can be expressed as δJ “ tNż t0 «ˆBL Bq ˙T δq ` ˆBL B 9q ˙T δ 9q ff dt` Nÿ i“0 ˆ BF Bqptiq ˙T δqptiq. (4.3) By summing up the identity (from exact differential) t´i`1ż t`i «ˆBL B 9q ˙T δ 9q ` ddt ˆBL B 9q ˙T δq ff dt “ „BL B 9q pt ´ i`1q T δqpti`1q ´ „BL B 9q pt ` i q T δqptiq 79 over the intervals pt`0 , t´1 q, pt`1 , t´2 q, ¨ ¨ ¨ , pt`N´1, t´Nq, we obtain tNż t0 ˆBL B 9q ˙T δ 9qdt “ „BL B 9q pt ´ Nq T δqptNq ` N´1ÿ i“1 „BL B 9q pt ´ i q ´ BL B 9q pt ` i q T δqptiq ´ „BL B 9q pt ` 0 q T δqpt0q ´ tNż t0 d dt ˆBL B 9q ˙T δqdt. (4.4) Then, by using the relationship given by (4.4), the first variation (4.3) can be ex- pressed as δJ “ tNż t0 „BL Bq ´ d dt ˆBL B 9q ˙T δqdt` „BL B 9q pt ` N q T δqptN q ` Nÿ i“0 „BL B 9q pt ´ i q ´ BL B 9q pt ` i q ` BF Bqptiq T δqptiq ´ „BL B 9q pt ´ 0 q T δqpt0q. (4.5) Therefore, first order necessary conditions (δJ “ 0) for minimality (in this special Riemannian case, fpt, q, uq “ u) can be expressed as (EL) ddt ˆBL B 9q ˙ ´ BLBq “ 0, t P pti, ti`1q, i “ 0, 1, ¨ ¨ ¨ , N ´ 1 (JC-1) BLB 9q pt ` i q ´ BL B 9q pt ´ i q “ BF Bqptiq , i “ 0, 1, ¨ ¨ ¨ , N (4.6) (BC-1) BLB 9q pt ´ 0 q “ 0, and BL B 9q pt ` Nq “ 0. Now we consider second order necessary conditions for optimality. From (4.3) 80 we can note that the second variation of the cost can be represented as δ2J “ tNż t0 „ pδqqT ˆ B2L BqBq ˙ pδqq ` 2pδqqT ˆ B2L BqB 9q ˙ pδ 9qq ` pδ 9qqT ˆ B2L B 9qB 9q ˙ pδ 9qq  dt ` Nÿ i“0 pδqptiqqT ˆ B2F BqptiqBqptiq ˙ pδqptiqq, (4.7) and by summing up the identity (from exact differential) t´i`1ż t`i „ 2pδqqT ˆ B2L BqB 9q ˙ pδ 9qq ` pδqqT ˆ d dt ¨ B2L BqB 9q ˙ pδqq  dt “ ` δqpti`1q ˘T „ B2L BqB 9q pt ´ i`1q  ` δqpti`1q ˘ ´ ` δqptiq ˘T „ B2L BqB 9q pt ` i q  ` δqptiq ˘ over the intervals pt`0 , t´1 q, pt`1 , t´2 q, ¨ ¨ ¨ , pt`N´1, t´Nq, we obtain tNż t0 2pδqqT ˆ B2L BqB 9q ˙ pδ 9qqdt “ ` δqptNq ˘T „ B2L BqB 9q pt ´ N q  ` δqptNq ˘ ´ ` δqpt0q ˘T „ B2L BqB 9q pt ` 0 q  ` δqpt0q ˘ ` N´1ÿ i“1 ` δqptiq ˘T „ B2L BqB 9q pt ´ i q ´ B2L BqB 9q pt ` i q  ` δqptiq ˘ ´ tNż t0 pδqqT ˆ d dt ¨ B2L BqB 9q ˙ pδqqdt. (4.8) 81 Hence, the second variation (4.7) can be expressed as δ2J “ tNż t0 pδqqT „ B2L BqBq ´ d dt ¨ B2L BqB 9q  pδqqdt` tNż t0 pδ 9qqT „ B2L B 9qB 9q  pδ 9qqdt ` Nÿ i“0 ` δqptiq ˘T „ B2L BqB 9q pt ´ i q ´ B2L BqB 9q pt ` i q ` B2F BqptiqBqptiq  ` δqptiq ˘ ` ` δqptNq ˘T „ B2L BqB 9q pt ` Nq  ` δqptNq ˘ ´ ` δqpt0q ˘T „ B2L BqB 9q pt ´ 0 q  ` δqpt0q ˘ . (4.9) This leads us to express second order necessary conditions (δ2J ě 0) as (LE) B 2L B 9qB 9q ě 0, t P pti, ti`1q, i “ 0, 1, ¨ ¨ ¨ , N ´ 1 (JC-2) B 2L BqB 9q pt ` i q ´ B2L BqB 9q pt ´ i q “ B2F BqptiqBqptiq , i “ 0, 1, ¨ ¨ ¨ , N (4.10) (BC-2) B 2L BqB 9q pt ´ 0 q “ 0, and B2L BqB 9q pt ` Nq “ 0. At this point we introduce the adjoint/co-state variable (p) and define the pre-Hamiltonian as Hpt, q, p, uq “ pTu´ Lpt, q, uq, (4.11) and therefore BH Bp “ u, BH Bq “ ´ BL Bq , BH Bu “ p´ BL Bu , B2H Bu2 “ ´ B2L Bu2 . It is worth mentioning here that we are focusing on regular extremals, i.e. B2LB 9qB 9q ‰ 0 along any solution of the Euler-Lagrange (EL) equation (4.6). Now we assume that 82 t ÞÑ q˚ptq is a trajectory of the system 9q “ fpt, q, uq “ u which solves the optimal control problem (4.2) with control given as u˚ptq “ 9q˚ptq, and define pptq “ BLBu pt, q ˚ptq, 9q˚ptqq. (4.12) Then by applying the Euler-Lagrange condition (EL) from (4.6) we obtain 9pptq “ BLBq pt, q ˚ptq, 9q˚ptqq “ ´BHBq pt, q ˚ptq, pptq, 9q˚ptqq, (4.13) and clearly we have 9q˚ptq “ u˚ptq “ BHBp pt, q ˚ptq, pptq, 9q˚ptqq. (4.14) Also from the definition of the adjoint variable we have BH Bu pt, q ˚ptq, pptq, 9q˚ptqq “ 0, (4.15) and the Legendre condition (LE) yields B2H Bu2 pt, q ˚ptq, pptq, 9q˚ptqq ă 0 (4.16) because of the regularity property. As, (4.15) and (4.16) maximize the pre-Hamiltonian, we have Hpt, q˚ptq, pptq, 9q˚ptqq “ Max u Hpt, q˚ptq, pptq, uq (4.17) 83 A generalization of the above results leads us to an alternative version of the Pon- tryagin’s maximum principle, which is tailored for the data smoothing problem. Theorem 4.1 (PMP for data smoothing). Consider an optimal control problem on Rn, given as Minimize qpt0q;u Jpqpt0q, uq “ tNż t0 Lpt, qptq, uptqqdt` Nÿ i“0 F ` qptiq, qi ˘ subject to: 9qptq “ fpt, qptq, uptqq, q : rt0, tN s Ñ Rn, u P U : rt0, tN s Ñ U Ă Rm, u´ piecewise continuous. (4.18) Now we assume that u˚ is an optimal control input for (4.18), and q˚ denotes the corresponding state trajectory. Then there exists a costate trajectory p : rt0, tN s Ñ Rn such that 9q˚ptq “ BHBp pt, q ˚ptq, pptq, u˚ptqq 9pptq “ ´BHBq pt, q ˚ptq, pptq, u˚ptqq (4.19) during t P pti, ti`1q, i “ 0, 1, . . . , N , and Hpt, q˚, p, u˚q “ max uPU Hpt, q˚, p, uq (4.20) for t P rt0, tN sztt0, t1, ¨ ¨ ¨ , tNu, where the pre-Hamiltonian is defined asHpt, q, p, uq “ xp, fpt, q, uqy ´ Lpt, q, uq. Moreover, the intermediate state cost terms require jump discontinuities in the costate variables, and the jump conditions and the boundary 84 values are given as ppt´0 q “ 0, ppt`i q ´ ppt´i q “ BF ` qptiq, qi ˘ Bqptiq , i “ 0, 1, . . . , N, ppt`Nq “ 0. (4.21) Remark 4.1. A quick revisit to the trajectory reconstruction problem [ (3.5), dis- cussed in Section 3.1] illustrates the control theoretic formulation (4.18) of a data smoothing problem on Rn. It is easy to verify that this trajectory reconstruction problem can be treated as a special case of (4.18) by introducing the following cor- respondences Lagrangian: L “ λuTu Generative Model: f ` t, qptq, uptq ˘ “ Aqptq `Buptq, qptq P R9, uptq P R3 Fit Error: F pqptiq, riq “ }Cqptiq ´ ri}2 “ qT ptiqCTCqptiq ´ 2xT ptiqCT ri ` rTi ri, where ri denotes the measured position at time ti and C P R3ˆ9 maps the states into the outputs. Remark 4.2. It is worth mentioning here that the fit cost enters the problem through the jump conditions in the co-state variables; while the flow of the system between two consecutive data points is dictated by the path cost (penalty term) only. 85 Now we venture into the detailed proof of Theorem 4.1, and by adopting an approach similar to the one taken in the book by Liberzon [2011], we develop the proof using needle (strong) variation. Proof. At the outset we introduce a new state variable q˜ : rt0, tN s Ñ R with its dynamics governed by 9˜qptq “ Lpt, qptq, uptqq, t P pti, ti`1q, q˜pt`i q ´ q˜pt´i q “ F ` qptiq, qi ˘ , i “ 0, 1, . . . , N, q˜pt´0 q “ 0, (4.22) and this leads us to an augmented system. By introducing yptq fi ¨ ˚˚ ˝ q˜ptq qptq ˛ ‹‹‚P R n`1, (4.23) the dynamics of this augmented system (4.23) can be represented as 9yptq “ ¨ ˚˚ ˝ Lpt, qptq, uptqq fpt, qptq, uptqq ˛ ‹‹‚fi gpt, yptq, uptqq, (4.24) with the initial condition ypt´0 q “ ¨ ˚˚ ˝ 0 qpt0q ˛ ‹‹‚. The corresponding jump conditions 86 in y can be expressed as ypt`i q ´ ypt´i q “ ¨ ˚˚ ˝ F pqptiq, qiq 0 ˛ ‹‹‚. As a consequence, the cost functional (in 4.18) can be expressed as Jpqpt0q, uq “ q˜pt`Nq “ Jpypt0q, uq. (4.25) Clearly, an optimal trajectory q˚ (generated by u˚) of the original system (4.18) can be retrieved from an optimal trajectory y˚ of the augmented system (4.23) through a projection onto Rn along the q˜-axis. Now, let a ą 0, b P R be such that Iǫ “ pb´ ǫa, bs Ă pt0, tNq, ti R pb´ a, bs @i, and u˚ is continuous on Iǫ, @ǫ P p0, 1s and at b. Next we introduce a needle variation (a perturbation pulse of short duration) by defining the perturbed control as uw,Iǫptq fi $ ’’& ’’% u˚ptq if t R Iǫ w if t P Iǫ , (4.26) where w P U . Then, by letting k denote the index such that Iǫ Ă ptk´1, tkq, we have yptq “ y˚ptq ` ǫΦ˚pt, bqδpw, a, bq `Opǫ2q (4.27) for b ď t ď t´k [Liberzon, 2011, Section 4.2.4]. Here, the perturbation term δpw, a, bq 87 is defined as δpw, a, bq “ a ´ g ` b, y˚pbq, w ˘ ´ g ` b, y˚pbq, u˚pbq ˘¯ , (4.28) and Φ˚ denotes the state transition matrix for the linearized dynamics governed by 9ψptq “ » ——– 0 ` Lqpt, q˚ptq, u˚ptqq ˘T 0nˆ1 fqpt, q˚ptq, u˚ptqq fi ffiffiflψptq. Now we introduce a matrix Γk, defined as Γk “ » ——– 1 ˆBF Bq ` q˚ptkq, qk ˘˙T 0nˆ1 Inˆn fi ffiffifl , to capture the effect of jump discontinuities on the perturbed trajectory y, where BF Bq denotes the partial derivative of F with respect to its first argument. This enables us to express ypt`k q as ypt`k q “ y˚pt`k q ` ǫΓkΦ˚ptk, bqδpw, a, bq `Opǫ2q. (4.29) Proceeding this way the terminal point of the perturbed trajectory can be expressed as ypt`Nq “ y˚pt`Nq ` ǫΓNΦ˚ptN , tN´1q ¨ ¨ ¨ΓkΦ˚ptk, bqδpw, a, bq `Opǫ2q. (4.30) Now, ǫΓNΦ˚ptN , tN´1q ¨ ¨ ¨ΓkΦ˚ptk, bqδpw, a, bq can be interpreted as an infinites- 88 imal perturbation of the terminal state caused by the needle variation in the control input (uw,Iǫ), and its direction depends only on b and w (4.28,4.30). By letting ρpw, bq denote the ray in this direction originating at y˚pt`N q, we define ~P as the union of the rays ρpw, bq for all possible values of w and b. It can be noticed that the cone ~P is not convex in general, and hence we concatenate different needle vari- ations to generate a larger cone with the same vertex. These concatenations yield a larger cone which contains the convex combinations of the points in ~P [Liberzon, 2011, Section 4.2.5], and we call it the terminal cone (TC ` y˚pt`N q ˘ ). Therefore, there exists a nonzero vector µ P Rn`1 such that µT ` ypt`Nq ´ y˚pt`N q ˘ ě 0 (4.31) for any perturbed trajectory y such that ypt`Nq ´ y˚pt`Nq P TC ` y˚pt`N q ˘ [Tits, 2013, Theorem B.3]. Then, by following the arguments given in [Liberzon, 2011, Sec- tion 4.2.6], we can claim that (4.31) must be satisfied for the choice of µ˚ “ » ——– 1 0nˆ1 fi ffiffifl , (4.32) because otherwise there exists a ypt`Nq which would violate the optimality of y˚. By using this choice of µ “ µ˚ for the perturbed trajectories of the form (4.30), (4.31) can be represented as “ ΦT˚ ptk, bqΓTk ¨ ¨ ¨ΦT˚ ptN , tN´1qΓTNµ˚ ‰T δpw, a, bq ě 0. (4.33) 89 Now we introduce ξ : rt0, tN s ÞÑ Rn`1, and by letting the dynamics of ξ be governed by 9ξptq “ » ——– 0 0nˆ1 ´Lqpt, q˚ptq, u˚ptqq ´ ` fqpt, q˚ptq, u˚ptqq ˘T fi ffiffifl ξptq, (4.34) we define an adjoint system on Rn`1. Moreover, we define ξpt`Nq “ µ˚, and introduce the interface conditions given by ξpt´i q “ » ——– 1 01ˆn BF Bq ` q˚ptkq, qk ˘ Inˆn fi ffiffifl ξpt ` i q (4.35) at tN , tN´1,¨ ¨ ¨ ,t0. This adjoint system allows us to represent (4.33) as ξT pbq ´ g ` b, y˚pbq, w ˘ ´ g ` b, y˚pbq, u˚pbq ˘¯ ě 0 (4.36) for all w P U and b P rt0, tN sztt0, ¨ ¨ ¨ , tNu. It can be easily verified that the first component of 9ξ is identically zero (4.34), and the jump discontinuity doesn’t exist for the first component of ξ (4.35). Then it directly follows from (4.32) that the first component of ξ is set constant at 1. This enables us to decompose ξptq into ξptq “ » ——– 1 ´pptq fi ffiffifl . (4.37) 90 This decomposition of ξ yields the dynamics, boundary values and jump conditions for p : rt0, tN s ÞÑ Rn as: 9pptq “ ´Lqpt, q˚ptq, u˚ptqq ` ` fqpt, q˚ptq, u˚ptqq ˘Tpptq (4.38) and ppt`N q “ 0 ppt`i q ´ ppt´i q “ BF Bq ` q˚ptkq, qk ˘ . (4.39) Using the fact that the pre-Hamiltonian is defined as Hpt, q, p, uq “ xp, fpt, q, uqy ´ Lpt, q, uq, (4.40) the dynamics of p (4.38) can be expressed as 9pptq “ ´BHBq pt, q ˚, p, u˚q. (4.41) Moreover, by using the fact that qpt0q is free and minimizes the cost, it can be concluded that ppt´0 q “ 0 [Liberzon, 2011, Section 4.3.1]. Also, the dynamics of the optimal state trajectory q˚ can be derived straightforward from (4.40). Now we focus to (4.36) to show maximality of the Hamiltonian. By using the decomposition of ξ, (4.36) can be represented as » ——– 1 ´pptq fi ffiffifl T » ——– L ` t, q˚ptq, w ˘ ´ L ` t, q˚ptq, u˚ptq ˘ f ` t, q˚ptq, w ˘ ´ f ` t, q˚ptq, u˚ptq ˘ fi ffiffifl ě 0, 91 or equivalently H ` t, q˚ptq, pptq, u˚ptq ˘ ě H ` t, q˚ptq, pptq, w ˘ (4.42) for t P rt0, tN sztt0, ¨ ¨ ¨ , tNu. This concludes our proof for Theorem 4.1. Remark 4.3. The maximum principle, when applied to the trajectory reconstruction problem (referred in Remark 4.1), gives rise to the Hamiltonian dynamics given by d dt » ——– q˚ptq pptq fi ffiffifl “ » ——– A 12λBBT 0 ´AT fi ffiffifl » ——– q˚ptq pptq fi ffiffifl , and the corresponding optimal control can be expressed as u˚ptq “ 12λB Tpptq. Moreover, the boundary values and jump conditions for the costate p are computed as ppt´0 q “ ppt`Nq “ 0 ppt`i q ´ ppt´i q “ 2CT “ Cqptiq ´ ri ‰ . Although it appears slightly different from the solutions obtained in (3.38,3.39), this discrepancy can be avoided by introducing the following change of variable p˜ “ ´ 12λp. 92 Remark 4.4. It is worth mentioning here that jump discontinuities in optimal con- trol problems are not new. In the context of calculus of variation, they can be traced back to the time of Weierstrass (Weierstrass-Erdmann corner condition [Liberzon, 2011]). More recently, they arise in hybrid optimal control when the associated dy- namics undergo switching (Shaikh & Caines [2007]; Taringoo & Caines [2013]). 4.2 Data smoothing problems in a Finite Dimensional Matrix Lie group setting In this section we extend our result to tackle data smoothing problems in finite dimensional matrix Lie group settings. For example, by using natural-Frenet frame equations [Bishop, 1975] as the underlying generative model and penalizing high rates of change in speed and curvatures, trajectory reconstruction can be formu- lated as a data smoothing problem on SEp3q ˆ R3 [Reddy, 2007]. Also, trajectory smoothing on a sphere can be posed as a data smoothing problem on SOp3q (similar to the problem discussed by Brody et al. [2012]). We begin by considering a finite dimensional matrix Lie group G and a left invariant vector field defined on G. Before defining left invariance we introduce left action by letting Lg : G Ñ G, h ÞÑ gh denote the left translation by g P G and ThLg : ThGÑ TghG denote its tangent map (linearization). Definition 4.1 (Left invariant vector field). Given the left action Lg defined on a 93 Lie group G, a vector field X : GÑ TG, h ÞÑ ph, vhq will be called left invariant if ThLgpvhq “ vgh @h P G. This allows us to define a left invariant control system by letting ve (referred as ξ henceforth) be a control curve in the Lie algebra gp“ TeG, tangent space to the Lie group G at the group identity element e). Then the dynamics takes the form 9gptq “ TeLgptq ¨ ξuptq (4.43) where each control input w defines an element ξw of g. Now we consider the following optimal control problem on G: Minimize gpt0q;u Jpgpt0q, uq “ tNż t0 L ` uptq ˘ dt` Nÿ i“0 F pgptiq, giq subject to: 9g “ TeLg ¨ ξu “ gξu, (4.44) g : rt0, tN s Ñ G, u P U , where F pgptiq, giq denotes the fit error at sampling instant ti and U is the space of piecewise continuous functions over rt0, tN s. The control curve is defined as ξu “ X0 ` řk i“1 uiXk where tXiuni“1 is a basis of the Lie algebra g, k ă n and X0 P spantXk`1, Xk`2, ¨ ¨ ¨ , Xnu. Clearly, the Lagrangian is assumed to be left invariant. 94 We also assume that the fit cost F pgptiq, giq is invariant under the left action, i.e. F pgptiq, giq “ F pLg ¨ gptiq, Lg ¨ giq for any g P G, and uptq, t P rt0, tN s takes value in U Ă Rk. Theorem 4.2 (PMP for data smoothing on a finite dimensional matrix Lie Group). Consider an optimal control problem on a finite dimensional matrix Lie group G, given as Minimize gpt0q;u Jpgpt0q, uq “ tNż t0 L ` uptq ˘ dt` Nÿ i“0 F pgptiq, giq subject to: 9gptq “ TeLgptq ¨ ξuptq “ gptq ` X0 ` kÿ i“1 uiptqXk ˘ , g : rt0, tN s Ñ G, u P U : rt0, tN s Ñ U Ă Rk, u´ piecewise continuous. (4.45) Now we assume that u˚ is an optimal control input for (4.45). Then, corresponding state trajectory g˚ is the base integral curve pg˚, pq of a Hamiltonian vector field XHpg˚,p,u˚q on T ˚G, where the pre-Hamiltonian is defined as Hpg, p, uq “ xp, TeLg ¨ ξuy ´ Lpuq “ xp, 9gy ´ Lpuq, and an optimal control input maximizes H (which clearly is G invariant), i.e. Hpg˚, p, u˚q “ Max u Hpg˚, p, uq. 95 Moreover, intermediate state penalties require jump discontinuities in p and the corresponding boundary values and jump conditions are given as ppt´0 q “ ppt`N q “ 0 and, ppt`i q ´ ppt´i q “ Dg˚ptiqF, i “ 0, 1, ¨ ¨ ¨ , N where Dg˚ptiqF represents the Frechet derivative of the fit-error at g˚ptiq P G. Proof. Here we adopt a variational approach to derive necessary conditions for opti- mality, and as a first step express the cost functional in terms of the pre-Hamiltonian. Clearly, the cost can be represented as Jpgpt0q, uq “ tNż t0 ` xp, 9gy ´Hpg, p, uq ˘ dt` Nÿ i“0 F pgptiq, giq. (4.46) As our focus is restricted to matrix Lie groups, the pairing x¨, ¨y should be interpreted as a trace inner-product in an appropriate matrix space. Let u˚ be an optimal control (piecewise continuous) and g˚ be the correspond- ing optimal trajectory of the system. First we consider perturbed controls of the form uǫ “ u˚ ` ǫδu (4.47) where δu is continuous in the intervals pti, ti`1q, and let ξǫ “ ξu˚ ` ǫδξu denote the associated perturbed control curves on g. Then, the corresponding perturbed 96 trajectory can be represented as gǫ “ g˚ ` ǫδg `Opǫ2q (4.48) where δg “ g˚δξu. We begin by considering the first variation of the cost functional J , and show that the first variation δJ can be expressed as δJ “ tNż t0 ´ xp, δ 9gy ´ x∇gH ` g˚, p, u˚ ˘ , δgy ´ x∇uH ` g˚, p, u˚ ˘ , δuy ¯ dt ` Nÿ i“0 xDg˚ptiqF, δgptiqy, (4.49) where Dg˚ptiqF represents the Frechet derivative at g˚ptiq P G. Next we show that the first integrand in the first variation (4.49) can be expressed as tNż t0 xp, δ 9gydt “ N´1ÿ i“0 t´i`1ż t`i xp, δ 9gydt “ N´1ÿ i“0 ´ xppt´i`1q, δgpt´i`1qy ´ xppt`i q, δgpt`i qy ´ t´i`1ż t`i x 9p, δgydt ¯ “ N´1ÿ i“0 ´ xppt´i`1q, δgpti`1qy ´ xppt`i q, δgptiqy ¯ ´ tNż t0 x 9p, δgydt “ xppt`Nq, δgptNqy ` Nÿ i“0 xppt´i q ´ ppt`i q, δgptiqy ´ xppt´0 q, δgpt0qy ´ tNż t0 x 9p, δgydt. (4.50) 97 Then by replacing (4.50) into (4.49), the first variation can be represented as δJ “ xppt`Nq, δgptNqy ` Nÿ i“0 xppt´i q ´ ppt`i q `Dg˚ptiqF, δgptiqy ´ xppt´0 q, δgpt0qy ´ tNż t0 x 9p`∇gH ` g˚, p, u˚ ˘ , δgydt´ tNż t0 x∇uH ` g˚, p, u˚ ˘ , δuydt. (4.51) Now, first-order necessary condition for optimality dictates that δJ (4.51) must be zero for any perturbation in control (δu) or initial condition (δgpt0q), and this condition holds true for every p. Now, we make a special choice and assume the following structure on p: ‚ 9p “ ´∇gH ` g˚, p, u˚ ˘ ‚ ppt`N q “ 0 ‚ ppt`i q ´ ppt´i q “ Dg˚ptiqF, @i P t1, 2, ¨ ¨ ¨ , Nu. (4.52) These assumptions allow us to represent the first variation around an optimal tra- jectory as δJ “ ´xppt´0 q, δgpt0qy ´ tNż t0 x∇uH ` g˚, p, u˚ ˘ , δuydt, (4.53) and first-order necessary condition for optimality requires δJ “ 0 (4.53) for any perturbation δu or δgpt0q. Thus, first-order necessary condition implies ‚ ∇uH ` g˚, p, u˚ ˘ “ 0 ‚ ppt´0 q “ 0. (4.54) 98 Moreover, the definition of the pre-Hamiltonian let us represent the dynamics of g˚ as 9g˚ “ ∇pH ` g˚, p, u˚ ˘ (4.55) Next we focus on the second variation of J , show that a second order necessary condition can be expressed as ∇uuH ` g˚, p, u˚ ˘ ď 0. (4.56) Now, by narrowing our focus to regular extremals, i.e. ∇ 9g 9gL ‰ 0 along any solution of the pg˚, pq-dynamics, (4.54) and (4.56) yield the following maximality condition H ` g˚, p, u˚ ˘ “ Max u H ` g˚, p, u ˘ (4.57) This concludes our proof for Theorem 4.2. 4.3 A Quick Revisit to Lie-Poisson Reduction This section provides a brief introduction to Lie-Poisson reduction. Interested readers may refer the works of Krishnaprasad [1985, 1993] and Marsden & Ratiu [2003] for further details. As there exists a bundle isomorphism between the cotangent bundle (T ˚G) of a Lie group G and the product Gˆg˚, we can easily introduce two bundle projections, 99 defined as π : T ˚GÑ g˚ π˜ : T ˚GÑ G. (4.58) Moreover, any vector from a tangent space of the cotangent bundle T ˚G can be translated to a vector in the Lie algebra (via consecutive action of appropriate tangent lifts, as shown in Fig 11). These two facts provide a natural choice for a one-form on T ˚G, namely the Poincare´ one-form (T ˚G Q a ÞÑ Θa P T ˚a pT ˚Gq), defined as Θa ´ v ¯ “ A π ` a ˘ , Tπ˜paqLπ˜paq´1 ¨ ` Taπ˜ ¨ v ˘E , (4.59) for any v P TapT ˚Gq, a P T ˚G. Then, by using exterior derivative of this one-form, we can define a symplectic form on T ˚G (ω “ ´dΘ) [Marsden & Ratiu, 2003]. Clearly, this symplectic form associates a Hamiltonian vector field to each smooth real-valued function (Hamiltonian) on T ˚G. Now, by letting C8pT ˚Gq denote the space of smooth real-valued functions on T ˚G, we can introduce a Poisson bracket t¨, ¨u : C8pT ˚Gq ˆ C8pT ˚Gq Ñ C8pT ˚Gq, φ, ψ ÞÑ tφ, ψu “ ωpHφ,Hψq, where Hφ is the Hamiltonian vector field associated with the smooth function φ. It can be easily verified that if φ,ψ P C8pT ˚Gq are invariant under left translation, then tφ, ψu is also G-invariant. As the pullback of any function on g˚ by π will define a G-invariant function on T ˚G, this enables us to define the Lie-Poisson bracket t¨, ¨ug˚ : C8pg˚q ˆ C8pg˚q Ñ C8pg˚q as π˚th1, h2ug˚ “ th1, h2ug˚ ˝ π “ tπ˚h1, π˚h2u (4.60) 100 D ua l Figure 11: This figure illustrates Lie-Poisson Reduction. where π˚ denotes the pullback by π and h1, h2 P C8pg˚q. Next, we introduce µ “ TeL˚g˚ ¨p to represent the dual control curve on g˚ and formalize the mapping of the integral curve pg˚, pq of a left invariant Hamiltonian vector field onto the dual of the Lie algebra. By letting tX5i uni“1 denote the dual basis for g˚, µ can be represented as µ “ řni“1 µiX5i . On the other hand, a left-invariant Hamiltonian H ` g˚, p, u˚ ˘ projects to a reduced Hamiltonian (h) on g˚. Now, h defines a Hamiltonian vector field through the Lie-Poisson bracket, thus defining the dynamics for µ. Finally, through an explicit computation of the Lie-Poisson 101 bracket, we can derive the reduced dynamics as 9µi “ ´ nÿ j“1 nÿ k“1 µkΓkij Bh Bµj , (4.61) where Γkij denote the structure constants associated with the Lie algebra g. 4.4 Example I: Data Smoothing on SOp3q First we consider a left-invariant dynamics on SOp3q governed by 9g “ g ` u1X1 ´ u2X2 ˘ “ gξu, g P SOp3q, ξu P sop3q, (4.62) where u1, u2 denote curvature control inputs (for curvature), and X1 “ » ——————– 0 ´1 0 1 0 0 0 0 0 fi ffiffiffiffiffiffifl , X2 “ » ——————– 0 0 1 0 0 0 ´1 0 0 fi ffiffiffiffiffiffifl , X3 “ » ——————– 0 0 0 0 0 ´1 0 1 0 fi ffiffiffiffiffiffifl , define a basis for the associated Lie algebra sop3q. Clearly, by assuming only two controls for a system evolving on a three dimensional manifold, we have cast the problem in a sub-Riemannian setting. Now we consider a data smoothing problem on SOp3q which attempts to find a curve g : rt0, tN s Ñ SOp3q to traverse (approximately) through the sequence of targeted orientations g0 Ñ g1 Ñ ¨ ¨ ¨ Ñ gN at time t0, t1, t2, and so on, respectively. 102 Our approach imposes regularization to this inverse problem by trading total fit- error against high values of the curvature path integral, and therefore the smoothing problem can be expressed as the following optimal control problem: Minimize gpt0q,u1,u2 Nÿ i“0 }I3 ´ gptiqgTi }2F ` λ tNż t0 ` u21 ` u22 ˘ dt subject to 9g “ g ` u1X1 ´ u2X2 ˘ , g : rt0, tN s Ñ SOp3q, u1, u2 P U , (4.63) where U is the space of real valued functions on rt0, tN s and I3 denotes a 3 ˆ 3 identity matrix. λ (ą 0) is the regularization parameter which maintains a balance between goodness of fit and smoothness of the reconstructed trajectory on SOp3q. By comparing this optimal control problem (4.63) with the one mentioned in the statement of maximum principle (4.45) we have Lpuq “ λpu21 ` u22q “ λxξu, ξuysop3q F pgptiq, giq “ }I3 ´ gptiqgTi }2F where the inner-product on sop3q is defined as xv1, v2ysop3q “ 12 TrpvT1 v2q “ 12 Trpv1vT2 q for v1, v2 P sop3q. 103 4.4.1 Maximum Principle Restricting our attention to normal extremals, we define the pre-Hamiltonian as Hpg, p, uq “ xp, TeLg ¨ ξuy ´ Lpuq (4.64) where p P T ˚g SOp3q, and TeLg represents the tangent lift of the left translation by a group element g on SOp3q. Now we introduce µ at the dual of the Lie algebra (so˚p3q), defined as µ “ TeL˚g ¨ p. By letting X5i , i “ 1, 2, 3 denote a dual basis for so˚p3q (corresponding to the primal basis tXiu3i“1), µ can be represented as µ “ 3ÿ i“1 µiX5i . Therefore, by exploiting left-invariance of the generative model (4.62), the pre- Hamiltonian can be expressed as Hpg, p, uq “ xTeL˚g ¨ p, ξuy ´ Lpuq “ x 3ÿ i“1 µiX5i , pu1X1 ´ u2X2 ˘ y ´ Lpuq “ u1µ1 ´ u2µ2 ´ λpu21 ` u22q. (4.65) As both ξu and Lpuq are differentiable with respect to u, an optimal control input (u˚) can be obtained by solving BH Bui ˇˇ ˇˇ ui“u˚i “ 0, i “ 1, 2. (4.66) 104 Then (4.65) and (4.66) yield the optimal control inputs as ¨ ˚˚ ˝ u˚1 u˚2 ˛ ‹‹‚“ 1 2λ ¨ ˚˚ ˝ µ1 ´µ2 ˛ ‹‹‚, (4.67) and by substituting the optimal controls into the pre-hamiltonian, (4.65) yields an SOp3q-invariant hamiltonian. Hence we have the reduced hamiltonian on so˚p3q, given by h “ 14λpµ 2 1 ` µ22q. (4.68) 4.4.2 Frechet Derivative of the Fit Error On the other hand, we need to evaluate the Frechet derivative of the fit-error in order to compute the jump conditions for µ. By using the definition of Frobenius norm, the fit error (4.63) can be expressed as F pgptiq, giq “ }I3 ´ gptiqgTi }2F gptiq, gi P SOp3q “ Tr ”` I3 ´ gptiqgTi ˘T `I3 ´ gptiqgTi ˘ı “ 2Tr “ I3 ´ gigT ptiq ‰ . (4.69) 105 Now we assume h to be a tangent vector at gptiq P SOp3q, and hence h can be parametrized as h “ gptiqφ where φT “ ´φ P sop3q. Therefore we have F ` gptiqeǫφ, gi ˘ “ 2Tr “ I3 ´ gi ` eǫφ ˘TgT ptiq ‰ “ 2Tr “ I3 ´ gi ` I3 ` ǫφT `Opǫ2q ˘ gT ptiq ‰ . (4.70) From (4.69) and (4.70) we can compute the Frechet differential of F along h in the following way DgptiqF ` h ˘ “ lim ǫÑ0 1 ǫ ´ F ` gptiqeǫφ, gi ˘ ´ F ` gptiq, gi ˘¯ “ lim ǫÑ0 2 ǫ Tr ´ ´ ǫgiφTgT ptiq `Opǫ2q ¯ “ ´2Tr ´ giφTgT ptiq ¯ “ 2Tr ´ gT ptiqgiφ ¯ . (4.71) Now we recall the fact that for a skew-symmetric matrix B “ ´BT P Rnˆn we have Tr ` AB ˘ “ 12 Tr ` pA´ AT qB ˘ for any A P Rnˆn, and by using this fact the differential of F : SOp3q Ñ R (4.71) 106 can be represented as DgptiqF ` h ˘ “ Tr ´“ gT ptiqgi ´ gTi gptiq ‰ φ ¯ “ Tr ´“ gT ptiqgigT ptiq ´ gTi ‰ h ¯ “ @ 2 ` gptiqgTi gptiq ´ gi ˘ , h D gptiq , (4.72) and hence we have DgptiqF “ 2 ` gptiqgTi gptiq ´ gi ˘ . By noting that h P TgptiqSOp3q can be expressed as TeLgptiq ¨ φ, we get TeL˚gptiq ¨DgptiqF “ 2 ` gTi gptiq ´ gT ptiqgi ˘ . (4.73) 4.4.3 Reduced Dynamics and Jump Discontinuities on so˚p3q Next we focus on the derivation of reduced dynamics and associated jump conditions. By following the path laid out by Krishnaprasad [1993], the reduced dynamics on so˚p3q can be computed as 9µiptq “ ´ 3ÿ j“1 3ÿ k“1 µkptqΓkij Bh Bµj ptq, i “ 1, 2, 3, (4.74) where the temporal variable t lies in the open intervals ptl, tl`1q, l “ 0, ¨ ¨ ¨ , N´1, and Γkij denote the structure constants associated with the Lie algebra sop3q. Moreover, the corresponding jump conditions for µ can be obtained via Frechet derivative of the fit-error. 107 By computing the corresponding Lie brackets on sop3q as rX1, X2s “ ´X3, rX2, X3s “ ´X1, rX3, X1s “ ´X2, (4.75) the associated structure constants (the nonzero ones) can be expressed in the fol- lowing way Γ312 “ ´1, Γ123 “ ´1, Γ231 “ ´1, (4.76) and Γkij “ ´Γkji, 1 ď i, j, k ď 3. Then, by exploiting (4.96), the reduced dynamics on the dual of Lie algebra can be expressed as ¨ ˚˚ ˚˚ ˚˚ ˝ 9µ1 9µ2 9µ3 ˛ ‹‹‹‹‹‹‚ “ 12λ ¨ ˚˚ ˚˚ ˚˚ ˝ µ2µ3 ´µ3µ1 0 ˛ ‹‹‹‹‹‹‚ , t P ptk, tk`1q, (4.77) along with the jump conditions µipt`k q ´ µipt´k q “ @ TeL˚gptkq ¨DgptkqF,Xi D I3PSOp3q i “ 1, 2, 3 “ @ 2 ` gTk gptkq ´ gT ptkqgk ˘ , Xi D I3PSOp3q “ Tr ` gT ptkqgkXi ´ gTk gptkqXi ˘ , (4.78) where k “ 0, 1, ¨ ¨ ¨ , N ´ 1. 108 4.4.4 Explicit Solution of the Reduced Dynamics In what follows, we develop a closed form solution (involving trigonometric functions) for the reduced dynamics. Clearly, (4.77) yields an explicit solution of the form µ1ptq “ Ak sinpCkt` φkq µ2ptq “ Ak cospCkt ` φkq µ3ptq “ 2λCk t P ptk, tk`1q, (4.79) where the piecewise constant parameters Ak, Ck and φk can be computed using the boundary values and jump conditions of µ. As optimality (ppt´0 q “ 0) causes µpt´0 q to be equal to 0, we can compute the initial values of the solution parameters (Ck, Ak, φk) as C0 “ 1 2λ Tr ´` gT pt0qg0 ´ gT0 gpt0q ˘ X3 ¯ A0 “ 2 c´ Tr ` I3 ´ pgT pt0qg0q2 ˘¯2 ´ λ2C20 (4.80) φ0 “ atan2 ´ Tr `` gT pt0qg0 ´ gT0 gpt0q ˘ X2 ˘ ,Tr `` gT pt0qg0 ´ gT0 gpt0q ˘ X1 ˘¯ ´ C0t0. Now we focus on the jump conditions for the solution parameters. Clearly, the jumps in µ3 can be translated to an equivalent condition for Ck, given by Ck ´ Ck´1 “ 1 2λ Tr ´` gT ptkqgk ´ gTk gptkq ˘ X3 ¯ , (4.81) 109 where k P t1, 2, ¨ ¨ ¨ , N ´ 1u. However, there is no straightforward way to represent the jump discontinuities in Ak and φk. Instead, the following equations should be used to update these parameters Ak sinpCktk ` φkq “ Tr ´` gT ptkqgk ´ gTk gptkq ˘ X1 ¯ ` Ak´1 sinpCk´1tk ` φk´1q Ak cospCktk ` φkq “ Tr ´` gT ptkqgk ´ gTk gptkq ˘ X2 ¯ ` Ak´1 cospCk´1tk ` φk´1q. Finally, the terminal value of the costate variable yields the following terminal con- dition for the solution parameters: CN´1 “ ´ 1 2λ Tr ´` gT ptN qgN ´ gTNgptNq ˘ X3 ¯ AN´1 “ 2 c´ Tr ` I3 ´ pgT ptNqgNq2 ˘¯2 ´ λ2C2N´1 (4.82) φN´1 “ atan2 ´ Tr `` gT ptNqgN ´ gTNgptNq ˘ X2 ˘ ,Tr `` gT ptNqgN ´ gTNgptNq ˘ X1 ˘¯ ´ CN´1tN . It is clear at this point that the optimal control inputs (4.67), along with their boundary values and intermediate jump conditions, can be evaluated using (4.79)- (4.82). As the sinusoidal optimal control inputs are in phase quadrature, they can be interpreted as the natural curvatures for a circular helix, and hence it is pos- sible to write down explicit solutions for the group dynamics on SOp3q [Justh & Krishnaprasad, 2011]. Finally, an optimal initial condition is selected in such way that the terminal values of the solution parameters (4.82) are consistent with their 110 initial values (4.80) and intermediate update rules (4.82). Thus, we have turned an optimal control problem over an infinite dimensional space (SOp3q ˆ U ˆ U) into a two-point boundary value problem, which can be tackled by adopting an appropriate multiple-shooting method [Morrison et al., 1962]. 4.5 Example II: Data Smoothing on SEp2q We begin our discussion about data smoothing on SEp2q by considering the dynamics of a unicycle moving on a plane. By letting px, yq P R2 and θ P S1 denote position and heading angle of the unicycle, the underlying dynamics can be expressed as 9xptq “ u1ptq cos θptq 9yptq “ u1ptq sin θptq (4.83) 9θptq “ u2ptq where u1 and u2 denote the speed and steering rate, respectively. These equations pose a nonholonomic constraint on the system, namely 9x sin θ “ 9y cos θ, prohibiting any side-slip of the unicycle. Alternatively, by packing the position vector px, yq, along with the heading direction (disguised through cos θ, sin θ), inside a 3ˆ3 matrix 111 gptq defined as gptq “ » ——————– cos θptq ´ sin θptq xptq sin θptq cos θptq yptq 0 0 1 fi ffiffiffiffiffiffifl , the dynamics of the unicycle (4.83) can be expressed as a left-invariant dynamics on SEp2q. Now, by letting X1 “ » ——————– 0 ´1 0 1 0 0 0 0 0 fi ffiffiffiffiffiffifl , X2 “ » ——————– 0 0 1 0 0 0 0 0 0 fi ffiffiffiffiffiffifl , X3 “ » ——————– 0 0 0 0 0 1 0 0 0 fi ffiffiffiffiffiffifl , denote a basis for the associated Lie algebra sep2q, the dynamics of the unicycle Figure 12: This figure illustrates the state variables associated to the dynamics of an unicycle. can be represented as 9g “ g ` u2X1 ` u1X2 ˘ “ gξu, g P SEp2q, (4.84) where ξu defines a control curve on the Lie algebra. 112 Given a set of planar positions triuNi“0 Ă R2, we focus on finding a curve g : rt0, tN s Ñ SEp2q which would traverse (approximately) through the sequence of targeted positions r0 Ñ r1 Ñ ¨ ¨ ¨ Ñ rN at time t0, t1, t2, and so on, respectively. Our approach imposes regularization to this inverse problem by trading total fit-error against high values of the sum of speed and steering path integrals, and therefore the data smoothing problem can be expressed as the following optimal control problem on SEp2q: Minimize gpt0q,u1,u2 Nÿ i“0 }rptiq ´ ri}2 ` λ tNż t0 ` u21 ` u22 ˘ dt subject to 9g “ g ` u2X1 ` u1X2 ˘ , g : rt0, tN s Ñ SEp2q, u1, u2 P U , (4.85) where U is the space of real valued functions on rt0, tN s, and λ (ą 0) maintains the balance between goodness of fit and smoothness of the path. This data smoothing problem can also be interpreted as a trajectory reconstruction problem for planar curves, where regularization is imposed by penalizing high values of the speed and steering rate path integrals. Now, by comparing this data smoothing problem (4.85) with the optimal con- trol problem mentioned in maximum principle statement (4.45), we have Lpuq “ λpu21 ` u22q “ λxξu, ξuysep2q F pgptiq, riq “ }Agptiqe3 ´ ri}2 where A “ re1 e2sT , and teiu3i“1 denotes a standard basis vector in R3. Moreover, 113 the inner-product on sep2q is defined as xv1, v2ysep2q “ Trpv1MvT2 q for v1, v2 P sep2q, where M “ » ——————– 1 2 0 0 0 12 0 0 0 1 fi ffiffiffiffiffiffifl is a symmetric, positive definite matrix. 4.5.1 Maximum Principle Restricting our attention to normal extremals, we define the pre-Hamiltonian as Hpg, p, uq “ xp, TeLg ¨ ξuy ´ Lpuq (4.86) where p P T ˚g SEp2q, and TeLg represents tangent lift of the left translation by a group element g on SEp2q. Now we introduce µ at the dual of the Lie algebra (se˚p2q), defined as µ “ TeL˚g ¨ p. By letting X5i , i “ 1, 2, 3 denote a dual basis for se˚p2q (corresponding to the primal basis tXiu3i“1), µ can be represented as µ “ 3ÿ i“1 µiX5i . 114 Therefore, by exploiting left-invariance of the underlying dynamics (4.84), the pre- hamiltonian can be expressed as Hpg, p, uq “ xTeL˚g ¨ p, ξuy ´ Lpuq “ x 3ÿ i“1 µiX5i , pu2X1 ` u1X2 ˘ y ´ Lpuq “ u2µ1 ` u1µ2 ´ λpu21 ` u22q. (4.87) As both ξu and Lpuq are differentiable with respect to u, an optimal control input (u˚) can be obtained by solving BH Bui ˇˇ ˇˇ ui“u˚i “ 0, i “ 1, 2. (4.88) Then, from (4.87) and (4.88), the optimal control inputs can be expressed as ¨ ˚˚ ˝ u˚1 u˚2 ˛ ‹‹‚“ 1 2λ ¨ ˚˚ ˝ µ2 µ1 ˛ ‹‹‚, (4.89) and by substituting the optimal controls into the pre-hamiltonian (4.87) yields an SEp2q-invariant hamiltonian. Hence we have the reduced hamiltonian on se˚p2q, given by h “ 14λpµ 2 1 ` µ22q. (4.90) 4.5.2 Frechet Derivative of the Fit Error Now we shift our attention towards computing the Frechet derivative of the fit-error. It is easy to check, that the fit error between data and the reconstructed 115 position (4.85) can be expressed as F pgptiq, riq “ }Agptiqe3 ´ ri}2 gptiq P SEp2q, ri P R2 “ eT3 gT ptiqATAgptiqe3 ´ 2rTi Agptiqe3 ` rTi ri. (4.91) Now we assume h to be a tangent vector at gptiq P SEp2q, and hence it can be parametrized as h “ gptiqφ where φ P sep2q. Therefore, a perturbed value of the fit-error (at time ti) can be expressed as F ` gptiqeǫφ, gi ˘ “ eT3 ` eǫφ ˘TgT ptiqATAgptiq ` eǫφ ˘ e3 ´ 2rTi Agptiq ` eǫφ ˘ e3 ` rTi ri “ eT3 ` I3 ` ǫφT `Opǫ2q ˘ gT ptiqATAgptiq ` I3 ` ǫφ`Opǫ2q ˘ e3 ´ 2rTi Agptiq ` I3 ` ǫφ`Opǫ2q ˘ e3 ` rTi ri. (4.92) From (4.91) and (4.92) we can compute the Frechet differential of F along h as DgptiqF ` h ˘ “ lim ǫÑ0 1 ǫ ´ F ` gptiqeǫφ, gi ˘ ´ F ` gptiq, gi ˘¯ “ lim ǫÑ0 1 ǫ “ 2ǫeT3 φTgT ptiqATAgptiqe3 ´ 2ǫrTi Agptiqφe3 `Opǫ2q ‰ “ 2 “ Agptiqe3 ´ ri ‰T “Ahe3 ‰ “ 2Tr ´“ Agptiqe3 ´ ri ‰“ Ahe3 ‰T¯ “ 2Tr ´ AT “ Agptiqe3 ´ ri ‰ eT3 hT ¯ “ @ 2AT “ Agptiqe3 ´ ri ‰ eT3M´1, h D gptiq , (4.93) 116 and hence we have DgptiqF “ 2AT “ Agptiqe3 ´ ri ‰ eT3M´1. Alternatively, by noting that the differential can be expressed as DgptiqF ` h ˘ “ 2Tr ´ AT “ Agptiqe3 ´ ri ‰ eT3 φTgptiqT ¯ “ 2Tr ´ gptiqTAT “ Agptiqe3 ´ ri ‰ eT3 φT ¯ “ @ 2gptiqTAT “ Agptiqe3 ´ ri ‰ eT3M´1, h D gptiq , (4.94) it can be concluded that TeL˚gptiq ¨DgptiqF “ 2gptiq TAT “ Agptiqe3 ´ ri ‰ eT3M´1. (4.95) 4.5.3 Reduced Dynamics and Jump Discontinuities on se˚p2q Next we focus on the derivation of reduced dynamics and associated jump conditions. By following the path laid out by Krishnaprasad [1993], the reduced dynamics on se˚p2q can be computed as 9µiptq “ ´ 3ÿ j“1 3ÿ k“1 µkptqΓkij Bh Bµj ptq, i “ 1, 2, 3, (4.96) where the temporal variable t lies in the open intervals ptl, tl`1q, l “ 0, ¨ ¨ ¨ , N´1, and Γkij denote the structure constants associated with the Lie algebra sep2q. Moreover, the corresponding jump conditions for µ can be obtained via Frechet derivative of the fit-error. 117 By computing the Lie brackets on sep2q as rX1, X2s “ X3, rX2, X3s “ 0, rX3, X1s “ X2, (4.97) the associated structure constants can be expressed in the following way Γ312 “ 1, Γ231 “ 1, (4.98) with Γkij “ ´Γkji, 1 ď i, j, k ď 3, and the rest of the structure constants are zero. As a result, the reduced dynamics on se˚p2q can be expressed as ¨ ˚˚ ˚˚ ˚˚ ˝ 9µ1 9µ2 9µ3 ˛ ‹‹‹‹‹‹‚ “ 12λ ¨ ˚˚ ˚˚ ˚˚ ˝ ´µ2µ3 µ3µ1 ´µ1µ2 ˛ ‹‹‹‹‹‹‚ t P ptk, tk`1q, (4.99) and the corresponding jump conditions are given by µipt`k q ´ µipt´k q “ @ TeL˚gptkq ¨DgptiqF,Xi D I3PSEp2q i “ 1, 2, 3 “ @ 2gptkqTAT “ Agptkqe3 ´ rk ‰ eT3M´1, Xi D I3PSEp2q “ Tr ` 2gptkqTAT “ Agptkqe3 ´ rk ‰ eT3XTi ˘ , (4.100) where k “ 0, 1, ¨ ¨ ¨ , N ´ 1. 118 4.5.4 Explicit Solution of the Reduced Dynamics Now we attempt to obtain a closed form solution for the reduced dynamics (4.99). It is easy to check that the reduced Hamiltonian (4.90) is a conserved quantity. Furthermore, by introducing C “ 14λ ` µ22 ` µ23 ˘ , (4.101) we can show that C is also conserved along the trajectories of (4.99). Then, by exploiting the constants of motion, namely the reduced Hamiltonian h (4.99) and the Casimir C (4.101), the dynamics of µ2 can represented as 9µ2 “ 1 2λ b p4λh´ µ22qp4λC ´ µ22q “ 2 ? hC dˆ 1´ µ 2 2 4λh ˙ˆ 1´ hC µ22 4λh ˙ . (4.102) Then it is straightforward to show that (4.102) yields an explicit solution involving Jacobi’s elliptic sine function. Whenever h ď C, the solution can be expressed as µ2ptq “ 2 ? λh Sn ˜c C λ pt` φkq, c h C ¸ , (4.103) 119 where Snp¨, ¨q denotes Jacobi’s elliptic sine function and t P ptk, tk`1q. Now, by exploiting the standard identities for elliptic functions, we can express µ1 and µ3 as µ21 “ 4λh Cn2 ˜c C λ pt` φkq, c h C ¸ µ23 “ 4λC Dn2 ˜c C λ pt` φkq, c h C ¸ , (4.104) and the appropriate signs will depend on the initial/boundary conditions. A similar solution exists for the situation when h ą C. Now, by exploiting the fact that both µpt´0 q and µpt`Nq are equal to zero, we turn it into a two-point boundary value problem, and solve it via an appropriate multiple-shooting method [Morrison et al., 1962]. Finally, an optimal state trajectory can be obtained by integrating the group dynamics along with an optimal initial condition and optimal control inputs. 4.6 Conclusion In this chapter, we have developed a framework (based on a modified version of the maximum principle) to solve data smoothing in a semi-analytic way, and our results are applicable to problems in both Euclidean and finite dimensional matrix Lie group settings. We demonstrate the pertinence of this approach by solving an example problem, wherein the generative model is governed by a left invariant vector field on a matrix Lie group (SEp2q) and regularization is imposed through a left invariant path cost (Lagrangian). In this special case Lie-Poisson reduction leading to explicitly integrable dynamics brings in further simplification into the problem, and we get closed-form solutions (in terms of Jacobi’s elliptic functions). 120 Part II Analysis of Collectives 121 Chapter 5: Analysis of Bat Foraging in Two Different Contexts Research in bat echolocation has yielded a rich trove of insight into how the bat perceives the world through active acoustic probing (Griffin et al. [1960]; Sim- mons et al. [1979]). Yet surprisingly little is known about how perception is turned into action such as steering towards a target in foraging. Limited availability of suitable high speed motion capture technology hindered earlier efforts to address this question. More recently, trajectory analysis in the work by Ghose et al. [2006] showed that the big brown bat, Eptesicus fuscus, essentially maintains constant ab- solute target direction (CATD) while chasing a free flying target, a species of praying mantis (Parasphendale agrionina). However, in a later study of competitive forag- ing for a single tethered food source [Chiu et al., 2010], evidence emerged that a big brown bat resorts to directing its flight towards a competitor, thus employing classical pursuit (CP). In this present work1, using geometric and statistical analysis and control theory, we describe a comparative study of how foraging context shapes bat flight strategy. The current study examines two different flight control strategies, namely classical pursuit (CP) and constant absolute target direction (CATD). The CP strat- 1A significant portion of this chapter has been reproduced verbatim from a pre-print by Dey et al. [2014]. 122 egy refers to a configuration in which the follower always points its velocity vector towards the position of a target (Galloway et al. [2010]; Wei et al. [2009]). The CP strategy can also be viewed as a special case of constant bearing (CB) pursuit strategy, which has gaze heuristic [McBeath et al., 1995] as one of its manifestation. On the other hand, CATD is a stealth strategy in which the follower approaches the target in such a manner that from the target’s point of view the follower always appears to be at the same bearing [Srinivasan & Davey, 1995]. This strategy is also known as motion camouflage (MC) strategy as it nullifies the transverse component of the relative velocity, and therefore the follower’s optic flow vanishes to zero in the target’s field of vision [Justh & Krishnaprasad, 2006]. This work also provides some insight about the behavioral latency associated with a bat-flight. In one of the earliest works by Ghose & Moss [2006], investigating sensori- motor transformation in a foraging bat, it was possible to simultaneously record what the bat perceived through its acoustic gaze, and its response through steering action. The behavioral context here - a single bat trained to seek, localize and capture a tethered mealworm hanging from the ceiling of a darkened flight room - is simpler than that in either of the two later studies (Chiu et al. [2010]; Ghose et al. [2006]) that constitute the focus of the present paper. The resulting bat flight trajectories are essentially planar. A main result of the study by Ghose & Moss [2006] is the discovery of a feedback law that relates planar turning rate of the bat to acoustic gaze angle, and the observation that the gain parameter in the law is modulated by the echolocation pulse production rate (PPR) - higher the PPR, greater is the gain. This observed adaptive linkage of flight motor output to spatial auditory 123 information about the target (stationary food item) was suggested as a compromise between uncoupling gaze direction and flight control (possibly conserving energy) and tight coupling to ensure accuracy needed for successful taking of the food item. While not emphasized by Ghose & Moss [2006], the feedback law is consistent with executing what we call the CP strategy in this paper, thus indicating that the foraging bat has CP strategy in its repertoire of flight behavior. Besides CP and CATD other strategies such as following a boundary may also be identifiable as being part of the repertoire of an echolocating bat. 5.1 Experiment Details and Reconstruction of Trajectories In this work we have analyzed the flight data collected from a series of experi- ments conducted by students of Prof. Cynthia Moss at the Auditory Neuroethology Laboratory (BATLAB), Department of Psychology, University of Maryland, and performed a comparative analysis of the underlying flight strategies and feedback mechanism for steering control. The bat flight experiments were carried out in a large flight room with two high-speed cameras (Kodak MotionCorder CCD-based cameras, running at 240 frames/s) placed in adjacent corners of the room. A com- mercially available motion analysis software (Motus, Peak Performance Technolo- gies, Englewood, CO) was used to recover 3-D position data from high-speed stereo images. Finally we use the regularized inversion approach (Section 2.1) to smoothen the individual trajectories and extract their speed and curvatures. Furthermore, all animal care and experimental procedures were approved by the Institutional Animal 124 0 0.5 1 1.5 2 2.5 3 0 1 2 −0.5 0 0.5 1 1.5 2 2.5 3 y− ax is x−axis z − a x i s Bat (Smooth) Mantis (Smooth) Bat (Raw) Mantis (Raw) (a) A typical example of trajectory reconstruc- tion. 10−5 10−4 10−3 10−2 101 102 103 104 105 Regularization Parameter (λ) C r o s s V a l i d a t i o n C o s t Bat Mantis (b) The corresponding variation in OCV cost. Figure 13: This figure shows reconstructed trajectories for a particular pursuit event along the with raw data. It also shows the variation of cross validation cost as a function of the smoothing parameter. Care and Use Committee at the University of Maryland, College Park. At the initial stage of our study of bat-mantis interactions, eight bats were trained to catch both free flying and tethered insects, and the room walls and ceiling of the indoor flight arena were covered with sound-absorbent foam. Later during the experiments, the praying mantis was released by hand as the bat was flying around in the room. Moreover the ultrasound triggered diving behavior of the mantises were suppressed by plugging Vaseline into their ears. For these bat-mantis experiments we analyzed 18 successful trials wherein the bat eventually catches the insect. As the number of trials were not very high we performed ordinary cross-validation (OCV) for each trajectory in each of the trials, and used the result of OCV in reconstructing the corresponding trajectory. 125 On the other hand, five big brown bats, forming four pairs, were used in the experiments for studying the bat-bat interactions. The experiments were conducted between July and September in 2005 and 2006. After being trained to capture a tethered mealworm individually, two bats were released simultaneously from the same spot in the flight room to compete for a single tethered mealworm. The trials ended whenever one bat made contact with the mealworm. For this set of bat- bat experiments we had 154 trials at our disposal. As the computational time for cross-validation and trajectory reconstruction is quite significant (around 2 days on a 12-core workstation, for a trajectory with 400 data points and 50 discrete values of λ-parameter), we decided to perform OCV and trajectory reconstruction over a subset of the whole data-set. This required extra care in picking the individual trials for reconstruction. So, we randomly selected 30 Bat-1 trajectories (through 10−10 10−8 10−6 10−4 10−2 100 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Optimal λ-Values (m4s) N or m al iz ed C ou nt (a) Distribution of optimal values of λ for Bat- 2 trajectories. 10−10 10−8 10−6 10−4 10−2 100 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Optimal λ-Values (m4s) N or m al iz ed C ou nt (b) Distribution of optimal values of λ for Bat- 1 trajectories. Figure 14: This figure shows the distribution of optimal values of regularization parameter (λ˚) used to reconstruct trajectories for bat-bat interactions. 126 a uniform random sampling) from a pool of 154 Bat-1 trajectories, and performed OCV on these trajectories. Then we chose the most frequent value of optimal λ for reconstructing Bat-1 trajectories. Similar approach was adopted to choose a λ-value for reconstructing Bat-2 trajectories. Next, we randomly selected 30 trials (out of 154) through a uniform random sampling, and this sampling was independent to the previous selections (for OCV). Finally we reconstructed the Bat-1 and Bat-2 trajectories for these 30 trials using the previously chosen λ-values. 10−6 10−5 10−4 10−3 10−2 10−1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Optimal λ-Values (m4s) N or m al iz ed C ou nt (a) Distribution of optimal values of λ for bat trajectories. 10−6 10−5 10−4 10−3 10−2 10−1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Optimal λ-Values (m4s) N or m al iz ed C ou nt (b) Distribution of optimal values of λ for man- tis trajectories. Figure 15: This figure shows the distribution of optimal values of regularization parameter (λ˚) used to reconstruct trajectories for bat-mantis interactions. 5.2 Pre-processing of Trajectory Data In the work by Ghose & Moss [2006], key aspect of data analysis is to recognize that flight behavior can be demarcated into segments. While the bat is initially ignorant of the location of the target (presented by opening a ceiling trapdoor at 127 a random location at random times), it goes through a sequence of stages from search/approach to tracking to attack of the mealworm, ending the trial. This demarcation of stages of flight was suggested by examination of histograms of PPR of the echolocation calls which show three clear peaks corresponding to the stages. Further in the course of a trial, increasing PPR is associated to increasing accuracy in localization of target prior to capture. The demarcation into stages was then used in the temporal segmentation of trajectory properties (turning rate, acoustic gaze angle etc.) for the purposes of statistical fitting of steering feedback laws in each segment. In the setting of a single bat engaged in three-dimensional pursuit of a free- flying insect as in the work of Ghose et al. [2006], similar trajectory segmentation is possible, guided by echolocation PPR. In his dissertation, Reddy [2007] has used such segmentation in fitting feedback laws, focusing essentially on attack segments. In multiple trials highly maneuvering behavior is exhibited by the insect prey (whose sensitive hearing of bat sonar is (only partially) disabled to reduce the incidence of evasive action). Restricting data fitting mainly to segments characterized by PPR as attack segments misses important components of pursuit behavior taking place over the full course of a trial. In the setting of competitive prey capture the interaction between competing bats appears to be of great relevance to the outcome. During the course of such competitive interactions vocalization information is confounded by the presence of interspersed social calls to possibly communicate intent of one bat to another [Wright et al., 2014]. There are also periods of silence (as observed by Chiu et al. [2008]) of one or more of the bats. Thus there is a need for disambiguation 128 between echolocation and social calls, appropriate for use in flight segmentation, whereas in the context of single bat prey capture flights this consideration does not arise. In this paper we side-step this disambiguation problem, by adopting an approach to segmentation that does not use vocalization patterns in either context, and instead is based on a geometric criterion described below. In preparation for segmentation of trajectories as needed in the analysis of flight behavior, we introduce two geometric concepts, namely following and con- vergence, to assist us in understanding the individual roles in a dyadic (bat-mantis or bat-bat) interaction. By letting ri and xi (respectively rj and xj) denote the position and normalized velocity of the individual i (respectively the individual j) in a dyadic interaction, these two notions can be defined as: Definition 5.1 (Following Property). The flight behavior of an individual i (inter- acting with individual j) is called “following” when its velocity vector has a negative projection on its relative position vector rji (“ ri ´ rj), i.e. rji |rji| ¨ xi ă 0. (5.1) Definition 5.2 (Convergence). The flight behavior of an individual i is called “con- verging towards the individual j” if the distance between the individuals is shrinking, i.e. rji |rji| ¨ 9rji ă 0, (5.2) where the time derivative 9rji denotes the relative velocity. 129 Clearly, these two notions split a flight into the following four different regimes: • Class I : Following and Converging, • Class II : Following but Not Converging, • Class III : Not Following but Converging, and • Class IV : Neither Following nor Converging, depending on the angle between the baseline vector and the velocity vectors of the individuals. We should note that the convergence property is symmetric with respect to individual roles. Any particular flight trial will have a number of different contiguous segments characterized by the properties of following and convergence. In Fig 16, we display distribution functions across all trials of the durations of contiguous segments which are simultaneously following and converging. Averaging over multiple flight trials, we designate an individual as follower (pursuer) in a dyadic interaction, if it obeys the following condition for a duration longer than that for the other individual (which we designate as pursuee). The pie-chart in Fig 17a shows the percentage of all the four classes in the flight data collected for Bat-2. From this pie-chart one can notice that Bat-2 follows Bat-1 for more than 66% of the time. On the contrary Bat-1 follows Bat-2 for only 27% of the time. Therefore we consider Bat-2 to be the follower of Bat-1 for further analysis. This methodology for classification reveals that in spite of the setup being symmetric there is a strong evidence of leader-follower relationship when a bat competes for a single food source with another conspecific. On the other hand the pie-chart in Fig 18 shows the percentage of all four classes in the flight data from bat-mantis trajectory pairs. From this pie-chart it is 130 0 200 400 600 800 1000 1200 1400 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Contiguous duration of Following & Converging regimes (ms) C D F (a) Bat-bat interactions (Pursuer: Bat-2, Pur- suee: Bat-1). 0 200 400 600 800 1000 1200 1400 1600 1800 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Contiguous duration of Following & Converging regimes (ms) C D F (b) Bat-mantis interactions (Pursuer: Bat, Pursuee: Mantis). Figure 16: This figure shows the CDF for contiguous durations of following and converging (Class I) flight segments. 38.1229 28.2881 10.1109 23.4781 Class I Class II Class III Class IV (a) Percentage of four classes of flight behavior for the competitive interaction between two bats. 17.8791 9.7152 30.3547 42.051 Class I Class II Class III Class IV (b) Effect of role reversal on the segmentation of flight behavior for the bat-bat interaction. Figure 17: This figure illustrates the fact that in a competitive interaction between two big brown bats one of the bats leads the other. clear that the bat follows the target for around 75% of the time. It also converges towards the praying mantis for more than 70% of the time. 131 5.3 Analysis of Flight Strategy Once we have segmented each trajectory into four classes (following and con- verging ; following, but not converging ; not following, but converging ; and neither following nor converging), we examine the trajectory data to weigh support for or against the pursuit strategies CP and CATD. This is done by computing contrast function values (Λ for CP and Γ for CATD/MC, Section 1.3.2) associated with the data, and comparing the value distributions. A value close to ´1 for a contrast function means strong support for the associated strategy. On the other hand a value of `1 denotes maximum departure from the associated strategy. In order to determine how long a trailing bat remained in the CP or CATD state, we consider the duration of the flight when the contrast function value goes below ´0.9, i.e. it lies in the range r´1,´0.9s. This duration of interest can be easily computed as a percentage of the total flight duration by paying attention to the cumulative 61.0468 13.1282 9.1452 16.6798 Class I Class II Class III Class IV Figure 18: This figure shows the percentage of four flight behavior classes in bat-mantis pursuit events. 132 distribution of contrast function values. The rationale behind choosing the thresh- old at ´0.9 is based on the principle that outcome of a statistical hypothesis test should not depend on a test parameter. It should be noted here that, as a means for closer inspection, we also restrict our focus on those flight regimes which are both following and converging (Class I), and recompute the statistics. This provides a common base for comparison, ensuring that neither of the contrast function values become non-negative. Initially we analyze the bat-bat pursuit strategy for the complete set of re- constructed flight data, and the corresponding histograms of Λ and Γ are shown in Fig 19. The closer the contrast function is to -1, the more the bats’ flight behavior approaches a particular pursuit strategy. The peak of the CP contrast function is positioned around -1, which indicates that the following bat mostly relies on the CP strategy to pursue the leader (another conspecific). On the other hand, the CATD contrast function is more evenly distributed between ´1 and 1, indicating lack of ev- −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Λ Values N o r m a li ze d Co un t (a) CP (Contrast Function: Lambda). −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Γ Values N o r m a li ze d Co un t (b) CATD (Contrast Function: Gamma). Figure 19: Distribution of contrast function values shows dominance of CP during bat-bat inter- actions. The frequency (y-axis) is normalized by the maximum count (considering both strategies). 133 −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Λ Values N o r m a li ze d Co un t (a) CP (Contrast Function: Lambda). −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Γ Values N o r m a li ze d Co un t (b) CATD (Contrast Function: Gamma). Figure 20: Distribution of Λ and Γ values shows dominance of CP during the following and converging segments (class I) of bat-bat pursuit events. The frequency (y-axis) is normalized by the maximum count (considering both strategies) idence in favor of the CATD pursuit strategy. Moreover, the data show that 25.32% of the time the following bat stays in the CP state, while on contrary it stays in CATD state for only 3.79% of the time. This difference between evidence for each of the individual strategies becomes more prominent if we focus on the following and converging flight behavior, i.e. if data points from only class I are considered for −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Values for Contrast Function C D F Λ Γ (a) Comparison of CDFs of the contrast func- tions for CP and CATD (whole data set). −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Values for Contrast Function C D F Λ Γ (b) Comparison of CDFs of the contrast func- tions for CP and CATD (during class I). Figure 21: Comparison of CDFs for the contrast functions shows dominance of classical pursuit during bat-bat interactions. 134 −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Λ Values N o r m a li ze d Co un t (a) CP (Contrast Function: Lambda). −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Γ Values N o r m a li ze d Co un t (b) CATD (Contrast Function: Gamma). Figure 22: Distribution of Λ and Γ shows dominance of CATD/MC during bat-mantis interac- tions. The frequency is normalized by the maximum count (considering both strategies). strategy analysis. In that case the following bat stays in the CP state for 47.83% of the time, against 7.48% of the time spent in the CATD state. The associated histograms are shown in Fig 20. Therefore our present work reconfirms the findings by Chiu et al. [2010], i.e. bats do not apply CATD while pursuing conspecifics, rather they use CP strategy to follow another bat. On the other hand, Fig 22 shows the histograms of Λ and Γ for the complete −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Λ Values N o r m a li ze d Co un t (a) CP (Contrast Function: Lambda). −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Γ Values N o r m a li ze d Co un t (b) CATD (Contrast Function: Gamma). Figure 23: Distribution of Λ and Γ shows dominance of CATD/MC during the following and converging segments (class I) of bat-mantis pursuit events. The frequency is normalized by the maximum count (considering both strategies) 135 −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Values for Contrast Function C D F Λ Γ (a) Comparison of CDFs of the contrast func- tions for CP and CATD (whole data set). −1 −0.5 0 0.5 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Values for Contrast Function C D F Λ Γ (b) Comparison of CDFs of the contrast func- tions for CP and CATD (during class I). Figure 24: Comparison of CDFs for the contrast functions shows dominance of CATD/MC during bat-mantis interactions. set of bat-mantis trajectory pairs. From this figure one can notice that the data indicates strong evidence in favor of CATD pursuit strategy. Quantitatively, the bat stays in the CATD state for 22.05% of the time in comparison to 9.12% of the time in the CP state. Now we narrow our focus to the following and converging segments of the flight, i.e. data points from only class I are considered for strategy analysis. In that case the bat stays in the CATD state for 32.72% of the time, against 14.42% of the time in the CP state (Fig 23). Therefore our analysis provides support for bats’ use of CATD for pursuing a free flying mantis. However, at this level of flight strategy analysis (through studying the distri- bution of associated contrast function values), the significance of distinction between CP and CATD is less sharply delineated for bat-mantis interactions than for bat-bat interactions. This leads us to the next part of our analysis, i.e. comparison at the level of feedback laws for steering control. 136 5.4 Analysis of Steering Control A bat executes a pursuit strategy by continually adjusting the curvature of its trajectory based on its perception of the relative motion of the target. Such strategy- specific steering feedback control laws have been a subject of applied mathematical research (Galloway et al. [2010]; Justh & Krishnaprasad [2006]; Reddy [2007]; Reddy et al. [2006]). Here we investigate steering controls that underlie a bat’s pursuit strategy by comparing empirical values of trajectory curvature with predictions from theoretically well-founded feedback control laws (Table 5.1), and provide evidence at the level of the steering control mechanism as well. By letting, puem, vemq denote the empirical curvatures obtained from trajec- tory smoothing and puth, vthq denote the curvature values computed using feedback laws indicated in Table 5.1, we formalize this analysis as the following mismatch minimization problem Minimize µą0,δPN ¨ ˚˝ 1ř jPS ` |Ej| ´ δ ˘ ÿ jPS ÿ tkPEj ”` uemptkq ´ uthptk ´ δ∆q ˘2 ` ` vemptkq ´ vthptk ´ δ∆q ˘2ı ˛ ‹‚. (5.3) Here, N, Ej and S represent the set of natural numbers, the set of time indices associated with reconstructed trajectories for the j-th trial, and the index set of all trials under consideration, respectively. It is essential to incorporate delays (δ∆) into the theoretical curvature terms in the mismatch minimization problem, to take into account the latency present in the sensorimotor feedback loops and to estimate it from the data. We should also note that the discreteness of delay values (in 137 Strategy Steering Feedback Law CATD/MC: uth “ ´ µ νp ´ zp ¨ ` 9rˆ r|r| ˘¯ vth “ µ νp ´ yp ¨ ` 9rˆ r|r| ˘¯ CP: uth “ ´ µ νp ´ yp ¨ r |r| ¯ ´ 1νp|r| ´ zp ¨ ` 9rˆ r|r| ˘¯ vth “ ´ µ νp ´ zp ¨ r |r| ¯ ` 1νp|r| ´ yp ¨ ` 9rˆ r|r| ˘¯ Table 5.1: Theoretically plausible feedback laws for constant absolute target direction (CATD/MC) and classical pursuit (CP). (5.3)) arises only because of data availability at a finite sample rate (with sampling interval ∆). Clearly, in addition to gathering evidence for a particular pursuit strategy, this approach also yields an estimate of behavioral latency (sensorimotor delay) associated with the pursuit events. Proposition 5.1. Let takuNk“0 and ta˜kuNk“0 be two finite sequences, and consider the following optimization problem: Minimize µą0,δPN,ηPR ˜ 1 N ` 1´ δ Nÿ k“δ }apkq ´ µa˜pk ´ δq ´ η}2 ¸ . (5.4) Then (5.4) can be approximated by the following optimization problem Maximize δPN Corrpa, a˜δq, (5.5) where a˜δ represents a δ-shifted copy of ta˜ku, i.e. a˜δpkq “ a˜pk ´ δq. 138 Moreover, the optimal values of µ and η are given by µ “ Covpa, a˜ δq Varpa˜δq (5.6) η “ 1N ` 1´ δ Nÿ k“δ ´ apkq ´ µa˜pk ´ δq ¯ (5.7) Proof. One can notice that (5.4) can be expressed as Minimize δPN ˜ Minimize µą0,ηPR ˜ 1 N ` 1´ δ Nÿ k“δ }apkq ´ µa˜pk ´ δq ´ η}2 ¸¸ , (5.8) and this formulation enables us to solve the optimization problem through a two- step process. Now, for a given δ, we define aavg “ 1N`1´δ Nř k“δ apkq and a˜avg “ 1 N`1´δ N´δř k“0 a˜pkq. Then, for that particular choice of δ, we have Nÿ k“δ }apkq ´ µa˜pk ´ δq ´ η}2 “ Nÿ k“δ ´` apkq ´ aavg ˘ ´ µ ` a˜pk ´ δq ´ a˜avg ˘ ` ` aavg ´ µa˜avg ´ η ˘¯2 “ Nÿ k“δ ´ bpkq ´ µb˜pk ´ δq ` ` aavg ´ µa˜avg ´ η ˘¯2 “ Nÿ k“δ ` b2pkq ´ 2µbpkqb˜pk ´ δq ` µ2b˜2pk ´ δq ˘ ` Nÿ k“δ ` aavg ´ µa˜avg ´ η ˘2 ` 2 Nÿ k“δ ` bpkq ´ µb˜pk ´ δq ˘` aavg ´ µa˜avg ´ η ˘ (5.9) where bpkq fi apkq ´ aavg and b˜pkq fi a˜pkq ´ a˜avg (k P tδ, . . . , Nu) are two zero mean 139 sequences. As the third term of (5.9) ceases to zero, one can notice that (5.9) get minimized by choosing η “ aavg ´ µa˜avg “ 1 N ` 1´ δ Nÿ k“δ ` apkq ´ µa˜pk ´ δq ˘ (5.10) µ “ Nř k“δ bpkqb˜pk ´ δq Nř k“δ b˜2pk ´ δq “ Covpa, a˜ δq Varpa˜δq . (5.11) Replacing µ and η with their optimal values, (5.9) can be expressed as Nÿ k“δ ˜ b2pkq ´ 2Covpa, a˜ δq Varpa˜δq bpkqb˜pk ´ δq ` ˆCovpa, a˜δq Varpa˜δq ˙2 b˜2pk ´ δq ¸ “ pN ` 1´ δq ˜ Varpaq ´ 2Covpa, a˜ δq Varpa˜δq Covpa, a˜ δq ` ˆCovpa, a˜δq Varpa˜δq ˙2 Varpa˜δq ¸ “ ´pN ` 1´ δqVarpaq ˜ ` Covpaa˜δq ˘2 VarpaqVarpa˜δq ´ 1 ¸ (5.12) as both b and b˜ zero mean sequences. By using the minimum value from the inner optimization (5.12), the problem of our interest can be expressed as Maximize δPN ˜ Varpaq ˜ ` Covpa, a˜δq ˘2 VarpaqVarpa˜δq ´ 1 ¸¸ ô Maximize δPN Varpaq ´` Corrpa, a˜δq ˘2 ´ 1 ¯ . (5.13) Assuming the delay to be sufficiently small compared to the length of the sequence (δ ! N), we can ignore the effect of δ on the empirical (sample) variance of a (first factor of the cost). As a consequence, the original optimization problem can be 140 approximated as Maximize δPN Corrpa, a˜δq. (5.14) One can readily recognize that solving the minimization problem (5.3) is com- putationally demanding. However, this computational complexity can be tackled by approximating it with a correlation maximization problem (as shown via Proposi- tion 5.1). In this alternative approach, we compute the correlation between empirical data (natural curvatures uem, vem stacked in a single array) and the theoretically predicted curvature values (uth, vth stacked in a single array), as a function of de- lay. Then, the delay which maximizes this correlation provides an estimate for the behavioral latency. For the bat-bat pursuit events the variation of correlation is shown in Fig 25, and the corresponding values of optimal gain (µ˚) and optimal delay (δ˚) are pro- 0 50 100 150 200 250 300 350 4000 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Delay (ms) C o r r e la ti on V al ue U V U−V (a) Correlation between empirical curvatures and the curvatures obtained from the CATD feedback law. 0 50 100 150 200 250 300 350 4000 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Delay (ms) C o r r e la ti on V al ue U V U−V (b) Correlation between empirical curvatures and the curvatures obtained from the CP feed- back law. Figure 25: Variation of correlation between empirical and theoretical curvatures shows dominance of classical pursuit during bat-bat pursuit events. 141 Figure 26: Variation of residual for a CATD feedback law (Bat-Bat pursuit events). The residual values (color-coded) are shown in log 10 scale. Figure 27: Variation of residual for a CP feedback law (Bat-Bat pursuit events). The residual values (color-coded) are shown in log 10 scale. 142 CATD CP Maximum Correlation (ρmax) 0.5307 0.6159 Delay (δ˚) [ms] 272.9167 166.6667 Linear Gain (µest) 0.7156 1.9792 λ1 0.6256 0.3378 λ2 0.1607 0.0188 σ1 79.5584 94.7238 σ2 20.4416 5.2762 Table 5.2: Summary of the statistical analysis of steering control laws for bat-bat pursuit events. λ1 and λ2 represent the principal component variances, i.e., eigenvalues of the covariance matrix. σ1 and σ2 represent the percentage of total variance explained by principle components. CATD CP Minimum Value of Mismatch 0.3429 0.2010 Normalized Mismatch 1.0396 0.6216 Linear Gain 0.7165 1.9658 Delay (δ˚) [ms] 277.0833 177.0833 Table 5.3: Summary of the residual analysis of steering control laws for bat-bat pursuit events. The mismatch is normalized by the product of rms values of empirical and theoretical curvatures. vided in Table 5.2. One can notice that the correlation between the theoretical and empirical values of the curvatures (u-v stacked together) attains maximum (at 0 50 100 150 200 250 300 350 4000 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Delay (ms) C o r r e la ti on V al ue U V U−V (a) Correlation between empirical curvatures and the curvatures obtained from the CATD feedback law. 0 50 100 150 200 250 300 350 4000 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Delay (ms) C o r r e la ti on V al ue U V U−V (b) Correlation between empirical curvatures and the curvatures obtained from the CP feed- back law. Figure 28: Variation of correlation between empirical and theoretical curvatures shows dominance of CATD pursuit strategy during a bat-mantis chase. 143 Figure 29: Variation of residual for a CATD feedback law (Bat-Mantis pursuit events). The residual values (color-coded) are shown in log 10 scale. Figure 30: Variation of residual for a CP feedback law (Bat-Mantis pursuit events). The residual values (color-coded) are shown in log 10 scale. 144 0.6159) with the CP feedback law, and the corresponding delay is 166.67ms. We also perform a principal component analysis to confirm that the data is directional. The results show that the variance of one of the components is very high compared to the other. We also show the variation of the residual (mismatch defined in (5.3)) as a function of gain and delay. From Table 5.3 one can conclude that CP feedback laws yield a better match, and the corresponding gain and delay are similar to the ones obtained through correlation maximization. On the other hand, we show the variation of correlation for bat-mantis pursuit events in Fig 28, and the corresponding values of optimal gain (µ˚) and optimal delay (δ˚) are mentioned in Table 5.4. It can be noticed from the table that the cor- relation between the theoretical and empirical values of the curvatures (u-v stacked together) gets maximized (at 0.7403) by choosing the CATD feedback law, and the corresponding delay is 120ms. A principal component analysis of the curvature data shows that the variance of one of the components is very high compared to the other. In addition to computing the variation of correlation as a function of delay, we also analyze the variation of the residual as a bi-variate function of gain and delay (Fig 29 and Fig 30). We can observe that the empirical curvature values of the trailing bat in a bat- bat pursuit event are better correlated with a the CP feedback law; while on the other hand the empirical curvature values of the bat in a bat-mantis chase are better correlated with the theoretical feedback law which makes the interaction approach the CATD state. We have also found that the latency associated with the pursuit of a free flying target p« 120msq is significantly smaller than the latency associated 145 CATD CP Maximum Correlation (ρmax) .7403 0.0314 Delay (δ˚) [ms] 120 64 Linear Gain (µest) 1.2457 8.2354ˆ 10´7 λ1 0.5480 374938355.1287 λ2 0.0586 0.25895 σ1 90.3439 100 σ2 9.6561 6.9066ˆ 10´8 Table 5.4: Summary of the statistical analysis of steering control laws for bat-mantis pursuit events. λ1 and λ2 represent the principal component variances, i.e., eigenvalues of the covariance matrix. σ1 and σ2 represent the percentage of total variance explained by principle components. CATD CP Minimum Value of Mismatch 0.2029 2.8964ˆ 104 Normalized Mismatch 0.0511 7.6092ˆ 103 Linear Gain 1.2457 0.0100 Delay (δ˚) [ms] 118 102 Table 5.5: Summary of the residual analysis of steering control laws for bat-mantis pursuit events. The mismatch is normalized by the product of rms values of empirical and theoretical curvatures. with a competitive prey capture p« 170msq. This delay can be attributed to the combined effect of neural processing delay and motor action delay. 5.5 Discussion The results of this study demonstrate that the echolocating bat allows room for flexibility in its flight strategy. It adapts the underlying strategy and feedback mechanism for steering control to the context and goal of the task. Our analysis, built on geometric notions and control-theoretic methods, shows that single bats employ CATD while pursuing insect prey. On the other hand, when tasked to compete for a single food source, a bat does not apply CATD to chase a conspecific. Rather, it uses CP strategy while pursuing a competitor. 146 This work introduces two important notions, namely following property and convergence of a trajectory, to better understand the individual roles in a dyadic in- teraction. One distinguishing feature of these notions, similar to the ones introduced by Chiu et al. [2008], is that they are completely based on the geometry of flight trajectories, in particular individual positions and velocities; our approach does not consider the patterns of vocalization (for echolocation and warning conspecifics). Here, we have adopted a two stage approach for analysis of the trajectory data. Besides analyzing the distribution of relevant contrast function (Λ and Γ) values, we have also compared the empirical values of trajectory curvatures to the ones predicted by theoretically well-founded and biologically plausible feedback control laws. While analyzing the histograms of contrast function values, we noticed that the significance of distinction between CP and CATD is higher for bat-bat interactions than for bat-insect interactions. On the other hand, by performing the analysis at the level of steering control law, the dominance of CATD during a bat-insect interaction can be concluded in a much stronger way than the dominance of CP during a bat-bat interaction. This observation emphasizes the indispensability of a two stage approach to achieve a better understanding of the interactions and to evaluate which strategy prevails. During the trials involving two competing bats, our data shows emergence of a pursuer-pursuee relationship. The approach taken here does not address how this shift to asymmetry arises out of a symmetric setup. It has been known for some time that food-associated vocalization may be responsible for the emergence of such asymmetry (either by attracting or repelling conspecifics). Recent work by Wright 147 et al. [2014] suggests that this occurs in competitive foraging, when one of the bats (exclusively male) emits a type of social call - frequency-modulated bout (FMB) - to signify territoriality and food claiming. It would be of interest to find signatures in flight steering of such FMB-induced shifts. 148 Chapter 6: Analysis of Flocking in European Starlings Collective behavior in animal groups is quite fascinating and ubiquitous in nature, and over the decades had drawn attention of researchers from various fields of science. However, until recently it was very difficult to conduct any quantitative analysis for large groups of animals which are quite common in natural settings. This lack of studies, primarily caused by inadequacy of appropriate motion capture techniques to track common flocks, used to pose a serious problem as an analysis for a small group cannot be generalized for larger groups. The boundary effect is much more dominant for smaller groups. Equipped with advanced tools from stereometry and statistical analysis, Cav- agna et al. [2008a,b] developed a way to collect three-dimensional position and velocity data for large flocks of starling with number of birds varying from couple of hundreds to couple of thousands. One of their initial contribution was to show that local interactions, the building block for group level flocking behavior, does not depend on metric distance, rather on the topological distance [Ballerini et al., 2008a]. Based on the empirical data, they discovered that individual starlings in- teract with six/seven nearest neighbors (on average), rather than with all neighbors within a fixed radius. A more recent work, by suggesting that the flock maximizes 149 its robustness to uncertainty by interacting with six or seven neighbors, provides a justification for individual starlings to interact with six/seven nearest neighbors [Young et al., 2013]. Later, by measuring the correlation between velocity fluctua- tions of different birds, Cavagna et al. [2010] have shown that behavioral correlations are scale free, i.e. the behavioral change of an individual affects and is affected by that of all other members of the flock, independent of flock size. In the most recent work from this research group, Attanasi et al. [2014] have shown that directional information within a flock propagates with an almost constant speed, and this linear growth of information can be explained by models with wave-like aspects. However, these studies do not provide much insight about the agent-level steering control laws which give rise to flocking behavior. In this work of ours we attempt to uncover the flight strategies and underlying control laws by analyzing different parameters of motion, namely velocity, speed, curvatures etc. For that purpose we assume each starling to be a point particle, and apply the tools developed in Chapter 3 to extract speed and curvatures from the sampled dataset of observed positions. Then we perform correlation analysis to investigate the feedback mechanism for steering control governing coordinate motion of the flocks. Our analysis also provides estimates of the sensorimotor delay associated with the flocking behavior. 150 6.1 Experiment Details and Trajectory Reconstruction This work analyzes the flight data from a series of data collection events con- ducted by Dr. Andrea Cavagna and his collaborators from the Collective Behaviour in Biological Systems (COBBS) group at the Institute for Complex Systems (ISC- CNR), University of Rome “La Sapienza”. These time-sampled flight data were taken from the roof of Palazzo Massimo, Museo Nazionale Romano, in the city cen- ter of Rome, in front of one of the major roosting sites used by starlings during winter. Starlings spend the day feeding in the countryside, and before settling on the trees for the night they gather in flocks to perform aerial display, an apparently purposeless dance where flocks move and swirl in a remarkable way. Interested read- ers can refer to the work by Attanasi, A. and Cavagna, A. and Del Castello, L. and Giardina, I. and Jelic, A. and Melillo, S. and Parisi, L. and Shen, E. and Silvestri, E. and Viale, M. [2013] for further details about the experimental setup and the sophisticated algorithm for stereo reconstruction. 151 10−7 10−6 10−5 10−4 10−3 10−2 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Optimal λ−value (λ*) N om al iz ed C ou nt 02−08−ACQ3 11−24−ACQ1 11−25−ACQ1 12−01−ACQ3 12−07−ACQ1 12−14−ACQ4 12−15−ACQ1 12−20−ACQ2 Figure 31: This figure shows the distribution of optimal regularization parameters (λ˚) for dif- ferent flocks. The distribution corresponding to a particular flocking event is sharply peaked at a distinct value, and therefore emphasizes the strong dependence of λ˚ on the signal-to-noise ratio. Our work involves analysis of eight distinct flocking events captured during the winter months of 2011. We begin our analysis by reconstructing the flight tra- jectories using the smoothing algorithm (Algorithm 1) developed in Chapter 3. In contrast to our earlier work with bat trajectories, here we have performed cross- validation for individual trajectories and the corresponding optimal value of regu- larization parameter (λ˚) has been used for trajectory reconstruction. Fig 31 shows the distribution of λ˚, and thereby emphasizes that λ˚ has a strong dependence on the signal-to-noise ratio. The flocking events that we analyze are quite distinct in nature; while some of them (Fig 32d, Fig 32h) are minimally maneuvering flights, some involve coordinated turning (Fig 32a, Fig 32f, Fig 32g). The following table (Table 6.1) enlists the events under consideration along with the associated details (duration, flock size and frame-rate of data capture). 152 (a) Flock: 2011 02 08 ACQ3 (N=180) (b) Flock: 2011 11 24 ACQ1 (N=125) (c) Flock: 2011 11 25 ACQ1 (N=50) (d) Flock: 2011 12 01 ACQ3 (N=489) (e) Flock: 2011 12 07 ACQ1 (N=109) (f) Flock: 2011 12 14 ACQ4 (N=162) (g) Flock: 2011 12 15 ACQ1 (N=401) (h) Flock: 2011 12 20 ACQ2 (N=200) Figure 32: Within the scope of this current work we have analyzed the flight data of eight flocks. This figure shows the reconstructed trajectories for all these flocking events. Here “N” represents the number of birds in a particular flock. 153 Flocking Event Flock Size Duration Data Capture Rate (N) (seconds) (frames/second) 2011 02 08 ACQ3 180 5.4875 80 2011 11 24 ACQ1 125 1.8176 170 2011 11 25 ACQ1 50 5.6118 170 2011 12 01 ACQ3 489 2.3471 170 2011 12 07 ACQ1 109 3.8824 170 2011 12 14 ACQ4 162 4.1588 170 2011 12 15 ACQ1 401 5.7353 170 2011 12 20 ACQ2 200 1.7588 170 Table 6.1: Our study analyzes eight particular flocking events. This table enlists the details of the individual events. 6.2 Analysis of Flight Strategy and Underlying Steering Control One can easily notice (from Fig 32) that individuals in a starling flock fly in such a way that there is not much variation between the individual directions of motion (at least when they are involved in a coordinated turn or undergoing a minimally maneuvering path). This perception forms the basis for our analysis, and we introduce appropriate quantitative notions to investigate the applicability of this idea. We begin the analysis by computing the average cosine of the angle between the velocity of a focal bird i and velocity of the center of mass of its neighborhood (Ni). By letting vi denote the velocity of the i-th individual, the direction of motion of its neighborhood at time tk can be defined as xNiptkq “ ř jPNiptkq vjptkq | ř jPNiptkq vjptkq| , (6.1) whenever the neighborhood center of mass velocity does not vanishes to zero. Then 154 the average cosine of the angle (between vi and xNi) can be computed as Ci “ 1 |E | ÿ kPE viptkq |viptkq| ¨ xNiptkq, (6.2) where E represents the set of time indices associated with the flight duration. As Ci can be interpreted as a measure of how coherently a bird is moving with respect to its neighbors, Ci is named as the coherence for bird i. This work constructs the neighborhood of a focal bird i by considering its K- nearest neighbors. Then, by definition, Ni has a cardinality of K, and each node in the underlying attention graph1 has an out-degree of value K. For this particular choice for the neighborhood structure, we evaluate Ci for every member of the flock, and compute the flock averaged coherence by averaging it over the flock members. Clearly, this quantity is a property of the whole flock, and it depends only on the neighborhood size (K). Fig 33 shows the variation of flock averaged coherence as a function of the neighborhood size (K). It can readily be noticed from this set of figures that the flock averaged coher- ence gets maximized by considering 5-7 nearest neighbors. While some of the flocks (Fig 33c, Fig 33e, Fig 33f) attain the maximum coherence by picking K-values in the range (5-7), for rest of them, the gain/increase in flock averaged coherence becomes insignificant if one goes beyond this range of nearest neighbors. Thus our analysis 1As the nearest neighborhood relationship is not symmetric, it can be illustrated by a directed graph, wherein an edge exists from node-i to node-j if the individual j is one of the K-nearest neighbors of individual i (i.e., individual i is paying attention to individual j). This graph is called the underlying attention graph. Clearly, this graph changes over time, depending on the relative position of the group members. 155 reconfirms the findings by Ballerini et al. [2008a]. Next we focus on investigating the underlying steering control mechanism by comparing empirical values of trajectory curvature with predictions from theoreti- cally justifiable feedback control laws (discussed in detail in Chapter 7). By letting, puem, vemq denote the empirical curvatures obtained from trajectory smoothing and puth, vthq denote the curvature values computed using theoretical feedback laws, we formalize this analysis as the following mismatch minimization problem Minimize µą0,δPN ¨ ˚˝ 1ř jPS ` |Ej| ´ δ ˘ ÿ jPS ÿ tkPEj ”` uemptkq ´ uthptk ´ δ∆q ˘2 ` ` vemptkq ´ vthptk ´ δ∆q ˘2ı ˛ ‹‚, (6.3) Here, N, Ej and S represent the set of natural numbers, the set of time indices associated with the flight duration of individual j, and the index set of all starlings belonging to a particular flock, respectively. This mismatch minimization problem incorporates delays into the theoretical curvature terms to account for the behav- ioral latency present in the sensorimotor feedback loops. Moreover this approach also provides an estimate of the sensorimotor delay. We should also note that the discreteness of delay values (in (5.3)) arises only because of data availability at a finite sample rate (with sampling interval ∆). Now, before going into the details of analysis, it is worth mentioning the theoretically plausible feedback laws (although the detailed analysis will be discussed later). By letting νi denote the speed of the 156 0 5 10 15 20 25 0.9915 0.992 0.9925 0.993 0.9935 0.994 0.9945 0.995 Number of Nearest Neighbors Av era ge Va lue of Di rec tion Co sin e (a) Flock: 2011 02 08 ACQ3 0 5 10 15 20 25 0.995 0.9955 0.996 0.9965 0.997 0.9975 Number of Nearest Neighbors Av era ge Va lue of Di rec tion Co sin e (b) Flock: 2011 11 24 ACQ1 0 5 10 15 20 25 0.989 0.99 0.991 0.992 0.993 0.994 0.995 0.996 0.997 Number of Nearest Neighbors Av era ge Va lue of Di rec tion Co sin e (c) Flock: 2011 11 25 ACQ1 0 5 10 15 20 25 0.978 0.98 0.982 0.984 0.986 0.988 0.99 Number of Nearest Neighbors Av era ge Va lue of Di rec tion Co sin e (d) Flock: 2011 12 01 ACQ3 0 5 10 15 20 25 0.978 0.979 0.98 0.981 0.982 0.983 0.984 0.985 0.986 Number of Nearest Neighbors Av era ge Va lue of Di rec tion Co sin e (e) Flock: 2011 12 07 ACQ1 0 5 10 15 20 25 0.982 0.983 0.984 0.985 0.986 0.987 0.988 Number of Nearest Neighbors Av era ge Va lue of Di rec tion Co sin e (f) Flock: 2011 12 14 ACQ4 0 5 10 15 20 25 0.9905 0.991 0.9915 0.992 0.9925 0.993 0.9935 0.994 0.9945 0.995 Number of Nearest Neighbors Av era ge Va lue of Di rec tion Co sin e (g) Flock: 2011 12 15 ACQ1 0 5 10 15 20 25 0.9895 0.99 0.9905 0.991 0.9915 0.992 0.9925 0.993 0.9935 0.994 Number of Nearest Neighbors Av era ge Va lue of Di rec tion Co sin e (h) Flock: 2011 12 20 ACQ2 Figure 33: This figure illustrates the variation of flock averaged coherence as a function of the neighborhood size (K), i.e. the number of individuals a focal bird is paying attention to. 157 (a) Flock: 2011 11 24 ACQ1 (b) Flock: 2011 12 01 ACQ3 (c) Flock: 2011 12 20 ACQ2 Figure 34: This figure, through a heat map, illustrates the variation in correlation between the empirically observed curvature of a focal bird and the curvature values predicted by a theoretically plausible feedback mechanism (6.4), as a bivariate function of neighborhood size and delay. 158 i-th individual, the feedback law is given by ui “ µ „xNi ¨ yi νi  vi “ µ „xNi ¨ zi νi  , (6.4) where xNi denotes the normalized velocity vector of the neighborhood center of mass, and yi, zi carry their usual meaning of frame vectors associated with the individual. As discussed earlier (in Section 5.4), the computational complexity involved in solving the mismatch minimization problem (6.3) can be avoided by approximating it with an equivalent correlation maximization problem (as shown via Proposition 5.1). In this alternative paradigm, we compute the correlation be- tween empirical data (natural curvatures uem, vem stacked in a single array) and the theoretically predicted curvature values (uth, vth stacked in a single array), as a function of neighborhood size and (sensorimotor) delay. Then, the neighborhood size and delay which maximizes this correlation provides an estimate for the number of nearest neighbors (an individual is paying attention to) and behavioral latency. Event ID 2011 11 24 ACQ1 2011 12 01 ACQ3 2011 12 20 ACQ2 Max. Correlation .2797 0.4103 0.1278 Delay [ms] 138.8235 141.1765 135.2941 Neighborhood Size 12 40 16 Linear Gain (µest) 2.4462 4.1689 1.33 λ1 1271.1725 57592.5342 3505.8485 λ2 15.2880 462.4669 31.8121 σ1 98.8116 99.2034 99.1008 σ2 1.1884 0.7966 0.8992 Table 6.2: Summary of the statistical analysis of steering control laws for starling flocks. λ1 and λ2 represent the principal component variances, i.e., eigenvalues of the covariance matrix. σ1 and σ2 represent the percentage of total variance explained by the principle components. 159 The variation of correlation as a bivariate function of neighborhood size and delay is shown in Fig 34, and the associated values of relevant parameters (optimal gain, neighborhood size and delay, along with correlation values) are mentioned in Table 6.2. It can be noticed from the three subfigures that, although the correlation value (between theoretical prediction and empirical observation) is itself not very high, there is an unmistakable consistency in the neighborhood size and delay values which maximize the correlation. These three subfigures shows the correlation vari- ation for the minimally maneuvering flocks (Flock ID: 2011 11 24 ACQ1, Flock ID: 2011 12 01 ACQ3, and Flock ID: 2011 12 20 ACQ2), and hence it can concluded that the proposed feedback mechanism (6.4) plays an important role in governing the steering control for flocking behavior 6.3 Discussion In this study of ours, we have analyzed the flight data of European starling flocks, and have provided some insight into the underlying flight strategies and steer- ing control mechanism. Here, the attention graph has been constructed by ranking the neighbors according to their distances from the focal bird and then considering the first K-nearest neighbors. However, recent studies by Bhagavatula et al. [2011] and Kane & Zamani [2014] have shown that optic flow plays an important role in the context of perception in avian flights. Therefore, it seems reasonable to extend the current work by considering attention graphs constructed by ranking the neigh- bors according to the magnitude of optic flow at the focal bird’s eyes caused by 160 their motion. Also, it is worth mentioning here that the feedback law, that we have introduced here, is responsible for aligning the individual velocities. A more general form of the control law (although restricted to planar settings and uniformly moving individuals) with three different components for attraction, repulsion and alignment have been proposed earlier by Justh & Krishnaprasad [2002, 2004]. It would be in- teresting to investigate the applicability of that control law in this context. Another key aspect of this study is that the proposed control law (6.4) carries an wave-like aspect which is necessary to explain a linear growth of information within a flock. 161 Part III Synthesis of Collectives 162 Chapter 7: Flocking through Topological Velocity Alignment (TVA) Now, drawing inspiration from our analysis of starling murmuration events, we consider the problem of synthesizing a collective motion wherein each of the individ- uals (birds in a flock, UAVs in swarm) controls its steering action in such a way that their directions of motion remain parallel. It is worth mentioning that earlier works of Justh & Krishnaprasad [2003, 2004] have considered a very similar form of the proposed control law with three components for attraction (while the agents are far away), repulsion (to avoid collision) and velocity alignment. However, the control law introduced in this current study considers only velocity alignment, but extends the scope by considering multiple agents in a three dimensional environment inter- acting via a state-dependent (nearest neighbors based) attention graph. Moreover, it relaxes the assumption on uniform speed of the collective by allowing the agents non-uniform and time-varying speed profiles. This relaxation plays an important role in the context of applying this control law to a group of heterogeneous agents. This chapter introduces a strategy, named topological velocity alignment (TVA), wherein each agent aligns its velocity along the direction of motion of its neighbor- hood center of mass [Halder & Dey, 2015]. After introducing this strategy and the associated steering feedback law, Section 7.2 and Section 7.3 provide a theoretical 163 analysis of this strategy in two special cases (two-agents, and N -agents interacting in a cyclic way, respectively). Later, in Section 7.4 we propose a discrete-time al- gorithm to implement the TVA strategy on a group of robotic agents. Finally we conclude this chapter by showing some implementation results in Section 7.5. 7.1 Topological Velocity Alignment (TVA) Strategy Here we treat the agents (of the collectives of size N) as self steering particles, and use natural Frenet frame equations (Section 1.3.1) to model their dynamics. Therefore, by letting ri denote the instantaneous position of the i-th agent, its dynamics can be expressed as 9riptq “ νiptqxiptq 9xiptq “ νiptq ` uiptqyiptq ` viptqziptq ˘ 9yiptq “ ´νiptquiptqxiptq 9ziptq “ ´νiptqviptqxiptq (7.1) where xi is the unit tangent vector to its trajectory, and pyi, ziq form an orthonor- mal basis for the plane perpendicular to xi. Moreover the natural curvatures pui, viq are the steering controls, and the speed pνiq is a time function dictated by propul- sive/lift/drag mechanisms. It can also be noted that pxi,yi, ziq form a local or- thonormal frame which evolves along the length of the trajectory. Furthermore, this model also carries a nice geometric interpretation because (7.1) can alterna- tively be viewed as a left invariant control system evolving on the Lie group SEp3q 164 of rigid motion in three dimension. x1 y1 z1 r1 x2 y2 z2 r2 x3 y3 z3 r3 Trajectory # 1 Trajectory # 2 Trajectory # 3 Figure 35: Individual trajectories along with their frame vectors. By assuming the steering control pui, viq of an agent-i (or the focal bird in a flock) to be dependent on the motion of its neighbors, we introduce the notion of topological velocity alignment (TVA), wherein each agent moves parallel to the center of mass of its neighborhood. We also derive the steering control law necessary to achieve this goal. We begin by letting Ni denote the neighborhood of the i-th agent. Then, by assuming identical mass for every agent, the velocity of the neighborhood center of mass (COM) can be expressed as viCOM “ 1 |Ni| ÿ jPNi vj “ 1 |Ni| ÿ jPNi νjxj . (7.2) Moreover, we assume that viCOM does not vanish to zero1. Then, with this assump- 1It should be noted that viCOM becomes zero over a thin set in the underlying state space. As the chance of getting into this thin set is essentially zero, we can overlook this situation for all practical purposes. 165 tion, we can define the direction of the center of mass motion as xNi “ viCOM |viCOM | “ ř jPNi vj ˇˇ ˇˇ ˇ ř jPNi vj ˇˇ ˇˇ ˇ . (7.3) Now, we define the following contrast function associated with the i-th agent Θi “ 1 2 pxNi ´ xiq ¨ pxNi ´ xiq , (7.4) and use it as a quantitative measure of the difference between heading of the i-th agent and direction of the center of mass motion for its neighborhood Ni. If the i-th agent moves in the same direction as the center of mass of its neighborhood Ni, then the contrast function assumes its minimum value, i.e. Θi “ 0. On the other hand, it assumes the maximum value (Θi “ 2) whenever the i-th agent moves in a direction opposite to that of the center of mass motion. And, if the i-th agent moves perpendicular with respect to direction of motion of the center of mass of its neighborhood, then we have Θi “ 1. Fig 36 shows the variation of Θi as a function of the angle between heading of the i-th agent pxiq and the direction of the center of mass motion for its neighborhood pxNiq. As we can observe, Θi increases monotonically with increase in the angle between xi and xNi. Alternatively, it can also be expressed as Θi “ 1´ xi ¨ xNi , (7.5) as both xi and xNi are unit vectors. xi ¨xNi , being a dot product of two unit vectors, 166 essentially represents the cosine of the angle between them, and gets maximized when they are aligned in the same direction. Thus, Θiptq can be interpreted as a quantitative measure of departure from our goal of achieving alignment between heading of the i-th agent (xiptq) and the direction of motion of its neighborhood center of mass (xNiptq). 2 1.5 1 0.5 0 0 ´0.5 ´1 π{4 π{2 3π{4 π Θixi ¨ xNi Angle between xi and xNi Figure 36: Variation of the contrast function (Θi) with change in angle between xi and xNi . Assuming a well-defined xNi , we propose a steering control law of the form uiptq “ µ „xNiptq ¨ yiptq νiptq  viptq “ µ „xNiptq ¨ ziptq νiptq  , (7.6) where µ ą 0 denotes a feedback gain. A physical intuition for the steering control law (7.6) can be obtained by shifting focus to the corresponding feedback law for lateral acceleration. With this particular choice of control laws, the lateral acceleration can 167 be expressed as alati ptq “ νiptq 9xiptq “ µνiptq “ xNiptq ¨ yiptq ‰ yiptq ` µνiptq “ xNiptq ¨ ziptq ‰ ziptq “ µνiptq ´ xNiptq ´ “ xNiptq ¨ xiptq ‰ xiptq ¯ . (7.7) From (7.7) it is quite apparent that the lateral acceleration is proportional to the difference between direction of motion of the center of mass and the component of its own tangent vector along the desired direction. Remark 7.1. Although there has been a long history of control algorithms for flock- ing, almost every model of collective motion (Reynolds [1987]; Vicsek et al. [1995]) predicts diffusive transport of information. But, contrary to the existing models, recent findings by Attanasi et al. [2014] from starling flocks suggest that directional information within a flock propagates with an almost constant speed, and this linear growth of information can be explained by models with wave-like aspects. Our pro- poses strategy, i.e. topological velocity alignment (TVA), conforms to this criterion and can explain how information about local neighbors can influence the agents in a flock to align their headings in a single common direction. 7.2 TVA Strategy for a Planar 2-agent System Before going into the analysis of an N -agent system we consider a very special case for a 2-agent system wherein the motion is restricted onto a two dimensional 168 Cartesian plane. As we are considering a 2-agent system the neighborhood of a particular agent comprises of the other agent, and hence the speed of neighborhood center of mass never vanishes to zero (due to regularity of the model). 7.2.1 State Space and Its Reduction onto Shape Space By exploiting natural Frenet frame equations restricted to a planar setting, the dynamics of the two agent system can be expressed as 9riptq “ νiptqxiptq 9xiptq “ νiptquiptqyiptq 9yiptq “ ´νiptquiptqxiptq i P t1, 2u (7.8) where ri and xi denote the position and normalized velocity of the i-th agent, re- spectively. yi is the unit frame vector normal to xi (uniqueness is guaranteed by defining yi as the orthogonal rotation of xi in the counter-clockwise direction). We also assume r1 ‰ r2 to avoid singularity of the shape variables (to be introduced later). Moreover, a planar equivalent of (7.6) is chosen as the underlying feedback law for steering control. Alternatively, by packing ri,xi,yi inside a matrix gi P SEp2q, the special Euclidean group of rigid motions in a plane, the state space for the 2-agent system (7.8) can be defined as Mstate “ ! g1, g2 P SEp2q ˆ SEp2q ˇˇ ˇg1e3 ‰ g2e3 ) (7.9) 169 where e3 “ r0 0 1sT and gi “ » ——– xi yi ri 0 0 1 fi ffiffifl. In terms of the lie-group formulation the system dynamics can be represented as 9gi “ giξipuiq “ gi ` A1uiνi ` A2νi ˘ (7.10) where A1 “ » ——————– 0 ´1 0 1 0 0 0 0 0 fi ffiffiffiffiffiffifl and A2 “ » ——————– 0 0 1 0 0 0 0 0 0 fi ffiffiffiffiffiffifl are two linearly independent elements of sep2q, the Lie algebra of SEp2q. Moreover A1 and A2 can generate the lie-algebra under bracketing. As we are interested in steering laws which leave our system dynamics invariant under rigid motion, we can formulate a reduction to the shape space, a quotient manifold Mstate{SEp2q of relative positions and velocities of the agents. By defining g P SEp2q as g “ g´11 g2 “ » ——————– x1 ¨ x2 x1 ¨ y2 x1 ¨ r y1 ¨ x2 y1 ¨ y2 y1 ¨ r 0 0 1 fi ffiffiffiffiffiffifl , (7.11) the shape space for the planar two-agent system can be defined as Mshape “ Mstate{SEp2q “ ! g P SEp2q ˇˇ ˇg213 ` g223 ‰ 0 ) , (7.12) where r fi r2 ´ r1 denotes the baseline vector. Moreover, g assumes a left-invariant 170 dynamics on SEp2q as 9g “ gξ (7.13) where ξ “ ξ2pu2q ´ g´1ξ1pu1qg P sep2q, and the proposed control law (7.6) depends only on the shape variable g as ui “ µ „ gi¯i νi  , i, i¯ P t1, 2u, i ‰ i¯. (7.14) Therefore it can be concluded that the reduced dynamics (7.13) evolves on the shape space Mshape [Justh & Krishnaprasad, 2004]. r “ r2 ´ r1 y1 x1 r1 y2 x2 r2 θ1 θ2 ψ φ ϑ Figure 37: Illustration of scalar shape variables (ρ, ψ, φ) used to parametrize the shape space Mshape. 7.2.2 Shape Dynamics Now we introduce some geometrically meaningful scalar variables to parametrize the shape space. By identifying punctured R2 with the punctured complex plane, we define r “ r2 ´ r1 “ ρeiϑ. (7.15) 171 Moreover the unit vectors x1 and x2 are represented as x1 “ eiθ1, x2 “ eiθ2. These scalar shape variables are illustrated in Fig 37. Now we introduce ψ and φ to represent the relative orientation of the velocity vectors. ψ “ π ´ ϑ ` θ1 represents the relative orientation of x1 with respect to the baseline vector r, and φ “ θ1´θ2 represent the mismatch in velocity direction. From (7.11) one can notice that g P Mshape can be represented in terms of the scalar shape variables as g “ » ——————– cos φ sinφ ´ρ cosψ ´ sinφ cosφ ρ sinψ 0 0 1 fi ffiffiffiffiffiffifl . (7.16) Differentiating both sides, (7.15) yields 9ρ cosϑ´ ρ 9ϑ sin ϑ` i ` 9ρ sinϑ` ρ 9ϑ cos ϑ ˘ “ 9r “ ν2x2 ´ ν1x1 “ ν2 ` cos θ2 ` i sin θ2 ˘ ´ ν1 ` cos θ1 ` i sin θ1 ˘ , (7.17) 172 and then by equating the real and imaginary parts of (7.17) we have 9ρ cosϑ´ ρ 9ϑ sin ϑ “ ν2 cos θ2 ´ ν1 cos θ1 (7.18) 9ρ sin ϑ` ρ 9ϑ cosϑ “ ν2 sin θ2 ´ ν1 sin θ1. (7.19) Solving (7.18) and (7.19) we obtain 9ρ “ ν2 cospϑ´ θ2q ´ ν1 cospϑ´ θ1q “ ν1 cosψ ´ ν2 cospψ ´ φq, (7.20) and ρ 9ϑ “ ν2 sinpθ2 ´ ϑq ´ nu1 sinpθ1 ´ ϑq “ ν1 sinψ ´ ν2 sinpψ ´ φq. (7.21) On the other hand, yk is obtained by a 90˝ rotation of xk in the counter clockwise direction, i.e. yk “ ei π 2 xk. Therefore by using the fact that 9xk “ ieiθk 9θk “ eipθk`π2 q 9θk, the dynamics for the scalar variables θ1 and θ2 can be represented as 9θ1 “ ν1u1 9θ2 “ ν2u2, (7.22) 173 and hence the associated shape dynamics on Mshape are given by 9ρ “ ν1 cosψ ´ ν2 cospψ ´ φq 9ψ “ ν1u1 ´ 1 ρ “ ν1 sinψ ´ ν2 sinpψ ´ φq ‰ (7.23) 9φ “ ν1u1 ´ ν2u2. 7.2.3 Analysis of TVA Feedback Law Here we consider a particular context of the two-agent planar system wherein each agent employs the strategy for topological velocity alignment (TVA), i.e. each agent keeps moving in the same direction as the other. In terms of the original state variables the contrast functions take the form Θi “ 1 2 pxi¯ ´ xiq ¨ pxi¯ ´ xiq , i P t1, 2u (7.24) and the i-th agent is declared to attain the TVA strategy if Θi “ 0. From (7.24) one can notice equality of the contrast functions for both agents, and hence we define a common contrast function Θ “ Θ1 “ Θ2. Noting x1 ¨ x2 “ cosφ, the common contrast function can be represented in terms of scalar shape variables as Θ “ 12 ` x2 ´ x1 ˘ ¨ ` x2 ´ x1 ˘ “ 1´ x1 ¨ x2 “ 1´ cosφ, (7.25) 174 and hence we have Θ “ 0 ô φ “ 0. (7.26) Therefore for a two-agent planar system wherein each agent employs the strat- egy for topological velocity alignment (TVA), we define the 2-dimensional topolog- ical velocity alignment manifold MTV A Ă Mshape as MTV A “ ! ρ, ψ, φ P Mshape ˇˇ ˇφ “ 0 ) . (7.27) A steering control law designed to attain the TVA strategy has been proposed (7.6) in earlier sections of this chapter. Moreover from (7.14) one can observe that this feedback law can be expressed in terms of shape variables, taking the form u1 “ ´ ˆ µ ν1 ˙ sinφ u2 “ ˆ µ ν2 ˙ sinφ. (7.28) From (7.26) we can observe that once the TVA strategy has been attained, i.e. Θ “ 0, the steering control becomes identically zero, and as a consequence the mismatch in velocity direction remains identically zero (7.23). Now we will formally introduce the notion of invariance. Definition 7.1 (Invariant Manifold). A manifold M is said to be invariant under the flow of a vector field X on M if for any m P M, Ftpmq P M for small t ą 0, where Ftp¨q is the flow of X. One can show that this condition is equivalent to X being tangent to the manifold to M. 175 ry1 x1 r1 y2 x2 r2 ψ ψ Figure 38: Illustration of topological velocity alignment (TVA) strategy for a 2-agent system. If both agents employ a steering control of the form (7.28), the closed loop dynamics for a two-agent planar system can be represented as 9ρ “ ν1 cosψ ´ ν2 cospψ ´ φq 9ψ “ ´µ sinφ´ 1ρ “ ν1 sinψ ´ ν2 sinpψ ´ φq ‰ (7.29) 9φ “ ´2µ sinφ. We should note that prohibition on collocation, i.e. ρ ą 0, is not enforced by these dynamics. Proposition 7.1. The topological velocity alignment manifold MTV A Ă Mshape is invariant under the closed loop shape dynamics (7.29). Moreover if γptq P Mshape is a trajectory of (7.29) which does not have a finite escape time, and Θp0q ‰ 2, then Θptq Ñ 0 as tÑ 8, (7.30) i.e. γptq converges asymptotically to MTV A. 176 Proof. From (7.25) and (7.29) we have 9Θ “ 9φ sinφ “ ´2µ sin2 φ “ ´2µΘ ` 2´Θ ˘ , (7.31) and hence MFL Ă Mshape is an invariant manifold under the shape dynamics. In fact, from (7.31) it can be concluded that Θp0q “ 2 ñ Θptq “ 2 @t ě 0. By assuming Θp0q ‰ 0, 2, we have Θptq “ 2e ´4µt K ` e´4µt where the constant K is defined as K “ 2Θp0q ´ 1. Since e´4µt Ñ 0 as t Ñ 8, we have Θptq Ñ 0 as tÑ 8. We can formulate the restricted dynamics on the flocking manifold MTV A by substituting φ “ 0 into (7.29) to obtain 9ρ “ ` ν1 ´ ν2 ˘ cosψ 9ψ “ ´1ρ ` ν1 ´ ν2 ˘ sinψ. (7.32) Now we define f “ ν1 ´ ν2. By assuming f to be non-zero and differentiable 177 (7.32) can be alternatively represented as :ρ “ 9f cosψ ´ f 9ψ sinψ “ 9f cosψ ` 1ρf 2 sin2 ψ “ ˜ 9f f ¸ 9ρ` 1ρ ` f 2 ´ 9ρ2 ˘ . (7.33) Remark 7.2. If f is a non-zero constant then we can show that a Lagrangian function LTV A “ 1 2ρ 2 ` 9ρ2 ` f 2 ˘ has (7.33) as its Euler-Lagrange equation. Hence it can be interpreted as a spring- mass system with a negative spring constant. By assuming ν1´ν2 ą 0 we define, τ “ tş 0 ` ν1pσq´ν2pσq ˘ dσ to introduce a non- uniform time-scaling. As a result the restricted dynamics (7.32) can alternatively be represented as dρ dτ “ cosψ dψ dτ “ ´ 1 ρ sinψ. (7.34) Fig 39 shows the phase portrait of the restricted dynamics with a non-uniform time scaling. From this figure one can notice that the region {ρ ą 0, π ą ψ ą 0} (or similarly {ρ ą 0, 0 ą ψ ą ´π}) is closed under the restricted dynamics (7.34), i.e. no trajectory can enter or leave the region. One can notice that the trajectories of (7.32) and (7.34) are essentially the same on the phase plane, they differ only on the speed of system evolution along any particular trajectory. Hence it can be 178 concluded that the trajectories of (7.32) are also closed within {ρ ą 0, π ą ψ ą 0} (or similarly within {ρ ą 0, 0 ą ψ ą ´π}). 0 1 2 3 4 5 6 7 8 9 10 −3 −2 −1 0 1 2 3 ρ ψ Figure 39: Phase portraits for the restricted dynamics (7.34). Alternatively, by assuming ν1´ν2 ‰ 0, the evolution of a phase plane trajectory can be represented as dρ dψ “ ´ ρ cosψ sinψ , (7.35) and through integration with appropriate initial condition (7.35) yields ρptq sinψptq “ ρpt0q sinψpt0q. (7.36) From (7.36) one can notice that the phase plane trajectories are level sets of “ρ sinψ” and hence it is clear that the region {ρ ą 0, π ą ψ ą 0} (or similarly {ρ ą 0, 0 ą ψ ą ´π}) is closed under the restricted dynamics (7.32). 179 7.2.4 Extension to a Three Dimensional Setting The analysis of topological velocity alignment for a 2-agent system has a nat- ural extension from planar to a three-dimensional setting, with the underlying state space being Mstate “ SEp3q ˆ SEp3q. (7.37) For a 2-agent system, the neighborhood of both the agents contains only the other one (N1 “ t2u and N2 “ t1u), and as a consequence we have Θ1 ” Θ2, because Θ1ptq “ 1 2 pxN1ptq ´ x1ptqq ¨ pxN1ptq ´ x1ptqq “ 12 px2ptq ´ x1ptqq ¨ px2ptq ´ x1ptqq (7.38) and, Θ2ptq “ 1 2 pxN2ptq ´ x2ptqq ¨ pxN2ptq ´ x2ptqq “ 12 px1ptq ´ x2ptqq ¨ px1ptq ´ x2ptqq . (7.39) By choosing the steering the control law as the one prescribed in (7.6), we have 9Θ1 “ px2 ´ x1q ¨ p 9x2 ´ 9x1q “ ´ν2 pu2y2 ¨ x1 ` v2z2 ¨ x1q ´ ν1 pu1y1 ¨ x2 ` v1z1 ¨ x2q “ ´µ ` py2 ¨ x1q2 ` pz2 ¨ x1q2 ˘ ´ µ ` py1 ¨ x2q2 ` pz1 ¨ x2q2 ˘ “ ´µ ` 1´ px1 ¨ x2q2 ˘ ´ µ ` 1´ px2 ¨ x1q2 ˘ “ ´2µΘ1p1´Θ1q, (7.40) 180 and similarly the dynamics of Θ2 is given by 9Θ2 “ ´2µΘ2p1´Θ2q. (7.41) From (7.40) and (7.41) it becomes obvious that 9Θi ă 0 whenever Θi P p0, 2q, i “ 1, 2. For this flock of 2-agents, wherein each agent employs the TVA strategy, we define the p2 ˚ 6´ 1)-dimensional TVA manifold MTV A Ă Mstate as MTV A “ tr1, rx1,y1, z1s , r2, rx2,y2, z2s P Mstate|Θ1 ” Θ2 “ 0u “ tr1, rx1,y1, z1s , r2, rx2,y2, z2s P Mstate|x1 “ x2u. (7.42) Then, through a way similar to Proposition 7.1, it can be concluded that Θiptq Ñ 0 as tÑ 8 whenever Θip0q ‰ 2, for i “ 1, 2. Or in other words, almost any trajectory in Mstate converges to MTV A asymptotically. 7.3 TVA Strategy for an N -agent System with Cyclic Interaction Now we intend to consider the particular context of N -agent cyclic interaction (illustrated in Fig 40) systems in which each agent employs the topological veloc- ity alignment (TVA) strategy. In this setup agent i interacts with agent pi ` 1q mod N , or in other words the neighborhood of agent-i (Ni) is a singleton set. As a consequence the neighborhood center of mass velocity never ceases to zero (due to regularity of individual trajectories), and each agent aligns its velocity along the velocity of the next agent. 181 12 3 4 5 N Figure 40: Illustration of an N -agent cyclic interaction system. The direction of influence is conveyed through the direction of arrow-heads. 7.3.1 State Space and Its Reduction onto Shape Space In an approach similar to the one in Section 7.2.1, we assume our agents to be unit-mass particles tracing out twice continuously-differentiable curves in R2, and model our dynamics using the natural-Frenet frame equations. Therefore our N -agent system can be thought of as evolving on the product space of N copies of the Lie group SEp2q. As we are interested in implementing topological velocity alignment (TVA) strategy under a cyclic interaction framework, it is necessary to define the neighbor for agent N . This is done through introduction of an additional element gN`1 P SEp2q to our system state and imposing the closure constraint gN`1 “ g1. Therefore the state space for our N -agent system can be defined as Mstate “ ! g1, g2, . . . , gN`1 P SEp2q ˆ SEp2q ˆ ¨ ¨ ¨ ˆ SEp2ql jh n pN ` 1q-copies ˇˇ ˇ gN`1 “ g1; gie3 ‰ gi`1e3, i “ 1, 2, . . . , N ) , (7.43) 182 where e3 “ r0 0 1sT and gi “ » ——– xi yi ri 0 0 1 fi ffiffifl. In this sense, one can think of our system as a G-snake which bites its tail [Krishnaprasad & Tsakiris, 1994]. As we are interested in steering laws (7.6) which leave our system dynamics invariant under rigid motion, we can formulate a reduction to the shape space by defining g˜i P SEp2q as g˜i “ g´1i gi`1 “ » ——————– xi ¨ xi`1 xi ¨ yi`1 xi ¨ pri`1 ´ riq yi ¨ xi`1 yi ¨ yi`1 yi ¨ pri`1 ´ riq 0 0 1 fi ffiffiffiffiffiffifl , (7.44) and the closure constraint “gN`1 “ g1” can be expressed in the shape space repre- sentation as Nź i“1 g˜i fi g˜1g˜2 . . . g˜N “ 1. (7.45) Therefore the shape space (of relative positions and velocities of the agents) for our N -agent system can be defined as Mshape “ Mstate{SEp2q “ ! g˜1, g˜2, . . . , g˜N P SEp2q ˆ SEp2q ˆ ¨ ¨ ¨ ˆ SEp2ql jh n N-copies ˇˇ ˇ Nź i“1 g˜i “ 1; pg˜iq213 ` pg˜iq223 ‰ 0, i “ 1, 2, . . . , N ) . (7.46) It has been shown by Justh & Krishnaprasad [2004] that the shape variable g˜i 183 assumes a left-invariant dynamics on SEp2q as 9˜gi “ g˜iξ˜i (7.47) where ξ˜i “ ξi`1pui`1q ´ g˜´1i ξipuiqg˜i P sep2q, and the proposed control law (7.6) depends only on the shape variable g˜i as ui “ µ „pg˜iq21 νi  . (7.48) The following result from the work of Galloway [2011] allows us to analyze the shape space dynamics (7.47) as a system of unconstrained dynamics on the product space of N copies of the Lie group SEp2q with the closure constraint (7.45) viewed as a constraint on the initial conditions. Proposition 7.2 (Proposition 2.2.1, Galloway [2011]). The constraint śN i“1 g˜i “ 1 is preserved by the shape dynamics (7.47). 7.3.2 Shape Dynamics Similar to the analysis for a two-agent system (Section 7.2.2), we introduce geometrically meaningful scalar variables by identifying punctured R2 with the punc- tured complex plane. First, we define ri`1 ´ ri “ ρieiϑi and xi “ eiθi to parametrize the shape space. Now one can notice that g˜i P Mshape can be represented in terms 184 of the scalar shape variables as g˜i “ » ——————– cosφi sinφi ´ρi cosψi ´ sinφi cosφi ρi sinψi 0 0 1 fi ffiffiffiffiffiffifl , (7.49) where φi “ θi ´ θi`1 and ψi “ π ´ ϑi ` θi (illustrated in Fig 41). ρi−1 = |ri − ri−1| xi φi φi−1 ψi φi ψi+1 xi+1 xi−1 ri−1 ri ψi−1ri+1 φi−1 ρi = |ri+1 − ri| Figure 41: Illustration of scalar shape variables (ρ, ψ, φ) used to parametrize the shape space Mshape. Proposition 7.3 (in a spirit similar to Proposition 2.2.3, Galloway [2011]). Using shape variables (ρi, ψi, φi) the constraint equation (7.45) can be represented as R ´ Nÿ i“1 φi ¯ “ 1 (7.50) Nÿ i“1 ρiR ´ ψi ` i´1ÿ j“1 φj ¯ “ 0, (7.51) where Rp¨q is a 2ˆ 2 rotation matrix. 185 Proof. The closure constraint (7.45) can alternatively be represented as g˜N g˜1g˜2 . . . g˜N´1 “ 1. (7.52) By defining R ` α ˘ “ » ——– cosα ´ sinα sinα cosα fi ffiffifl , α P r0, 2πq we can represent g˜i P Mshape as g˜i “ » ——– R ` ´ φi ˘ ρiR ` π ´ ψi ˘ e1 0 1 fi ffiffifl . Therefore by letting Bi “ R ` ´ φi ˘ and qi “ ρiR ` π ´ ψi ˘ e1, we have g˜N N´1ź i“1 g˜i “ » ——– BN qN 0 1 fi ffiffifl » ——– śN´1 i“1 Bi q1 ` řN´2 i“1 ´śi j“1Bj ¯ qi`1 0 1 fi ffiffifl “ » ——– BN śN´1 i“1 Bi qN `BNq1 `BN řN´2 i“1 ´śi j“1Bj ¯ qi`1 0 1 fi ffiffifl . (7.53) 186 Noting that BN N´2ÿ i“1 ´ iź j“1 Bj ¯ qi`1 “ R ` ´ φN ˘N´2ÿ i“1 ´ iź j“1 R ` ´ φj ˘¯ ρi`1R ` π ´ ψi`1 ˘ e1 “ N´2ÿ i“1 ρi`1R ` ´ φN ˘ R ` π ´ ψi`1 ´ iÿ j“1 φj ˘ e1 “ N´2ÿ i“1 ρi`1R ` ϑi`1 ´ θi`1 ´ pθ1 ´ θi`1q ˘ R ` ´ φN ˘ e1 “ N´1ÿ i“2 ρiR ` ϑi ´ θ1 ˘ R ` ´ φN ˘ e1 and BNq1 “ R ` ´ φN ˘ ρ1R ` π ´ ψ1 ˘ e1 “ ρ1R ` ϑ1 ´ θ1 ˘ R ` ´ φN ˘ e1, we have qN `BNq1 `BN N´2ÿ i“1 ´ iź j“1 Bj ¯ qi`1 “ ρNR ` π ´ ψN ˘ e1 ` ρ1R ` ϑ1 ´ θ1 ˘ R ` ´ φN ˘ e1 ` N´1ÿ i“2 ρiR ` ϑi ´ θ1 ˘ R ` ´ φN ˘ e1 “ ρNR ` ϑN ´ θ1 ´ φN ˘ e1 ` N´1ÿ i“1 ρiR ` ϑi ´ θ1 ˘ R ` ´ φN ˘ e1 “ Nÿ i“1 ” ρiR ` π ´ ψi ` θi ´ θ1 ˘ı R ` ´ φN ˘ e1 “ ´ Nÿ i“1 ” ρiRT ` ψi ` i´1ÿ j“1 φj ˘ı R ` ´ φN ˘ e1. (7.54) We also have BN N´1ź i“1 Bi “ R ` ´ φN ˘N´1ź i“1 R ` ´ φi ˘ “ R ` ´ Nÿ i“1 φi ˘ “ RT ` Nÿ i“1 φi ˘ . (7.55) 187 Using (7.54) and (7.55), (7.53) can be simplified into » ——– RT `řN i“1 φi ˘ ´řNi“1 ” ρiRT ` ψi ` ři´1 j“1 φj ˘ı R ` ´ φN ˘ e1 0 1 fi ffiffifl , and the closure constraint (7.45) can alternatively be represented as R ` Nÿ i“1 φi ˘ “ 1 (7.56) Nÿ i“1 ” ρiRT ` ψi ` i´1ÿ j“1 φj ˘ı R ` ´ φN ˘ e1 “ 0. (7.57) Now we recall the fact that a linear combination of SOp2q matrices is singular if and only if it is a zero matrix. By using this fact one can conclude from that Nÿ i“1 ρiR ` ψi ` i´1ÿ j“1 φj ˘ “ 0, (7.58) as R ` ´ φN ˘ e1 ‰ 0. Now we adopt an approach similar to the one in Section 7.2.2, and derive the dynamics of the scalar shape variables as 9ρi “ νi cosψi ´ νi`1 cospψi ´ φiq 9ψi “ νiui ´ 1 ρi “ νi sinψi ´ νi`1 sinpψi ´ φiq ‰ i P t1, 2, ¨ ¨ ¨ , Nu (7.59) 9φi “ νiui ´ νi`1ui`1. 188 7.3.3 Analysis of TVA Feedback Law In this particular context of an N -agent planar, cyclic interaction system, individual contrast functions take the form Θi “ 1 2 pxi`1ptq ´ xiq ¨ pxi`1 ´ xiq “ 1´ xi ¨ xi`1 “ 1´ cosφi, (7.60) and the i-th agent is considered to attain the TVA strategy if Θi “ 0. From (7.60) one can notice that Θi P r0, 2s and, Θi “ 0 ô φi “ 0. (7.61) Therefore for this N -agent planar system wherein each agent employs the strat- egy for topological velocity alignment (TVA), we define the p2N ´ 3q-dimensional topological velocity alignment manifold MTV A Ă Mshape as MTV A “ ! ρ1, ψ1, φ1, . . . , ρN , ψN , φN P Mshape ˇˇ ˇΘi “ 0, i P t1, 2, ¨ ¨ ¨ , Nu ) . (7.62) Now we introduce an alternative (holistic) contrast function defined as Θtotal “ Nÿ i“0 Θi “ Nÿ i“0 ` 1´ cosφi ˘ . (7.63) 189 Using the fact given by (7.61), it can be concluded that Θtotal “ 0 if and only if individual contrast functions are equal to zero. Therefore we can represent the TVA manifold (MTV A) in terms of the holistic contrast function as MTV A “ ! ρ1, ψ1, φ1, . . . , ρN , ψN , φN P Mshape ˇˇ ˇΘtotal “ 0 ) . (7.64) Now we focus on a particular steering control law, a planar equivalent of the one given by (7.6), to analyze its effectiveness in attaining the TVA strategy. Moreover from (7.48) we can notice that the feedback law can be expressed in terms of shape variables as ui “ ´ ˆ µ νi ˙ sinφi, i P t1, 2, ¨ ¨ ¨ , Nu. (7.65) From (7.61) we can observe that once the TVA strategy has been attained, i.e. Θtotal “ 0, the steering control becomes identically zero, and as a consequence the mismatch in velocity direction remains identically zero (7.59). If each agent employs a steering feedback of the form (7.65), the closed loop dynamics can be expressed as 9ρi “ νi cosψi ´ νi`1 cospψi ´ φiq 9ψi “ ´µ sinφi ´ 1 ρi “ νi sinψi ´ νi`1 sinpψi ´ φiq ‰ i P t1, 2, ¨ ¨ ¨ , Nu (7.66) 9φi “ µ ` sinφi`1 ´ sin φi ˘ . 190 Proposition 7.4. The topological velocity alignment manifold MTV A Ă Mshape is invariant under the closed loop shape dynamics (7.66). Proof. From (7.63) and (7.66) we have 9Θtotal “ µ Nÿ i“0 sinφi ` sin φi`1 ´ sinφi ˘ “ ´µ2 Nÿ i“0 ` sin2 φi ´ 2 sinφi sinφi`1 ` sin2 φi`1 ˘ “ ´µ2 Nÿ i“0 ` sinφi ´ sin φi`1 ˘2. (7.67) Therefore it can be concluded that MTV A is invariant under the shape dynamics because φi “ 0 @i on MTV A Ă Mshape. In fact, from (7.67) it is clear that 9Θtotal ď 0. Proposition 7.5. Consider the set E defined as E “ ! pφ1, . . . , φNq P S1 ˆ ¨ ¨ ¨ ˆ S1l jh n N-copies ˇˇ ˇ 9Θtotal “ 0, R ` Nÿ i“1 φi ˘ “ 1 ) , (7.68) and assume N not to be a multiple of 4. Then E has a finite cardinality. Proof. From the closure constraint (7.50) we have Nÿ i“1 φi “ 2kπ, k P Z. (7.69) 191 On the other hand, 9Θtotal “ 0 if and only if sinφi “ sinφi`1, i P t1, 2, ¨ ¨ ¨ , Nu, (7.70) and (7.70) holds true if and only if either of the conditions is satisfied φi`1 “ φi, or φi`1 “ π ´ φi. (7.71) Therefore by assuming φ1 “ φ˚, we can construct the following tree wherein each branch correspond to a solution for 9Θtotal “ 0. φ˚ φ˚ φ˚ ... φ˚ÑφN ... φ3 Ñ φ2 Ñ φ1 Ñ π ´ φ˚ ... π ´ φ˚ ... ... π ´ φ˚ φ˚ ... ... π ´ φ˚ ... ... φ˚ π ´ φ˚ Now we assume that along a particular branch of the tree there are M number of φ˚-nodes and pN ´Mq number of pπ ´ φ˚q-nodes. Therefore from (7.69) we have Mφ˚ ` pN ´Mqpπ´ φ˚q “ 2kπ, k P Z, φ˚ P r0, 2πq, M P t1, ¨ ¨ ¨ , Nu. (7.72) 192 Assuming 2M ´N ‰ 0 we solve (7.72) to obtain φ˚ “ ˆ2k `M ´N 2M ´N ˙ π, (7.73) and as φ˚ P r0, 2πq we have, k P $ ’’’’’’& ’’’’’’% „ N ´M 2 , 3M ´N 2 ˙ X Z if, M ą N2 „3M ´N 2 , N ´M 2 ˙ X Z if, M ă N2 . (7.74) Now if N is a odd number then M can never be equal to N2 , and hence for each M P t1, ¨ ¨ ¨ , Nu, we will have finite number choices for φ˚. On the other hand, it can be noted from the tree that a finite number of branches contain M number of φ˚-nodes. Combining these two facts we can conclude that E has finite number of elements. Now we assume N to be a multiple of 2, but not a multiple of 4. In that case the closure condition (7.69) gets violated forM “ N2 because it causes a contradiction in (7.72), and thereby yields no solution for that particular M . For every other value of M , (7.72) yields finite number of φ˚. Therefore, the corresponding E has finite cardinality. However, if N is assumed to be a multiple of 4, then for M “ N2 , (7.72) holds true over a continuum of φ˚. As a consequence E will have uncountably many elements. 193 Remark 7.3. Narrowing our attention to the shape dynamics on MTV A, we can show that the restricted dynamics can be expressed as 9ρi “ pνi ´ νi`1q cosψi 9ψi “ ´ 1 ρi pνi ´ νi`1q sinψi for every i P t1, 2, ¨ ¨ ¨ , Nu. This dynamics is essentially same as the restricted dynamics for a two-agent system (7.32), and hence, by following the discussion in Section 7.2.3, we can show that the phase plane trajectories of the reduced dynamics are level sets of “ρi sinψi”. 7.4 Algorithm for anN -agent System in a Three-Dimensional Setting In this section we focus toward topological velocity alignment in its true sense, and assume that each agent pays attention to its K-nearest neighbors. However, in this context of state-dependent attention graph, the possibility of viCOM becoming zero cannot be ruled out, and we tackle this issue by bringing in an additional neighbor (for the i-th agent) into consideration whenever viCOM becomes zero. As each of the agents has non-zero speed, inclusion of an additional agent into the neighborhood ensures that viCOM no longer remains zero. Moreover, it doesn’t affect connectivity of the underlying attention graph. The following discrete time algorithm provides a methodical way to implement TVA in a multi-agent robotic system. It is worth mentioning here that this algorithmic way towards flocking can 194 Algorithm 2 Topological Velocity Alignment (3D, Nearest Neighbors) Data: Initial Time ´ tinitial; Final Time ´ tfinal; Sampling Interval ´ ∆; Number of Agents ´ N ; Initial Position and Orientation ´ tgiuni“1; Neighborhood Size ´ K begin Initialize: tcurrent ÐÝ tinitial for i = 1 to n do Initialize: State - Xi ÐÝ gi while tcurrent ď tfinal do for i = 1 to n do Define: Ni - the set of K-nearest neighbors Compute: Neighborhood center of mass velocity - viCOM if viCOM “ 0 then Define: Ni - the set of K ` 1-nearest neighbors Compute: Neighborhood center of mass velocity - viCOM Compute: Steering control - ui, vi Implement: Steering Control - tui, viuni“1 Update: State - tXiuni“1 Update: Time - tcurrent ÐÝ tcurrent `∆ easily be modified to implement TVA in a planar setting, and this is done by con- sidering the natural curvature ui alone (vi is ignored). By restricting (7.6) to a planar setting, ui can be expressed as uiptq “ µ „xNiptq ¨ yiptq νiptq  , (7.75) where all the variables carry their usual meaning. 195 7.5 Implementation on Mobile Robot Testbed In what follows we present implementation results of the TVA control law in a planar setting. Our implementation avoids the singularity issue (i.e. viCOM “ 0) by following Algorithm 2. 7.5.1 Experimental Setup Our experimental test-bed is comprised of Pioneer 3 DX wheeled robots (Fig 42) from Adept MobileRobots [P3-DX]. These compact differential-drive mobile robots are equipped with reversible DC motors, high-resolution motion encoders and 19cm wheels. The onboard computation is done via a 32-bit Renesas SH2-7144 RISC mi- croprocessor, including the P3-SH microcontroller with ARCOS. The sensors on the robot include eight forward-facing ultrasonic (sonar) sensors. ARIA [Aria] provides an interface for controlling and receiving data from the robot, and communication with the robot for sending control commands (forward velocity and turning rate) is done via 802.11-b/g/n networking. The width of the robot is 380 mm and it has a swing radius of 260 mm. Algorithm implementation (i.e, feedback law computation) has been done in C++ using ROS along with ROS-ARIA, as the interfacing robotics middleware. The experiments have been carried out in a laboratory environment equipped with a sub-millimeter accurate Vicon motion capture system [ViCoN]. We use a Dell workstation to run ROS, and this computer is connected to the Vicon server via a dedicated Ethernet connection (Fig 43). 196 Figure 42: Pioneer 3-DX Mobile Robot with Two-wheel Differential and Caster. The Vicon system captures the motion of the robots and sends out the position and heading data to the computer running ROS. The control law program listens to this data, computes the curvature values, and finally transmits the individual turning rates over a Wi-Fi network. All these operations are carried out at a frequency of 25 Hz. As the robot velocity ( 9rki , with k denoting the time index) is directed along the robot heading, xki and yki can be directly computed from the heading data. Then, the curvature variable uki is evaluated from the corresponding control laws (7.75), and the turning rate ωki pi “ 1, 2, . . . , Nq (in degrees/sec) is computed as: ωki “ ˆ180 π ˙ νki uki , (7.76) where νki is the speed of the i-th agent at the k-th time instant. Next we will present our implementation results from three different exper- iments (refer [YouTube-Video] for implementation videos). In these experiments, the sonar sensors on the robots were activated to sense any obstacle in the direction of motion of the robots and if any robot can sense such an obstacle, it will simply 197 1ARIA Robot Operating System (ROS) Pioneer 3-DX Vicon Motion Capture kŒ‹Šˆ›Œ‹Gl›Œ™•Œ› zˆ™Œ‹G~Tm Figure 43: Illustration of the Experimental Setup at Intelligent Servosystems Laboratory, Uni- versity of Maryland, College Park. apply a maximum turning rate (ωsat) to avoid collision. The sonars are programmed to detect an obstacle only in close proximity („ 300 mm) of the robots. In all our experiments ωsat is set at be 50 rad/sec, and the value of the feedback gain µ is cho- sen to be 1 Hz. It should be noted that although the control law allows non-uniform and time-varying forward speed of the robots, here we are presenting sample runs for which the speeds of individual agents are same (60 mm/sec). 7.5.2 Experiment I A system eight agents is considered, and we apply the same TVA law to all of them. The neighborhood size is taken to be three (i.e. K “ 3). The robots are initially placed in arbitrary positions and directions. The footprints of the robots 198 are shown in Fig 44a. The initial and final directions of the robots are shown using arrows and the final positions of the robots are denoted using dots. It can be seen from Fig 44b that the contrast function decays to zero very quickly which indicates perfect velocity alignment within the swarm. −3000 −2000 −1000 0 1000 2000 −2000 −1000 0 1000 2000 x (in mm) y (in m m) (a) Robot Trajectories 0 10 20 30 40 500 0.5 1 1.5 2 2.5 3 3.5 4 4.5 Time (in sec) Θ (t ) (b) TVA Contrast Function Figure 44: Results from Experiment I (8 agents, Flocking). 7.5.3 Experiment II Next we decreased the neighborhood size, and set it at K “ 1, so that each robot ‘communicates’ only with its closest neighbor. We chose the initial positions in such a way that they may form sub-clusters instead of moving as a single swarm. This behavior is called ‘splitting ’ in a swarm. From Fig 45a, we can clearly see that the swarm of eight robots gradually split from each other and form three different clusters. It is to be noted that even if all the agents are not going in the same direction, the contrast function still converges to zero (Fig 45b). This happens because each of the robots are aligned with their nearest neighbors, and hence each 199 of the individual contrast functions (Θiptq) are zero. This experiment may explain the splitting phenomenon observable in nature. −2000 −1000 0 1000 2000 −2500 −2000 −1500 −1000 −500 0 500 1000 x (in mm) y (in m m) (a) Robot Trajectories 0 5 10 15 200 0.2 0.4 0.6 0.8 1 1.2 1.4 Time (in sec) Θ (t) (b) TVA Contrast Function Figure 45: Results from Experiment II (8 agents, Splitting). 7.5.4 Experiment III Lastly, we combined the above two experiments, and conducted an experiment using six robots in a swarm and another robot as a predator. A separate computer was used for manual control of the ‘predator’ robot. At the beginning, neighborhood size is set at K “ 3, such that the ‘communi- cation’ graph among the robots stays connected and they move as an entire swarm in a common direction. When the swarm comes close to the predator, the neigh- borhood size is decreased to one. As we are not using any onboard visual sensing and the sonar sensing is done only in very close region („ 300 mm), the change in neighborhood size is made manually. From Fig 46b, we can see that the change in neighborhood size takes place at around 20 seconds and we can also see a tiny jump 200 in the contrast function value at that time. The predator then slowly approaches to one of the agents in the swarm, which abiding to its collision avoidance rule, turns to avoid the predator. In Fig 46a, the trajectories of the agents are drawn in dashed lines before the occurrence of this event and in solid lines afterwards. The trajectory of the predator robot in not shown in the figure. After creating the initial perturbation, the predator is slowly moved through the swarm causing some subsequent disturbances. These perturbations create a noticeable impact in the swarm. As the attacked agent turns, its neighbor also tries to align itself with that agent and so does its neighbor. This goes on until the communication graph becomes disconnected, and then a split in the swarm is observed (refer [YouTube- Video]) similar to the one in Experiment 2. As we can see in Fig 46a, the swarm is divided in two groups after the attack of the predator. The jumps in the contrast function plot (Fig 46b) symbolize the perturbations caused by the external agent. The contrast function eventually converges to zero after the members are aligned −4000 −2000 0 2000 −4000 −3000 −2000 −1000 0 1000 x (in mm) y (in m m) (a) Robot Trajectories 0 20 40 60 800 2 4 Time (in sec) Θ (t) 0 1 2 3 4 5 N um be r o f n ea re st n ei gh bo rs (b) TVA Contrast Function Figure 46: Results from Experiment III (6 agents, Perturbation). 201 with their neighbors within each subgroup. 202 Chapter 8: Conclusion and Future Works The key focus area of this dissertation has been to demonstrate how compre- hensive knowledge about the underlying mechanism behind pursuit and collective motion in natural settings can be leveraged to synthesize decentralized control al- gorithms for collective motion (to be applied to a group of robotic agents). Along the way, we have also developed appropriate algorithms to extract parameters of motion, namely speed, curvatures, lateral acceleration etc., from a discrete set of observed (perhaps noisy) position data. In the following section, we summarize the key contributions of this disserta- tion and propose some topics for further research along these lines. 8.1 Summary of Contributions and Future Directions of Research 8.1.1 Reconstruction of Collectives As access to the parameters of motion constitutes a necessary step towards uncovering flight strategies and control laws behind collective motion in nature (for- aging bats, starling flocks), in “part I” of this dissertation, we identified the need for appropriate algorithms to reconstruct trajectories from a data-set of observed posi- tions. As this problem of recovering a smoothened signal from noisy observations is 203 an ill-posed one, we introduce regularization to tackle lack of well-posedness. First, to govern the evolution of a trajectory, we introduce generative models (expressed via ODEs) with inputs, states and outputs. Then we impose regularization onto the problem by penalizing appropriate functionals of the control input. Thus we have turned this into a continuous time optimal control problem with intermediate state costs (as shown in Chapter 2). A distinctive feature of this approach lies in the fact that our choice of penalty term has been influenced by findings in bio-mechanics. In Chapter 2, we have tackled this data smoothing problem from a mathemat- ical programming perspective, and have overcome lack of integrability by adopting a numerical approach. The methodologies developed in this chapter has been used later in Chapter 5 to reconstruct flight trajectories for bat foraging events. We have also proposed an ordinary cross validation approach, based on leaving-one- out strategy, to select an optimal amount of regularization, which plays a crucial role in maintaining a proper balance between goodness of fit and smoothness of the trajectory. However, as leaving-one-out requires the reconstruction to be carried out mul- tiple times (same as the data-set size) by dropping out a single observation every time, implementation of ordinary cross validation is quite demanding from a com- putational perspective. It would be interesting to investigate if a computationally efficient alternative can replace this algorithmic approach for optimal amount of regularization. Unbiassed risk estimators (Li [1985]; Solo [1996]) based on Charles Stein’s work [Stein, 1981] on mean estimation for multivariate normal distribution, appears very relevant in our context. 204 In Chapter 3, we have introduced a linear generative model (basically a triple integrator), and imposed regularization by trading total fit error against high values of jerk (i.e. third derivative of position) path integral. Then, by exploiting integra- bility of the generative model and quadratic nature of the cost functional, we have derived a closed form solution. Moreover, we have shown that the reconstructed position, velocity and acceleration can be expressed a linear combination of the observed position data. By choosing appropriate linear generative model, one can easily show that smoothing splines can be posed as a special case in this framework. The trajectory reconstruction algorithm developed in this chapter has later been used in Chapter 6 to reconstruct flight trajectories of starling flocks. Our numerical example in this chapter (Section 3.5) attempted to reconstruct a curve on a sphere from a set of discrete and noisy observations. Although this approach yields a satisfactory performance in terms of enforcing the reconstructed trajectory to lie on the sphere, it would be exciting to construct data smoothing algorithms to reconstruct trajectories which lie on a lower dimensional algebraic manifold in the ambient space. Another potential extension of this work lies in the area of reconstructing periodic curves. In Chapter 4, we have exploited the theory of Pontryagin’s maximum princi- ple to solve data smoothing posed as a continuous time optimal control problem. The proposed results are capable of dealing with data smoothing problems in both Euclidean (Rn) and matrix Lie group (G) settings, and they yield result in a semi- analytic way. Example problem demonstrates that this theory enables us to turn an optimal control problem over an infinite dimensional function space into a two-point 205 boundary value problem, which can be tackled via an appropriate multiple-shooting method [Morrison et al., 1962]. It is worth mentioning here that this regularized inversion problem can also be viewed from the perspective of waypoint tracking. If someone attempts to achieve reduction in some path cost, by sacrificing exactness in its traversal of way-points, that problem can easily be cast in this framework. However, there are some issues which requires attention before we attempt to broaden the scope of this framework. One obvious direction along this line is to consider penalty functionals involving derivatives of control inputs. Although this issue can be addressed by augmenting new states to the system, some care should be taken to set up the associated symplectic framework in a proper way. Another pressing concern lies in the singularity issues of the Hamiltonian. The following data smoothing problem exemplifies this issue in an efficient way. Let us consider the generative model, governed by the natural Frenet frame equations, for evolution of a trajectory in a three-dimensional space. As discussed in Section 1.3.1, we can pack the position vector and the associated frame vectors, inside a 4ˆ 4 matrix gptq defined as gptq “ » ——– xptq yptq zptq rptq 0 0 0 1 fi ffiffifl P SEp3q. 206 Now, by letting X1 “ » ——————————– 0 ´1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 fi ffiffiffiffiffiffiffiffiffiffifl , X2 “ » ——————————– 0 0 1 0 0 0 0 0 ´1 0 0 0 0 0 0 0 fi ffiffiffiffiffiffiffiffiffiffifl , X3 “ » ——————————– 0 0 0 0 0 0 ´1 0 0 1 0 0 0 0 0 0 fi ffiffiffiffiffiffiffiffiffiffifl , X4 “ » ——————————– 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 fi ffiffiffiffiffiffiffiffiffiffifl , X5 “ » ——————————– 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 fi ffiffiffiffiffiffiffiffiffiffifl , X6 “ » ——————————– 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 fi ffiffiffiffiffiffiffiffiffiffifl , denote a basis for the associated Lie algebra sep3q, the underlying generative model can be expressed as the following left-invariant dynamical system on SEp3q, 9g “ gξu “ g ` νpX4 ` uX1 ´ vX2q ˘ (8.1) where u, v are natural curvatures (steering control) and ν is the speed of the trajec- tory. Then, by letting triuNi“0 denote the set of observed positions, and by imposing regularization via trading total fit error against high values of the curvatures and speed path integral, one can formulate the trajectory reconstruction problem as the 207 following optimal control problem Minimize gpt0q,u,v,ν Nÿ i“0 }rptiq ´ ri}2 ` λ tNż t0 ` u2 ` v2 ` ν2 ˘ dt subject to gpt0q P SEp3q, u, v P U , ν P U` 9g “ g ` νpX4 ` uX1 ´ vX2q ˘ “ TeLg ¨ ` νpX4 ` uX1 ´ vX2q ˘ , (8.2) where U(U`) is the space of real(positive) valued functions on rt0, tN s and λ ą 0 acts as a regularization parameter for the inverse problem. By comparing this optimal control problem (8.2) with the one mentioned in the statement of maximum principle (4.45) we have Lpuq “ λpu2 ` v2 ` ν2q fpgptiq, riq “ }Agptiqe4 ´ ri}2 where A “ re1 e2 e3sT and teiu4i“1 denotes a standard basis vector in R4. By following an approach similar to the one adopted for the previous example problems, we define the pre-Hamiltonian as Hpg, p, uq “ xp, TeLg ¨ ξuy ´ Lpuq (8.3) where p P T ˚g SEp3q and TeLg represents the tangent map of the left translation by g on SEp3q. Now we introduce µ P se˚p3q defined as µ “ TeL˚g ¨ p. By letting 208 X5i , i “ 1, ¨ ¨ ¨ , 6 denote a dual basis for se˚p3q, µ can be represented as µ “ 6ÿ i“1 µiX5i . Then, by leveraging the left-invariance of the dynamics (8.1), the pre-hamiltonian can be expressed as Hpg, p, uq “ xTeL˚g ¨ p, ξuy ´ Lpuq “ x 6ÿ i“1 µiX5i , νpX4 ` uX1 ´ vX2qy ´ Lpuq “ νpµ4 ` uµ1 ´ vµ2q ´ λpu2 ` v2 ` ν2q. (8.4) As both ξu and Lpuq are differentiable with respect to the control inputs, the optimal control can be derived by solving BH Bu ˇˇ ˇˇ pu˚,v˚,ν˚q “ ν˚µ1 ´ 2λu˚ “ 0 BH Bv ˇˇ ˇˇ pu˚,v˚,ν˚q “ ´ν˚µ2 ´ 2λv˚ “ 0 (8.5) BH Bν ˇˇ ˇˇ pu˚,v˚,ν˚q “ µ4 ` u˚µ1 ´ v˚µ2 ´ 2λν˚ “ 0. Hence the optimal control inputs can be expressed by ¨ ˚˚ ˚˚ ˚˚ ˝ u˚ v˚ ν˚ ˛ ‹‹‹‹‹‹‚ “ 14λ2 ´ pµ21 ` µ22q ¨ ˚˚ ˚˚ ˚˚ ˝ µ1µ4 ´µ2µ4 2λµ4 ˛ ‹‹‹‹‹‹‚ , (8.6) 209 and by substituting the optimal controls into the pre-hamiltonian, (4.87) yields an SEp2q-invariant reduced hamiltonian, given by h “ λµ 2 4 4λ2 ´ pµ21 ` µ22q . (8.7) Now, we can derive the reduced dynamics on se˚p3q by computing ∇µh and the associated structure constants. However from (8.7) one can notice that the reduced hamiltonian becomes singular whenever µ21 ` µ22 “ 4λ2. With this perspective, it would be interesting to seek answer for such questions as: • Is the submanifold Msing “ tpµ1, ¨ ¨ ¨ , µ6q P R6|µ21`µ22 “ 4λ2u invariant under the reduced dynamics? • Does this submanifold (Msing) attract any trajectory originating outside the submanifold? Under what conditions one can avoid the singularity? 8.1.2 Analysis of Collective Behavior in Nature Following the main flow of this dissertation, we set out to explore the underly- ing mechanism behind pursuit and collective motion in natural settings in “part II” of this dissertation, and performed analysis on the flight trajectory data of echolocat- ing bats (demonstrating pursuit) and European starlings (demonstrating flocking). Our study adopts a two-pronged approach to investigate the underlying flight strate- gies and feedback mechanism for steering control - first we study the statistics of appropriate contrast functions, and then we compare the empirical values of steer- 210 ing control to the values obtained from theoretically plausible feedback laws. This approach is also capable of providing an estimate for the associated sensorimotor delay. In Chapter 5, we have performed flight data analysis for big brown bats (Eptesicus fuscus) in two different foraging contexts. This analysis has shown quantitative evidence in favor of a context-specific switch in flight strategy. Ac- cording to our findings, bats apply constant absolute target direction (CATD), also known as motion camouflage (MC) in the context of visual insects, while chasing a free flying insect (praying mantis in our study). But if the scenario is modified into a competitive setting with another bat foraging for the same stationary food source (meal-worm in this set of experiments), flight data show evidence that the trailing bat resort to classical pursuit (CP) to follow the other bat. Moreover, by comparing empirically observed curvature values with the ones obtained from the- oretically plausible feedback laws, this study sheds light upon the steering control mechanisms and the associated sensorimotor delay. Recent developments by Galloway & Dey [2015] in decentralized control have analyzed cyclic constant bearing (CB) pursuit [Galloway et al., 2013] strategy in a multi-agent system wherein each agent pays attention to a neighbor (moving) and a beacon (fixed). As classical pursuit can be interpreted as a special case of the CB pursuit strategy, it would be worthwhile to study this interaction between the stationary prey (tethered meal-worm) and the flying bats from this perspective (each bat having its own priority level for the stationary food source). It is worth mentioning here that our analysis does not assume any internal model of target 211 motion, and the steering control mechanism is assumed to be based on pure reaction to the target motion. However a recent study by Mischiati et al. [2014] has shown that, internal model and reactive pursuit strategy, both play an important role in generating the prey interception trajectories by dragonflies (P lathemis lydia). So it would be interesting to design appropriate experiments and investigate if such internal models are involved in bat foraging too. Chapter 6 describes our ongoing work on the flight strategy analysis of Eu- ropean starling (Sturnus vulgaris) flocks. This study has revealed that the flock- averaged coherence (the average cosine of the angle between the velocities of a focal bird and its neighborhood center of mass, averaged over the entire flock) gets max- imized by considering 5-7 nearest neighbors. In addition to reconfirming a previous result highlighting the importance of topological notion of distance in starling flocks, this study has also provided some insight about the steering control actions adopted by the individual starlings. However, our current approach for constructing an interaction graph (based on a set of nearest neighbors) is oblivious to sensory perceptions by the focal individual and spatial distribution of the neighbors. Future works will attempt to explore other possibilities for the interaction graph based on visual cues [Strandburg-Peshkin et al., 2013] and statistical causality (Granger causality [Granger, 1969], directed mutual information [Massey, 1990]). 212 8.1.3 Synthesis of Collective Motion Statistical analysis of flight behavior in European starling flocks has revealed that the individuals in a flock tend to fly parallel to each other. This observa- tion led us towards proposing a decentralized algorithm (called topological velocity alignment) to make the individuals move in the same direction without colliding into each other (in Chapter 7), and the global behavior emerges through local interac- tion between neighbors. The fact, that the proposed feedback law does not assume any uniformity in the individual speeds and the attention graph is directed, makes our approach distinct from the existing models of flocking. Moreover, this proposed control strategy has wave-like aspects, conforming to the criterion of linear growth of information observed in starling flocks [Attanasi et al., 2014]. Numerical simulations and implementations have shown that whenever a sub- group of agents in the flock are provided additional instruction (e.g. to follow predefined paths, avoid obstacles, etc.) for steering control, the effect spreads across the whole flock (without any change in the way the uninformed agents interact with its neighbors). These observations demand further analysis, and future work in this area will explore how these covert leaders (agents with extra information) in a collaborative swarm affect the group behavior. This framework can also be exploited to design a collaboration of heterogeneous agents wherein a small group of agents are capable of sensing the environmental cue and others just interact with their neighbors. 213 Bibliography Ahmadzadeh, A., Jadbabaie, A., Kumar, V. & Pappas, G. J. 2006 Multi-UAV Cooperative Surveillance with Spatio-Temporal Specifications. In Proceedings of the 45th IEEE Conference on Decision and Control (CDC), pp. 5293–5298. San Diego, CA. (doi:10.1109/CDC.2006.377157) Allen, D. M. 1974 The Relationship between Variable Selection and Data Agu- mentation and a Method for Prediction. Technometrics, 16(1), 125–127. (doi: 10.2307/1267500) Andriluka, M., Schnitzspan, P., Meyer, J., Kohlbrecher, S., Petersen, K., von Stryk, O., Roth, S. & Schiele, B. 2010 Vision Based Victim Detection from Unmanned Aerial Vehicles. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 1740–1747. Taipei, Taiwan. (doi: 10.1109/IROS.2010.5649223) Aoki, I. 1982 A Simulation Study on the Schooling Mechanism in Fish. Bulletin of the Japanese Society of Scientific Fisheries, 48(8), 1081–1088. (doi:10.2331/ suisan.48.1081) Aria ROS-ARIA Package. http://wiki.ros.org/ROSARIA. Accessed: 2014-09-07. 214 Attanasi, A., Cavagna, A., Castello, L. D., Giardina, I., Grigera, T. S., Jelic, A., Melillo, S., Parisi, L., Pohl, O. et al. 2014 Information Transfer and Be- havioural Inertia in Starling Flocks. Nature Physics, 10(9), 691–696. (doi: 10.1038/nphys3035) Attanasi, A. and Cavagna, A. and Del Castello, L. and Giardina, I. and Jelic, A. and Melillo, S. and Parisi, L. and Shen, E. and Silvestri, E. and Viale, M. 2013 Tracking in Three Dimensions via Multi-path Branching. ArXiv e-prints. Ballerini, M., Cabibbo, N., Candelier, R., Cavagna, A., Cisbani, E., Giardina, I., Lecomte, V., Orlandi, A., Parisi, G. et al. 2008a Interaction Ruling Animal Col- lective Behavior Depends on Topological Rather Than Metric Distance: Evidence from a Field Study. Proceedings of the National Academy of Sciences, 105(4), 1232–1237. (doi:10.1073/pnas.0711437105) Ballerini, M., Cabibbo, N., Candelier, R., Cavagna, A., Cisbani, E., Giardina, I., Orlandi, A., Parisi, G., Procaccini, A. et al. 2008b Empirical Investigation of Starling Flocks: A Benchmark Study in Collective Animal Behaviour. Animal Behaviour, 76(1), 201–215. (doi:10.1016/j.anbehav.2008.02.004) Bazazi, S., Buhl, J., Hale, J. J., Anstey, M. L., Sword, G. A., Simpson, S. J. & Couzin, I. D. 2008 Collective Motion and Cannibalism in Locust Migratory Bands. Current Biology, 18(10), 735–739. (doi:10.1016/j.cub.2008.04.035) Beekman, M., Sumpter, D. J. T. & Ratnieks, F. L. W. 2001 Phase Transition between Disordered and Ordered Foraging in Pharaoh’s Ants. Proceedings of the National Academy of Sciences, 98(17), 9703–9706. (doi:10.1073/pnas.161285298) Ben-Yosef, G. & Ben-Shahar, O. 2012 A Tangent Bundle Theory for Visual Curve Completion. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(7), 1263–1280. (doi:10.1109/TPAMI.2011.262) 215 Bertsekas, D. P. & Tsitsiklis, J. N. 2007 Comments on “Coordination of Groups of Mobile Autonomous Agents Using Nearest Neighbor Rules”. IEEE Transactions on Automatic Control, 52(5), 968–969. (doi:10.1109/TAC.2007.895885) Bethke, B., How, J. P. & Vian, J. 2009 Multi-UAV Persistent Surveillance With Communication Constraints and Health Management. In Proceedings of the AIAA Guidance, Navigation, and Control Conference (GNC). Chicago, IL. (doi:10.2514/ 6.2009-5654) Bhagavatula, P. S., Claudianos, C., Ibbotson, M. R. & Srinivasan, M. V. 2011 Optic Flow Cues Guide Flight in Birds. Current Biology, 21(21), 1794–1799. (doi: 10.1016/j.cub.2011.09.009) Bishop, R. L. 1975 There is More than One Way to Frame a Curve. The American Mathematical Monthly, 82(3), 246–251. (doi:10.2307/2319846) Brockett, R. 1970 Finite Dimensional Linear Systems. New York, NY: Wiley. Brody, D. C., Holm, D. D. & Meier, D. M. 2012 Quantum Splines. Physical Review Letters, 109, 100 501. (doi:10.1103/PhysRevLett.109.100501) Burnett, C. L., Holm, D. D. & Meier, D. M. 2013 Inexact Trajectory Planning and Inverse Problems in the Hamilton-Pontryagin Framework. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 469(2160), 20130 249. (doi:10.1098/rspa.2013.0249) Carere, C., Montanino, S., Moreschini, F., Zoratto, F., Chiarotti, F., Santucci, D. & Alleva, E. 2009 Aerial Flocking Patterns of Wintering Starlings, Sturnus Vulgaris, under Different Predation Risk. Animal Behaviour, 77(1), 101 – 107. (doi:http://dx.doi.org/10.1016/j.anbehav.2008.08.034) 216 Cavagna, A., Cimarelli, A., Giardina, I., Parisi, G., Santagati, R., Stefanini, F. & Viale, M. 2010 Scale-free Correlations in Starling Flocks. Proceedings of the National Academy of Sciences, 107(26), 11 865–11 870. (doi:10.1073/pnas. 1005766107) Cavagna, A., Giardina, I., Orlandi, A., Parisi, G. & Procaccini, A. 2008a The STARFLAG Handbook on Collective Animal Behaviour: 2. Three-dimensional Analysis. Animal Behaviour, 76(1), 237–248. (doi:10.1016/j.anbehav.2008.02.003) Cavagna, A., Giardina, I., Orlandi, A., Parisi, G., Procaccini, A., Viale, M. & Zdrvkovic, V. 2008b The STARFLAG Handbook on Collective Animal Be- haviour: 1. Empirical Methods. Animal Behaviour, 76(1), 217–236. (doi: 10.1016/j.anbehav.2008.02.002) Chiu, C., Reddy, P. V., Xian, W., Krishnaprasad, P. S. & Moss, C. F. 2010 Effects of Competitive Prey Capture on Flight Behavior and Sonar Beam Pattern in Paired Big Brown Bats, Eptesicus Fuscus. Journal of Experimental Biology, 213(19), 3348–3356. (doi:10.1242/jeb.044818) Chiu, C., Xian, W. & Moss, C. F. 2008 Flying in Silence: Echolocating Bats Cease Vocalizing to Avoid Sonar Jamming. Proceedings of the National Academy of Sciences, 105(35), 13 116–13 121. (doi:10.1073/pnas.0804408105) Crouch, P. & Leite, F. S. 1991 Geometry and the Dynamic Interpolation Problem. In Proceedings of the American Control Conference (ACC), pp. 1131–1136. Boston, MA. Crouch, P. & Leite, F. S. 1995 The Dynamic Interpolation Problem: On Riemannian Manifolds, Lie Groups, and Symmetric Spaces. Journal of Dynamical and Control Systems, 1(2), 177–202. (doi:10.1007/BF02254638) 217 Cucker, F. & Smale, S. 2007 Emergent Behavior in Flocks. IEEE Transactions on Automatic Control, 52(5), 852 –862. (doi:10.1109/TAC.2007.895842) Cutts, C. & Speakman, J. 1994 Energy Savings in Formation Flight of Pink-footed Geese. Journal of Experimental Biology, 189(1), 251 – 261. Dey, B. & Krishnaprasad, P. S. 2012 Trajectory Smoothing as a Linear Optimal Control Problem. In Proceedings of the 50th Annual Allerton Conference on Com- munication, Control, and Computing (Allerton), pp. 1490–1497. Monticello, IL. (doi:10.1109/Allerton.2012.6483395) Dey, B. & Krishnaprasad, P. S. 2014a Control-Theoretic Data Smoothing. In Pro- ceedings of 53rd IEEE Conference on Decision and Control (CDC), pp. 5064–5070. Los Angeles, CA. Dey, B. & Krishnaprasad, P. S. 2014b Trajectory Reconstruction via Optimal Con- trol. To be submitted. Dey, B., Reddy, P. V., Chiu, C., Ghose, K., Galloway, K. S., Horiuchi, T. K., Justh, E. W., Moss, C. F. & Krishnaprasad, P. S. 2014 Context Shapes Bat Flight Strategy: evidence from the geometry of prey capture. To be submitted. do Carmo, M. P. 1976 Differential Geometry of Curves and Surfaces. Englewood Cliffs, NJ: Prentice-Hall Inc. Dunbabin, M. & Marques, L. 2012 Robots for Environmental Monitoring: Signif- icant Advancements and Applications. IEEE Robotics Automation Magazine, 19(1), 24–39. (doi:10.1109/MRA.2011.2181683) Egerstedt, M. & Martin, C. 2010 Control Theoretic Splines: Optimal Control, Statis- tics, and Path Planning. Princeton, NJ: Princeton University Press. 218 Elfes, A., Bueno, S. S., Bergerman, M. & Ramos, J. G. 1998 A Semi-Autonomous Robotic Airship for Environmental Monitoring Missions. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), vol. 4, pp. 3449–3455. Leuven, Belgium. (doi:10.1109/ROBOT.1998.680971) Flash, T. & Hogan, N. 1985 The Coordination of Arm Movements: An Experi- mentally Confirmed Mathematical Model. The Journal of Neuroscience, 5(7), 1688–1703. fminunc MATLAB Documentation. http://ter.ps/fminuncdoc. Accessed: 2012- 07-23. Galloway, K. S. 2011 Cyclic Pursuit: Symmetry, Reduction and Nonlinear Dynam- ics. PhD Thesis: University of Maryland, College Park. Galloway, K. S. & Dey, B. 2015 Station Keeping through Beacon-referenced Cyclic Pursuit. Accepted for American Control Conference (ACC 2015). Galloway, K. S., Justh, E. & Krishnaprasad, P. S. 2010 Cyclic Pursuit in Three Dimensions. In Proceedings of the 49th IEEE Conference on Decision and Control (CDC), pp. 7141–7146. Atlanta, GA. (doi:10.1109/CDC.2010.5717459) Galloway, K. S., Justh, E. W. & Krishnaprasad, P. S. 2013 Symmetry and Reduction in Collectives: Cyclic Pursuit Strategies. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 469(2158), 20130 264. (doi: 10.1098/rspa.2013.0264) Gautrais, J., Jost, C., Soria, M., Campo, A., Motsch, S., Fournier, R., Blanco, S. & Theraulaz, G. 2009 Analyzing Fish Movement as a Persistent Turn- ing Walker. Journal of Mathematical Biology, 58(3), 429–445. (doi:10.1007/ s00285-008-0198-7) 219 Ghose, K., Horiuchi, T. K., Krishnaprasad, P. S. & Moss, C. F. 2006 Echolocating Bats Use a Nearly Time-Optimal Strategy to Intercept Prey. PLoS Biology, 4(5), 865–873. (doi:10.1371/journal.pbio.0040108) Ghose, K. & Moss, C. F. 2006 Steering by Hearing: A Bat’s Acoustic Gaze Is Linked to its Flight Motor Output by a Delayed, Adaptive Linear Law. The Journal of Neuroscience, 26(6), 1704–1710. (doi:10.1523/JNEUROSCI.4315-05.2006) Granger, C. W. J. 1969 Investigating Causal Relations by Econometric Models and Cross-spectral Methods. Econometrica, 37(3), 890–893. (doi:10.2307/1912791) Griffin, D. R., Webster, F. A. & Michael, C. R. 1960 The Echolocation of Flying Insects by Bats. Animal Behaviour, 8(3-4), 141–154. (doi:10.1016/0003-3472(60) 90022-1) Halder, U. & Dey, B. 2015 Biomimetic Algorithms for Coordinated Motion: Theory and Implementation. Accepted for International Conference on Robotics and Automation (ICRA 2015). Harmon, S. 1987 The Ground Surveillance Robot (GSR): An Autonomous Vehicle Designed to Transit Unknown Terrain. IEEE Journal of Robotics and Automation, 3(3), 266–279. (doi:10.1109/JRA.1987.1087091) Herskin, J. & Steffensen, J. F. 1998 Energy Savings in Sea Bass Swimming in a School: Measurements of Tail Beat Frequency and Oxygen Consumption at Different Swimming Speeds. Journal of Fish Biology, 53(2), 366 – 376. (doi: http://dx.doi.org/10.1111/j.1095-8649.1998.tb00986.x) Hubel, D. H. 1995 Eye, Brain, and Vision. No. 22 in Scientific American Library Series. New York, NY: W. H. Freeman. 220 Jadbabaie, A., Lin, J. & Morse, S. A. 2003 Coordination of Groups of Mobile Au- tonomous Agents using Nearest Neighbor Rules. IEEE Transactions on Automatic Control, 48(6), 988 – 1001. (doi:10.1109/TAC.2003.812781) Jakubiak, J., Leite, F. S. & Rodrigues, R. C. 2006 A Two-step Algorithm of Smooth Spline Generation on Riemannian Manifolds. Journal of Computational and Ap- plied Mathematics, 194(2), 177 – 191. (doi:http://dx.doi.org/10.1016/j.cam.2005. 07.003) Justh, E. W. & Krishnaprasad, P. S. 2002 A Simple Control Law for UAV Formation Flying. Tech. Rep. TR 2002-38, Institute for Systems Research, University of Maryland, College Park, MD. Justh, E. W. & Krishnaprasad, P. S. 2003 Steering Laws and Continuum Models for Planar Formations. In Proceedings of the 42nd IEEE Conference on Decision and Control (CDC), pp. 3609–3615. Maui, HI. (doi:10.1109/CDC.2003.1271708) Justh, E. W. & Krishnaprasad, P. S. 2004 Equilibria and Steering Laws for Planar Formations. Systems & Control Letters, 52(1), 25–38. (doi:http://dx.doi.org/10. 1016/j.sysconle.2003.10.004) Justh, E. W. & Krishnaprasad, P. S. 2006 Steering Laws for Motion Camouflage. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sci- ences, 462(2076), 3629–3643. (doi:10.1098/rspa.2006.1742) Justh, E. W. & Krishnaprasad, P. S. 2011 Optimal Natural Frames. Communications in Information and Systems, 11(1), 17–34. (doi:10.4310/CIS.2011.v11.n1.a2) Kane, S. A. & Zamani, M. 2014 Falcons Pursue Prey Using Visual Motion Cues: New Perspectives from Animal-borne Cameras. Journal of Experimental Biology, 217(2), 225–234. (doi:10.1242/jeb.092403) 221 Kano, H., Egerstedt, M., Fujioka, H., Takahashi, S. & Martin, C. 2008 Periodic smoothing splines. Automatica, 44(1), 185 – 192. (doi:10.1016/j.automatica. 2007.05.011) Kingston, D., Beard, R. W. & Holt, R. S. 2008 Decentralized Perimeter Surveillance Using a Team of UAVs. IEEE Transactions on Robotics, 24(6), 1394–1404. (doi: 10.1109/TRO.2008.2007935) Krishnaprasad, P. S. 1985 Lie-Poisson Structures, Dual-Spin Spacecraft and Asymp- totic Stability. Nonlinear Analysis: Theory, Methods and Applications, 9(10), 1011–1035. (doi:10.1016/0362-546X(85)90083-5) Krishnaprasad, P. S. 1993 Optimal Control and Poisson Reduction. Tech. Rep. TR 93-87, Institute for Systems Research, University of Maryland, College Park, MD. Krishnaprasad, P. S. & Tsakiris, D. 1994 G-snakes: Nonholonomic Kinematic Chains on Lie Groups. In Proceedings of the 33rd IEEE Conference on Decision and Control (CDC), vol. 3, pp. 2955–2960. Lake Buena Vista, FL. Kudrolli, A., Lumay, G., Volfson, D. & Tsimring, L. S. 2008 Swarming and Swirling in Self-Propelled Polar Granular Rods. Physical Review Letters, 100, 058 001. (doi:10.1103/PhysRevLett.100.058001) Leonard, N. E., Paley, D. A., Davis, R. E., Fratantoni, D. M., Lekien, F. & Zhang, F. 2010 Coordinated Control of an Underwater Glider Fleet in an Adaptive Ocean Sampling Field Experiment in Monterey Bay. Journal of Field Robotics, 27(6), 718–740. (doi:10.1002/rob.20366) Li, K.-C. 1985 From Stein’s Unbiased Risk Estimates to the Method of Generalized Cross Validation. The Annals of Statistics, 13(4), 1352–1377. (doi:10.1214/aos/ 1176349742) 222 Li, Z., Liu, Y., Hayward, R., Zhang, J. & Cai, J. 2008 Knowledge-Based Power Line Detection for UAV Surveillance and Inspection Systems. In Proceedings of the 23rd International Conference on Image and Vision Computing, New Zealand (IVCNZ), pp. 1–6. Lincoln, New Zealand. (doi:10.1109/IVCNZ.2008.4762118) Liberzon, D. 2011 Calculus of Variations and Optimal Control Theory: A Concise Introduction. Princeton, NJ: Princeton University Press. Liu, Y. & Nejat, G. 2013 Robotic Urban Search and Rescue: A Survey from the Control Perspective. Journal of Intelligent & Robotic Systems, 72(2), 147–165. (doi:10.1007/s10846-013-9822-x) Machado, L., Silva Leite, F. & Krakowski, K. 2010 Higher-order Smoothing Splines versus Least Squares Problems on Riemannian Manifolds. Journal of Dynamical and Control Systems, 16(1), 121–148. (doi:10.1007/s10883-010-9080-1) Marques, C., Cristovao, J., Lima, P., Frazao, J., Ribeiro, I. & Ventura, R. 2006 RAPOSA: Semi-Autonomous Robot for Rescue Operations. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 3988–3993. Beijing, China. (doi:10.1109/IROS.2006.281836) Marsden, J. E. & Ratiu, T. S. 2003 Introduction to Mechanics and Symmetry, vol. 17 of Texts in Applied Mathematics. New York, NY: Springer. Massey, J. L. 1990 Causality, Feedback and Directed Information. In Proceedings of the International Symposium of Information Theory and its Application (ISITA- 90), pp. 330–305. Waikiki, HI. McBeath, M. K., Shaffer, D. M. & Kaiser, M. K. 1995 How Baseball Outfielders Determine where to Run to Catch Fly Balls. Science, 268(5210), 569–573. (doi: 10.1126/science.7725104) 223 Miller, N., Garnier, S., Hartnett, A. T. & Couzin, I. D. 2013 Both Information and Social Cohesion Determine Collective Decisions in Animal Groups. Proceedings of the National Academy of Sciences, 110(13), 5263–5268. (doi:10.1073/pnas. 1217513110) Mischiati, M., Lin, H. T., Herold, P., Imler, E., Olberg, R. & Leonardo, A. 2014 Internal Models Direct Dragonfly Interception Steering. Nature. (doi:10.1038/ nature14045) Morrison, D. D., Riley, J. D. & Zancanaro, J. F. 1962 Multiple Shooting Method for Two-point Boundary Value Problems. Communications of the ACM, 5(12), 613–614. (doi:10.1145/355580.369128) Nagy, M., Akos, Z., Biro, D. & Vicsek, T. 2010 Hierarchical Group Dynamics in Pigeon Flocks. Nature, 464(7290), 890–893. (doi:10.1038/nature08891) Olberg, R. M., Worthington, A. H. & Venator, K. R. 2000 Prey Pursuit and Inter- ception in Dragonflies. Journal of Comparative Physiology A, 186(2), 155–162. (doi:10.1007/s003590050015) Olfati-Saber, R. 2006 Flocking for Multi-Agent Dynamic Systems: Algorithms and Theory. IEEE Transactions on Automatic Control, 51(3), 401–420. (doi:10.1109/ TAC.2005.864190) P3-DX Pioneer P3-DX. http://ter.ps/p3dx. Accessed: 2014-09-07. Pinto, E., Santana, P. & Barata, J. 2013 On Collaborative Aerial and Surface Robots for Environmental Monitoring of Water Bodies. In Technological Innovation for the Internet of Things (eds L. Camarinha-Matos, S. Tomic & P. Graca), vol. 394 of IFIP Advances in Information and Communication Technology, pp. 183–191. Springer Berlin Heidelberg. (doi:10.1007/978-3-642-37291-9 20) 224 Pontryagin, L. S., Boltyanskii, V. G., Gamkrelidze, R. V. & Mishchenko, E. F. 1962 The Mathematical Theory of Optimal Processes. Interscience Publishers, 1st edn. Quigley, M., Goodrich, M. A., Griffiths, S., Eldredge, A. & Beard, R. W. 2005 Target Acquisition, Localization, and Surveillance Using a Fixed-Wing Mini-UAV and Gimbaled Camera. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), pp. 2600–2605. Barcelona, Spain. (doi: 10.1109/ROBOT.2005.1570505) Reddy, P. V. 2007 Steering Laws for Pursuit. Master’s Thesis: University of Mary- land, College Park. Reddy, P. V., Justh, E. W. & Krishnaprasad, P. S. 2006 Motion Camouflage in Three Dimensions. In Proceedings of 45th IEEE Conference on Decision and Control (CDC), pp. 3327–3332. San Diego, CA. (doi:10.1109/CDC.2006.377777) Reddy, P. V., Justh, E. W. & Krishnaprasad, P. S. 2007 Motion camouflage with sensorimotor delay. In Proceedings of the 46th IEEE Conference on Decision and Control (CDC), pp. 1660 –1665. New Orleans, LA. (doi:10.1109/CDC.2007. 4434522) Ren, W. 2008 On Consensus Algorithms for Double-Integrator Dynamics. IEEE Transactions on Automatic Control, 53(6), 1503–1509. (doi:10.1109/TAC.2008. 924961) Ren, W. & Atkins, E. 2005 Second-order Consensus Protocols in Multiple Ve- hicle Systems with Local Interactions. In Proceedings of the AIAA Guid- ance, Navigation, and Control Conference (GNC). San Francisco, CA. (doi: 10.2514/6.2005-6238) Reynolds, C. W. 1987 Flocks, herds and schools: A distributed behavioral model. Computer Graphics, 21(4), 25–34. (doi:10.1145/37402.37406) 225 Roberts, L., Bruck, H. & Gupta, S. K. 2014 Autonomous Loitering Control for a Flapping Wing Miniature Aerial Vehicle with Independent Wing Control. In Proceedings of the ASME Mechanism and Robotics Conference. ROS Robot Operating System (ROS). http://www.ros.org. Accessed: 2014-09-07. Savitzky, A. & Golay, M. J. E. 1964 Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Analytical Chemistry, 36(8), 1627–1639. (doi:10.1021/ac60214a047) Schafer, R. W. 2011 What Is a Savitzky-Golay Filter? [Lecture Notes]. IEEE Signal Processing Magazine, 28(4), 111–117. (doi:10.1109/MSP.2011.941097) Sfakiotakis, M., Kazakidi, A., Chatzidaki, A., Evdaimon, T. & Tsakiris, D. P. 2014 Multi-arm Robotic Swimming with Octopus-Inspired Compliant Web. In Proceed- ings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). Shaikh, S. M. & Caines, P. E. 2007 On the Hybrid Optimal Control Problem: Theory and Algorithms. IEEE Transactions on Automatic Control, 52(9), 1587–1603. (doi:10.1109/TAC.2007.904451) Shan, S., Egerstedt, M. & Martin, C. 2000 Control Theoretic Smoothing Splines. IEEE Transactions on Automatic Control, 45(12), 2271–2279. (doi:10.1109/9. 895563) Silverman, L. M. & Meadows, H. E. 1967 Controllability and Observability in Time- Variable Linear Systems. SIAM Journal on Control and Optimization, 5(1), 64– 73. (doi:10.1137/0305005) Simmons, J. A., Fenton, M. B. & O’Farrell, M. J. 1979 Echolocation and Pursuit of Prey by Bats. Science, 203(4375), 16–21. (doi:10.1126/science.758674) 226 Solo, V. 1996 A SURE-Fired Way to Choose Smoothing Parameters in Ill- Conditioned Inverse Problems. In Proceedings of the IEEE International Con- ference on Image Processing (ICIP), vol. 3, pp. 89–92. Lausanne, Switzerland. (doi:10.1109/ICIP.1996.560376) Spooner, G. M. 1931 Some Observations on Schooling in Fish. Journal of the Marine Biological Association of the United Kingdom (New Series), 17, 421–448. (doi: 10.1017/S0025315400050943) Srinivasan, M. V. & Davey, M. 1995 Strategies for Active Camouflage of Motion. Proceedings of the Royal Society B: Biological Sciences, 259(1354), 19–25. (doi: 10.1098/rspb.1995.0004) Stein, C. M. 1981 Estimation of the Mean of a Multivariate Normal Distribution. The Annals of Statistics, 9(6), 1135–1151. (doi:10.1214/aos/1176345632) Strandburg-Peshkin, A., Twomey, C. R., Bode, N. W. F., Kao, A. B., Katz, Y., Ioannou, C. C., Rosenthal, S. B., Torney, C. J., Wu, H. S. et al. 2013 Visual Sensory Networks and Effective Information Transfer in Animal Groups. Current Biology, 23(17), R709–R711. (doi:10.1016/j.cub.2013.07.059) Sussmann, H. J. & Willems, J. C. 1997 300 Years of Optimal Control: from the Brachystochrone to the Maximum Principle. IEEE Control Systems Magazine, 17(3), 32–44. (doi:10.1109/37.588098) Tan, X., Kim, D., Usher, N., Laboy, D., Jackson, J., Kapetanovic, A., Rapai, J., Sabadus, B. & Zhou, X. 2006 An Autonomous Robotic Fish for Mobile Sensing. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems(IROS), pp. 5424–5429. Beijing, China. (doi:10.1109/IROS.2006.282110) Taringoo, F. & Caines, P. E. 2013 On the Optimal Control of Hybrid Systems on Lie Groups and the Exponential Gradient HMP Algorithm. In Proceedings of the 227 52nd IEEE Conference on Decision and Control (CDC), pp. 2653–2658. Florence, Italy. (doi:10.1109/CDC.2013.6760283) Tikhonov, A. N. 1963 Solution of Incorrectly Formulated Problems and the Regu- larization Method. Soviet Mathematics (Translated), 4, 1035–1038. Tits, A. L. 2013 Notes for ENEE 664: Optimal control. Todorov, E. & Jordan, M. 1998 Smoothness Maximization Along A Predefined Path Accurately Predicts The Speed Profiles of Complex Arm Movements. Journal of Neurophysiology, 80(2), 696–714. Tokekar, P., Bhadauria, D., Studenski, A. & Isler, V. 2010 A Robotic System for Monitoring Carp in Minnesota Lakes. Journal of Field Robotics, 27(6), 779–789. (doi:10.1002/rob.20364) Tokekar, P., Branson, E., Vander Hook, J. & Isler, V. 2013 Tracking Aquatic In- vaders: Autonomous Robots for Monitoring Invasive Fish. IEEE Robotics Au- tomation Magazine, 20(3), 33–41. (doi:10.1109/MRA.2012.2220506) Topaz, C. M., Bertozzi, A. L. & Lewis, M. A. 2006 A Nonlocal Continuum Model for Biological Aggregation. Bulletin of Mathematical Biology, 68(7), 1601–1623. (doi:10.1007/s11538-006-9088-6) Tsitsiklis, J. N., Bertsekas, D. P. & Athans, M. 1986 Distributed Asynchronous De- terministic and Stochastic Gradient Optimization Algorithms. IEEE Transactions on Automatic Control, 31(9), 803–812. (doi:10.1109/TAC.1986.1104412) ViCoN Vicon Motion Capture System. http://www.vicon.com. Accessed: 2014- 09-07. Vicsek, T., Cziro´k, A., Ben-Jacob, E., Cohen, I. & Shochet, O. 1995 Novel Type of 228 Phase Transition in a System of Self-Driven Particles. Physical Review Letters, 75, 1226–1229. (doi:10.1103/PhysRevLett.75.1226) Vicsek, T. & Zafeiris, A. 2012 Collective Motion. Physics Reports, 517(3-4), 71–140. (doi:http://dx.doi.org/10.1016/j.physrep.2012.03.004) Wahba, G. 1990 Spline Models for Observational Data, vol. 59 of CBMS-NSF Re- gional Conference Series in Applied Mathematics. Philadelphia, PA: SIAM. Wahba, G. & Wold, S. 1975 A Completely Automatic French Curve: Fitting Spline Functions by Cross-Validation. Communications in Statistics, 4(1), 1–17. (doi: 10.1080/03610927508827223) Wei, E., Justh, E. W. & Krishnaprasad, P. S. 2009 Pursuit and an Evolutionary Game. Proceedings of the Royal Society A: Mathematical, Physical and Engineer- ing Sciences, 465(2105), 1539–1559. (doi:10.1098/rspa.2008.0480) Weimerskirch, H., Martin, J., Clerquin, Y., Alexandre, P. & Jiraskova, S. 2001 Energy Saving in Flight Formation. Nature, 413(6857), 697 – 698. (doi:http: //dx.doi.org/10.1038/35099670) Wright, G. S., Chiu, C., Xian, W., Wilkinson, G. S. & Moss, C. F. 2014 Social Calls Predict Foraging Success in Big Brown Bats. Current Biology, 24(8), 885–889. (doi:10.1016/j.cub.2014.02.058) Young, G. F., Scardovi, L., Cavagna, A., Giardina, I. & Leonard, N. E. 2013 Starling Flock Networks Manage Uncertainty in Consensus at Low Cost. PLoS Computa- tional Biology, 9(1), e1002 894. (doi:10.1371/journal.pcbi.1002894) YouTube-Video Implementation Videos. http://ter.ps/flockvdo. Accessed: 2014-09-30. 229 Yu, W., Chen, G. & Cao, M. 2010 Some Necessary and Sufficient Conditions for Second-Order Consensus in Multi-Agent Dynamical Systems. Automatica, 46(6), 1089 – 1095. (doi:10.1016/j.automatica.2010.03.006) Yu, W., Zheng, W. X., Chen, G., Ren, W. & Cao, M. 2011 Second-order Consensus in Multi-Agent Dynamical Systems with Sampled Position Data. Automatica, 47(7), 1496 – 1503. (doi:10.1016/j.automatica.2011.02.027) Zhang, H. P., Beer, A., Florin, E. L. & Swinney, H. L. 2010 Collective Motion and Density Fluctuations in Bacterial Colonies. Proceedings of the National Academy of Sciences, 107(31), 13 626–13 630. (doi:10.1073/pnas.1001651107) Zhang, Z., Tomlinson, J. & Martin, C. F. 1997 Splines and Linear Control Theory. Acta Applicandae Mathematica, 49(1), 1–34. (doi:10.1023/A:1005856801842) Zhou, Y., Egerstedt, M. & Martin, C. 2005 Control Theoretic Splines with Deter- ministic and Random Data. In Proceedings of 44th IEEE Conference on Decision and Control and 2005 European Control Conference (CDC-ECC), pp. 362–367. Seville, Spain. (doi:10.1109/CDC.2005.1582182) Zhou, Y., Egerstedt, M. & Martin, C. 2006 Hilbert Space Methods for Control Theoretic Splines: A Unified Treatment. Communications in Information and Systems, 6(1), 55–82. (doi:10.4310/CIS.2006.v6.n1.a4) 230