# Optimal Strokes of Low Reynolds Number Linked-Sphere Swimmers
## Appendix A Shooting Method  
We use the SM to solve the optimal stroke problem Equation (12), where the Euler-Lagrange Equation (13) is solved using the 2 nd order Runge-Kutta method [22; 23].  
For a LRN swimmer with finitely many degrees of freedom in its shape deformations, given an initial shape \(\gamma_{0}\) and an initial shape deformation denoted by \(v_{0}\), there exists a unique solution \(\gamma(t)\;(t\in[0,1])\) to the Euler-Larange Equation (13) and satisfies the initial condition: \(\gamma(0)=\gamma_{0}\), \(\dot{\gamma}(0)=v_{0}\). For the given initial shape \(\gamma_{0}\), define a function \(\Phi_{\gamma_{0}}\) as:  
\[\Phi_{\gamma_{0}}(v_{0},\lambda)=\big{(}\gamma(1),X(\gamma)\big{)} \tag{14}\]  
where \(\lambda\) is the Lagrange multiplier in Equation (13), \(\gamma\) is the solution to the Euler-Larange Equation (13), and \(X(\gamma)\) is the net translation resulted from the stroke \(\gamma\) (see Equation (10)). Then the optimal stroke problem Equation (12) becomes:  
Given initial shape \(\gamma_{0}\) and a net translation \(X_{0}\), find \((v_{0},\lambda)\), s.t. \(\Phi_{\gamma_{0}}(v_{0},\lambda)=(\gamma_{0},X_{0})\).  
The corresponding stroke is the optimal stroke \(\overline{\gamma}\).  
From the geometric point of view, let \(Q\) be the set of all possible configurations of the LRN swimmer. If the swimmer has only finitely many degrees of freedom in this shape deformations, then \(Q\) is a finite dimensional smooth manifold and has the geometric structure \(Q=S\times G\), where \(S\) is the set of all unlocated shapes of the swimmer and \(G\) is the group of rigid motions. All the linked-sphere swimmers we considered are rotation-free and can only perform translation along one direction, therefore \(G\cong\mathbb{R}\). A swimming stroke \(\gamma(t)\) is a path in \(S\), and \(\dot{\gamma}(t)\in T_{\gamma(t)}S\), that is, a shape deformation \(\dot{\gamma}(t)\) is a tangent vector in the tangent space \(T_{\gamma(t)}S\) on the shape \(\gamma(t)\). Therefore Equation (14) defines a function \(\Phi_{\gamma_{0}}\):  
\[\Phi_{\gamma_{0}}:\;T_{\gamma_{0}}S\times\mathbb{R}\to Q\]  
and  
\[v_{0}\in T_{\gamma_{0}}S,\;\lambda\in\mathbb{R},\;\gamma(1)\in S,\;X(\gamma) \in G\cong\mathbb{R}\]_The geometric structure \(Q=S\times G\) makes \(Q\) the trivial principal fiber bundle over \(S\). For more discussions regarding the geometric properties of a LRN swimming system, please refer to [25; 28; 31; 32; 43; 44]._  
Let \(\overline{Z}=(\gamma_{0},X_{0})\in\mathbb{R}^{m+1}\), choose a parameter \(N\). Make an initial guess \(\theta_{0}=(v_{0},\lambda)\).  
* Loop for \(n=0,1,\cdots,N-1\).
* Compute \(Z_{n}=\Phi_{\gamma_{0}}(\theta_{n})\) by solving Equation (13) using the 2 nd order Runge-Kutta method.
* Compute \[\theta_{n+1}=\theta_{n}+D\Phi_{\gamma_{0}}(\theta_{n})^{-1}\Big{(}\frac{ \overline{Z}-Z_{n}}{Z-n}\Big{)}\] where the matrix \(D\Phi_{\gamma_{0}}(\theta)\) can be approximated by the following finite difference scheme: \[D\Phi_{\gamma_{0}}(\theta)\big{(}\delta\mathbf{e}_{i}\big{)}\sim\Phi_{\gamma_ {0}}(\theta+\delta\mathbf{e}_{i})-\Phi_{\gamma_{0}}(\theta)\] where \(0<\delta\ll 1\) and \(\mathbf{e}_{i}\in\mathbb{R}^{m+1}\) is the \(i\)th unit vector.
* ([PERSON]'s method) Loop for \(n\geq N\) until \(\theta_{n}\) converges to \(\overline{\theta}\).
* Compute \(Z_{n}=\Phi_{\gamma_{0}}(\theta_{n})\) by solving Equation (13) using the 2 nd order Runge-Kutta method.
* Compute \[\theta_{n+1}=\theta_{n}+D\Phi_{\gamma_{0}}(\theta_{n})^{-1}\big{(}\overline{Z} -Z_{n}\big{)}\]
* Compute the optimal stroke \(\overline{\gamma}\) from \(\overline{\theta}\).  
**Algorithm 1**(_Shooting Method_)