Numerical Simulations of a Rolling Ball Robot Actuated by Internal Point Masses
Vakhtang Putkaradze, Stuart Rogers

TL;DR
This paper presents a numerical approach for controlling a rolling ball robot actuated by internal point masses, enabling trajectory tracking and obstacle avoidance through continuation methods.
Contribution
It introduces a numerical framework for controlling a ball robot with internal masses along arbitrary rails, advancing motion planning techniques.
Findings
Successful trajectory tracking demonstrated
Effective obstacle avoidance achieved
Numerical solutions validated for complex internal mass configurations
Abstract
The controlled motion of a rolling ball actuated by internal point masses that move along arbitrarily-shaped rails fixed within the ball is considered. The controlled equations of motion are solved numerically using a predictor-corrector continuation method, starting from an initial solution obtained via a direct method, to realize trajectory tracking and obstacle avoidance maneuvers.
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Figure 13
Figure 14
Figure 15
Figure 16
Figure 17
Figure 18
Figure 19
Figure 20
Figure 21
Figure 22
Figure 23
Figure 24
Figure 25
Figure 26
Figure 27
Figure 28
Figure 29
Figure 30
Figure 31
Figure 32
Figure 33
Figure 34
Figure 35
Figure 36
Figure 37
Figure 38
Figure 39
Figure 40| Parameter | Value |
|---|---|
| Parameter | Value |
|---|---|
| Parameter | Value |
|---|---|
| Parameter | Value |
|---|---|
| Parameter | Value |
|---|---|
| Parameter | Value |
|---|---|
| Parameter | Value |
|---|---|
| Shorthand | Extended Shorthand | Normalized | Un-Normalized | |||
|---|---|---|---|---|---|---|
| = | = | = | ||||
| = | = | = | ||||
| = | = | = | ||||
| = | = | = | ||||
| = | = | = | ||||
| = | = | = | ||||
| = | = | = | ||||
| = | = | = | ||||
| = | = | = |
| Shorthand | Meaning | Simplification | ||
|---|---|---|---|---|
| = | = | |||
| = | = | |||
| = | = | |||
| = | = |
| Shorthand | Meaning | |
|---|---|---|
| = | ||
| = | ||
| = |
| Shorthand | Meaning | Simplification | ||
|---|---|---|---|---|
| = | = | |||
| = | = | |||
| = | = | |||
| = | = |
| Shorthand | Meaning | |
|---|---|---|
| = | ||
| = | ||
| = |
| Normalized | Un-Normalized | |
|---|---|---|
| = | ||
| = | ||
| = | ||
| = | ||
| = | ||
| = | ||
| = | ||
| = | ||
| = |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Numerical Simulations of a Rolling Ball Robot Actuated by Internal Point Masses
Vakhtang Putkaradze Email address: [email protected] Department of Mathematical and Statistical Sciences, Faculty of Science, University of Alberta, CAB 632, Edmonton, AB T6G 2G1, Canada
ATCO SpaceLab, 5302 Forand ST SW, Calgary, AB T3E 8B4, Canada
Stuart Rogers Email address: [email protected] Institute for Mathematics and its Applications, College of Science and Engineering, University of Minnesota, 207 Church ST SE, 306 Lind Hall, Minneapolis, MN 55455, USA
Abstract
The controlled motion of a rolling ball actuated by internal point masses that move along arbitrarily-shaped rails fixed within the ball is considered. The controlled equations of motion are solved numerically using a predictor-corrector continuation method, starting from an initial solution obtained via a direct method, to realize trajectory tracking and obstacle avoidance maneuvers.
Keywords: optimal control, rolling ball robots, trajectory tracking, obstacle avoidance, predictor-corrector continuation
Contents
-
2.1 Optimal Control Problem and Controlled Equations of Motion
-
3.1 Optimal Control Problem and Controlled Equations of Motion
-
A Optimal Control: Variational Pontryagin’s Minimum Principle
-
B Implementation Details for Solving the ODE TPBVP for a Regular Optimal Control Problem
-
C Predictor-Corrector Continuation Method for Solving an ODE TPBVP
-
D Sweep Predictor-Corrector Continuation Method for Solving an ODE TPBVP
1 Introduction
@fb@secFB
1.1 Overview
This paper is a continuation of [1], providing numerical solutions of the controlled equations of motion for several special cases of the rolling disk and ball actuated by moving internal point masses. The paper [1] invokes Pontryagin’s minimum principle to derive the theoretical background for the optimal control of the rolling disk and ball having general performance indexes. This paper implements the theory derived in [1] to solve several practical examples, such as trajectory tracking for the rolling disk and obstacle avoidance for the rolling ball. The key contributions of this paper are listed below.
- •
The controlled equations of motion, for a rolling ball actuated by internal point masses that move along arbitrarily-shaped rails fixed within the ball, are solved numerically by a predictor-corrector continuation method, starting from an initial solution provided by a direct method.
- •
Jacobians of the ordinary differential equations (ODEs) and boundary conditions (BCs) which constitute the controlled equations of motion (i.e. an ordinary differential equation two-point boundary value problem (ODE TPBVP)) corresponding to the optimal control of a dynamical system are derived. These Jacobians are useful for numerically solving the controlled equations of motion.
- •
Algorithms for solving an ODE TPBVP by predictor-corrector continuation are developed and were implemented in LAB to numerically solve the controlled equations of motion for the rolling ball. There are not very many predictor-corrector continuation methods publicly available for solving dynamical systems. The idea of using a monotonic continuation ODE TPBVP solver in conjunction with a predictor-corrector continuation method to advance (or “sweep”) as far along the tangent as possible is new, and this novel technique was used to obtain all the numerical results in this paper.
The paper is organized as follows. Subsections 1.2 and 1.3 review the specific types of rolling disk and ball considered, define coordinate systems and notation used to describe this rolling disk and ball, and present the uncontrolled equations of motion for this rolling disk and ball derived earlier in [2, 3]. In Sections 2 and 3, the controlled equations of motion for the rolling disk and ball are formulated and solved numerically via a predictor-corrector continuation method, starting from an initial solution provided by a direct method. Subsection 1.4 provides details of the numerical methods used to solve the controlled equations of motion. Section 4 summarizes the results of the paper and discusses topics for future work. The background material for this paper is contained in several appendices. In particular, Appendix A reviews the theory of optimal control needed to derive the controlled equations of motion for a generic dynamical system given initial and final conditions, given a performance index to be minimized, and in the absence of path inequality constraints. Appendix B provides details for numerically solving the controlled equations of motion. Appendices C and D develop two predictor-corrector continuation algorithms which numerically solve an ODE TPBVP, the latter of which is utilized to numerically solve the controlled equations of motion for the rolling disk and ball.
@fb@secFB
1.2 Rolling Ball
Consider a rigid ball of radius containing some static internal structure as well as point masses, where either is a positive integer denoting the number of moving masses or if no moving masses are used and the structure of the ball is static. This ball rolls without slipping on a horizontal surface in the presence of a uniform gravitational field of magnitude , as illustrated in Figure 1.1. The ball with its static internal structure has mass and the point mass has mass for . Let denote the mass of the total system. The total mechanical system consisting of the ball with its static internal structure and the point masses is referred to as the ball or the rolling ball, the ball with its static internal structure but without the point masses may also be referred to as , and the point mass may also be referred to as for . Note that this system is the Chaplygin ball [4] equipped with point masses.
Two coordinate systems, or frames of reference, will be used to describe the motion of the rolling ball, an inertial spatial coordinate system and a body coordinate system in which each particle within the ball is always fixed. For brevity, the spatial coordinate system will be referred to as the spatial frame and the body coordinate system will be referred to as the body frame. These two frames are depicted in Figure 1.1. The spatial frame has orthonormal axes , , , such that the - plane is parallel to the horizontal surface and passes through the ball’s geometric center (i.e. the - plane is a height above the horizontal surface), such that is vertical (i.e. is perpendicular to the horizontal surface) and points “upward” and away from the horizontal surface, and such that forms a right-handed coordinate system. For simplicity, the spatial frame axes are chosen to be
[TABLE]
The acceleration due to gravity in the uniform gravitational field is in the spatial frame.
The body frame’s origin is chosen to coincide with the position of ’s center of mass. The body frame has orthonormal axes , , and , chosen to coincide with ’s principal axes, in which ’s inertia tensor is diagonal, with corresponding principal moments of inertia , , and . That is, in this body frame the inertia tensor is the diagonal matrix . Moreover, , , and are chosen so that forms a right-handed coordinate system. For simplicity, the body frame axes are chosen to be
[TABLE]
In the spatial frame, the body frame is the moving frame , where defines the orientation (or attitude) of the ball at time relative to its reference configuration, for example at some initial time.
For , it is assumed that moves along its own 1-d rail. It is further assumed that the rail is parameterized by a 1-d parameter , so that the trajectory of the rail, in the body frame translated to the ball’s geometric center, as a function of is . Refer to Figure 1.1 for an illustration. Therefore, the body frame vector from the ball’s geometric center to ’s center of mass is denoted by . Since is stationary in the body frame and to be consistent with the positional notation for for , is the constant (time-independent) vector from the ball’s geometric center to ’s center of mass for any scalar-valued, time-varying function . In addition, suppose a time-varying external force acts at the ball’s geometric center.
Let denote the position of ’s center of mass in the spatial frame so that the position of ’s center of mass in the spatial frame is . In general, a particle with position in the body frame has position in the spatial frame and has position in the body frame translated to the ball’s geometric center.
For conciseness, the ball’s geometric center is often denoted GC, ’s center of mass is often denoted CM, and the ball’s contact point with the surface is often denoted CP. The GC is located at in the spatial frame, at in the body frame, and at in the body frame translated to the GC. The CM is located at in the spatial frame, at in the body frame, and at in the body frame translated to the GC. The CP is located at in the spatial frame, at in the body frame, and at in the body frame translated to the GC, where . Since the third spatial coordinate of the ball’s GC is always [math] and of the ball’s CP is always , only the first two spatial coordinates of the ball’s GC and CP, denoted by , are needed to determine the spatial location of the ball’s GC and CP.
For succintness, the explicit time dependence of variables is often dropped. That is, the orientation of the ball at time is denoted simply rather than , the position of ’s center of mass in the spatial frame at time is denoted rather than , the position of ’s center of mass in the body frame translated to the GC at time is denoted or rather than , the spatial - position of the ball’s GC at time is denoted rather than , and the external force is denoted rather than .
As shown in [2, 3], the uncontrolled equations of motion for this rolling ball are
[TABLE]
where is the body frame vector from the CP to for , is the ball’s body angular velocity, is the spatial unit normal expressed in the body frame, and is the external force expressed in the body frame. For , is the symmetric matrix given by
[TABLE]
and is the projected vector consisting of the first two components of so that
[TABLE]
Let denote the magnitude of the normal force acting at the ball’s CP. Let and denote the magnitude of and unit-length direction antiparallel to the static friction acting at the ball’s CP, respectively. As shown in [3], the magnitude of the normal force is
[TABLE]
and the static friction is
[TABLE]
The dynamics encapsulated by (1.3) are valid only if the ball does not detach from the surface () and rolls without slipping (), where denotes the coefficient of static friction between the ball and the surface.
@fb@secFB
1.3 Rolling Disk
Now suppose that the ball’s inertia is such that one of the ball’s principal axes, say the one labeled , is orthogonal to the plane containing the GC and CM. Also assume that all the point masses move along 1-d rails which lie in the plane containing the GC and CM. Moreover, suppose that the ball is oriented initially so that the plane containing the GC and CM coincides with the - plane and that the external force acts in the - plane. Then for all time, the ball will remain oriented so that the plane containing the GC and CM coincides with the - plane and the ball will only move in the - plane, with the ball’s rotation axis always parallel to . Note that the dynamics of this system are equivalent to that of the Chaplygin disk [4], equipped with point masses, rolling in the - plane, and where the Chaplygin disk (minus the point masses) has polar moment of inertia . Therefore, henceforth, this particular ball with this special inertia, orientation, and placement of the rails and point masses, may be referred to as the disk or the rolling disk. Figure 1.2 depicts the rolling disk. Let denote the angle between and , measured counterclockwise from to . Thus, if , the disk rolls in the direction and has the same direction as , and if , the disk rolls in the direction and has the same direction as .
As shown in [2, 3], the uncontrolled equation of motion for this rolling disk is
[TABLE]
where
[TABLE]
In (1.8), is a function that depends on time () through the possibly time-varying external force , on the point mass parameterized positions (), velocities (), and accelerations (), and on the disk’s orientation angle () and its time-derivative (). The spatial position of the disk’s GC is given by
[TABLE]
where is the spatial position of the disk’s GC at time and is the disk’s angle at time . Let denote the magnitude of the normal force acting at the disk’s CP. Let and denote the magnitude of and unit-length direction antiparallel to the static friction acting at the disk’s CP, respectively. As shown in [3], the magnitude of the normal force is
[TABLE]
and the static friction is
[TABLE]
The dynamics encapsulated by (1.8) are valid only if the disk does not detach from the surface () and rolls without slipping (), where denotes the coefficient of static friction between the disk and the surface.
@fb@secFB
1.4 Numerical Methods
In Sections 2 and 3, the motions of the rolling disk and ball are simulated in LAB R2019b by numerically solving the controlled equations of motion (2.16) and (3.23) corresponding to the optimal control problems (2.7) and (3.4) for the rolling disk and ball, respectively. Subsection 2.2 simulates the rolling disk, while Subsections 3.2 and 3.3 simulate the rolling ball. Because the controlled equations of motion have a very small radius of convergence [5, 6, 7], a direct method, namely the LAB toolbox PS-II [8] version 2.5, is first used to construct a good initial guess. In these simulations, PS-II is configured to use the NLP solver SNOPT [9, 10] version 7.6.0, though PS-II can also be configured to use the NLP solver IPOPT [11]. For the rolling disk, the direct method is used to solve the rolling disk optimal control problem (2.7). When using the direct method to solve the rolling ball optimal control problem, the differential-algebraic equation (DAE) formulation (3.19) is solved first. The direct method solution to the DAE formulation is then used as an initial guess to solve the ODE formulation (3.4), which is consistent with the controlled equations of motion (3.23) for the rolling ball, by the direct method. The LAB automatic differentiation toolbox Gator [12, 13] version 1.5 is used to supply vectorized first derivatives (i.e. Jacobians) to the direct method solver PS-II, since SNOPT accepts first, but not second, derivatives.
Starting from the initial guess provided by the direct method, the controlled equations of motion (2.16) and (3.23) are solved by predictor-corrector continuation in the parameter , utilizing the algorithm described in Appendix D. The predictor-corrector continuation method uses the LAB global method ODE TPBVP solvers p [14] version 1.0 or twp [15] version 1.0. By vectorized automatic differentiation of , , and , Gator is used to numerically construct the Jacobians of the normalized ODE velocity function (B.5) and (B.6). By non-vectorized automatic differentiation of the Hamiltonian , the initial condition function , the final condition function , and the endpoint function , Gator is used to numerically construct the normalized BC function (B.40) and the Jacobians of the normalized BC function (B.42), (B.43), and (B.44). These functions are needed by the ODE TPBVP solvers p and twp to solve the controlled equations of motion (2.16) and (3.23) by predictor-corrector continuation in the parameter .
In contrast to the direct method, the controlled equations of motion obtained via the indirect method have a very small radius of convergence [5, 6, 7]. Therefore, the direct method is needed to initialize the predictor-corrector continuation of the controlled equations of motion. Predictor-corrector continuation is used in conjunction with the indirect, rather than direct, method, because a predictor-corrector continuation direct method requires a predictor-corrector continuation NLP solver. Even though predictor-corrector continuation NLP solver algorithms are provided in [16, 17], there do not seem to be any publicly available predictor-corrector continuation NLP solvers.
2 Trajectory Tracking for the Rolling Disk
@fb@secFB
2.1 Optimal Control Problem and Controlled Equations of Motion
In the next subsection, numerical solutions of the controlled equations of motion for the rolling disk are presented, where the goal is to move the disk between a pair of points while the disk’s GC tracks a prescribed trajectory. A rolling disk of mass , radius , polar moment of inertia , and with the CM coinciding with the GC (i.e. ) is simulated. These physical parameters for the disk are consistent with the necessary and sufficient conditions stipulated by Inequality 3.2 in [18]; in that inequality, note that since the disk is a planar distribution of mass. There are control masses, each of mass so that , located on concentric circular control rails centered on the GC of radii , , , and , as shown in Figure 2.1. For , the position of in the body frame centered on the GC is
[TABLE]
The total mass of the system is , and gravity is . There is no external force acting on the disk’s GC, so that in (1.8). The initial time is fixed to and the final time is fixed to . The disk’s GC starts at rest at at time and stops at rest at at time . Table 2.1 shows parameter values used in the rolling disk’s initial conditions (2.10) and final conditions (2.11). Since the initial orientation of the disk is and since the initial configurations of the control masses are given by \boldsymbol{\theta}_{a}=\begin{bmatrix}\scalebox{0.75}[1.0]{-}\frac{\pi}{2}&\scalebox{0.75}[1.0]{-}\frac{\pi}{2}&\scalebox{0.75}[1.0]{-}\frac{\pi}{2}&\scalebox{0.75}[1.0]{-}\frac{\pi}{2}\end{bmatrix}^{\mathsf{T}}, all the control masses are initially located directly below the GC. In order for the disk to start and stop at rest, and . Table 2.2 shows parameter values used in the rolling disk’s final conditions (2.11).
The desired GC path is depicted by the red curve in Figures 2.2a and 2.2b. encourages the disk’s GC to track a sinusoidally-modulated linear trajectory connecting with . That is, the disk is encouraged to roll right, then left, then right, then left, and finally to the right, with the amplitude of each successive roll increasing from the previous one. Specifically, is given by
[TABLE]
where
[TABLE]
[TABLE]
[TABLE]
and
[TABLE]
with in (2.3). The reader is referred to [1] for further details about the properties and construction of (2.2).
The optimal control problem for the rolling disk is
[TABLE]
In (2.7), the system state and control are
[TABLE]
where and . In (2.7), the system dynamics defined for are
[TABLE]
where is given by the right-hand side of (1.8). In (2.9), the time-dependence of is dropped since in (1.8) for these simulations. In (2.7), the prescribed initial conditions at time are
[TABLE]
and the prescribed final conditions at time are
[TABLE]
In (2.11),
[TABLE]
is the total system CM expressed in the body frame translated to the disk’s GC at time ,
[TABLE]
is the rotation matrix that maps the body to spatial frame at time , and is the projection onto the first component. Therefore, the first constraint in (2.11) ensures that the total system CM is above or below the disk’s GC in the spatial frame at the final time , so that, in conjunction with the final condition parameter values given in Table 2.2, the disk stops at rest. In (2.7), the performance index is
[TABLE]
where the integrand cost function is
[TABLE]
for positive coefficients and , . The first summand in encourages the disk’s GC to track the desired spatial path , and is a scalar continuation parameter used to construct a sequence of optimal control problems. The next summands , , in limit the magnitude of the acceleration of the control mass parameterization. Table 2.3 shows the values set for the integrand cost function coefficients in (2.15).
As explained in Appendix A, the controlled equations of motion for the rolling disk’s optimal control problem (2.7) are encapsulated by the ODE TPBVP:
[TABLE]
Subappendix A.1 of [1] derives the formulas for constructing . In (2.16), is the endpoint function
[TABLE]
where and are constant Lagrange multiplier vectors enforcing the initial and final conditions, (2.10) and (2.11), respectively. In (2.16), is the Hamiltonian
[TABLE]
where is a time-varying Lagrange multiplier vector enforcing the dynamics (2.9). In (2.16), is an analytical formula expressing the control as a function of the state and the costate . The components of are given by
[TABLE]
for . In (2.16), is the regular Hamiltonian
[TABLE]
The reader is referred to [1] for a more general description of the rolling disk’s optimal control problem (2.7) and the associated controlled equations of motion (2.16).
@fb@secFB
2.2 Numerical Solutions: Trajectory Tracking
The direct method solver PS-II is used to solve the optimal control problem (2.7) when the integrand cost function coefficient is . Predictor-corrector continuation is then used to solve the controlled equations of motion (2.16), starting from the direct method solution. The continuation parameter is , which is used to adjust according to the linear homotopy given in Table 2.3, so that when and when . The predictor-corrector continuation begins at , which is consistent with the direct method solution obtained at .
For the direct method, PS-II is run using the NLP solver SNOPT. The PS-II mesh error tolerance is 1\mathrm{e}\scalebox{0.75}[1.0]{-}6 and the SNOPT error tolerance is 1\mathrm{e}\scalebox{0.75}[1.0]{-}7. In order to encourage convergence of SNOPT, a constant is added to the integrand cost function in (2.15). The sweep predictor-corrector continuation method discussed in Appendix D is used by the indirect method. For the sweep predictor-corrector continuation method, the maximum tangent steplength is adjusted according to Figure 2.4d over the course of predictor-corrector steps, the maximum tangent steplength in each step is , the direction of the initial unit tangent is determined by setting d=\scalebox{0.75}[1.0]{-}2 to force the continuation parameter to initially decrease, the relative error tolerance is 1\mathrm{e}\scalebox{0.75}[1.0]{-}8, the unit tangent solver is bvpc_m, and the monotonic “sweep” continuation solver is cc. The numerical results are shown in Figures 2.2, 2.3, and 2.4. As decreases from down to during continuation (see Figure 2.4a), increases from up to (see Figure 2.4b). Since is ratcheted up during continuation, thereby increasing the penalty in the integrand cost function (2.15) for deviation between the disk’s GC and , by the end of continuation, the disk’s GC tracks very accurately (compare Figures 2.2a vs 2.2b), at the expense of more serpentine control mass trajectories (compare Figures 2.2c vs 2.2d) and larger magnitude controls (compare Figures 2.2e vs 2.2f). The disk does not detach from the surface since the magnitude of the normal force is always positive (see Figures 2.3a and 2.3b). The disk rolls without slipping if the coefficient of static friction is at least for the direct method solution (see Figure 2.3c) and if is at least for the indirect method solution (see Figure 2.3d). That is, the indirect method solution requires a much larger coefficient of static friction.
2.2.1 Turning Points
The previous sweep predictor-corrector continuation indirect method is repeated, but this time with 22 steps, where the maximum tangent steplength in each step is
[TABLE]
Note that the first 6 maximum tangent steplengths in (2.21) agree with those used in the previous simulation, so that the two simulations agree for the first 7 solutions. Figure 2.5 shows the evolution of the continuation parameter , GC path weighting factor , performance index , GC tracking error , and tangent steplength over the course of the 23 solutions (the first solution is initialized by the direct method) constructed by the sweep predictor-corrector continuation indirect method. Note the turning points (local maxima or minima) at solutions 7, 10, and 18 in Figures 2.5a-2.5d. Figure 2.5d shows that the GC tracking error realizes a minimum at solution 7, which explains how the stopping point for the previous simulation was selected.
3 Obstacle Avoidance for the Rolling Ball
@fb@secFB
3.1 Optimal Control Problem and Controlled Equations of Motion
In the next two subsections, numerical solutions of the controlled equations of motion for the rolling ball are presented, where the goal is to move the ball between a pair of points while the ball’s GC avoids a pair of obstacles. A rolling ball of mass , radius , principal moments of inertia , and with the CM coinciding with the GC (i.e. ) is simulated. These physical parameters for the ball are consistent with the necessary and sufficient conditions stipulated by Inequalities 3.1 and 3.2 in [18]. There are control masses, each of mass so that , located on circular control rails centered on the GC of radii , , and , oriented as shown in Figure 3.1. For , the position of in the body frame centered on the GC is
[TABLE]
where is a rotation matrix whose columns are the right-handed orthonormal basis constructed from the unit vector based on the algorithm given in Section 4 and Listing 2 of [19], maps spherical coordinates to Cartesian coordinates:
[TABLE]
and
[TABLE]
are spherical coordinates of unit vectors in .
The total mass of the system is , and gravity is . There is no external force acting on the ball’s GC, so that in (1.3). The initial time is fixed to and the final time is fixed to . The ball’s GC starts at rest at at time and stops at rest at at time . The ball’s GC should avoid circular obstacles, depicted in Figures 3.2a and 3.2b. The obstacles each have radius and are centered at and .
The ODE formulation of the optimal control problem for the rolling ball is
[TABLE]
In (3.4), the system state and control are
[TABLE]
where , , , and . In the system state defined in (3.5), the rolling ball’s orientation matrix is parameterized by , where denotes the set of versors (i.e. unit quaternions) [4, 20, 21, 22]. The properties of versors and the notation used to manipulate versors are explained in Appendix D of [2]. Recall from [2] that given a column vector , is the quaternion
[TABLE]
and given a quaternion , is the column vector such that
[TABLE]
As explained in [2], the transformation of a body frame vector into the spatial frame by the ball’s orientation matrix can be realized using the versor via the Euler-Rodrigues formula
[TABLE]
In (3.4), the system dynamics defined for are
[TABLE]
where is given by the right-hand side of the formula for in (1.3). In (3.9), the time-dependence of is dropped since in (1.3) for these simulations. In (3.4), the prescribed initial conditions at time are
[TABLE]
and the prescribed final conditions at time are
[TABLE]
Table 3.4 shows the parameter values used in the rolling ball’s initial conditions (3.10). The initial configurations of the control masses are selected so that the total system CM in the spatial frame is initially located above or below the ball’s GC. Hence, in conjunction with the other initial condition parameter values given in Table 3.4, the ball starts at rest. In (3.11),
[TABLE]
is the total system CM in the body frame translated to the ball’s GC at time ,
[TABLE]
is the total system CM in the spatial frame translated to the ball’s GC at time , and is the projection onto the first two components. Therefore, the first two constraints in (3.11) ensure that the total system CM in the spatial frame is above or below the ball’s GC at the final time . Hence, in conjunction with the final condition parameter values given in Table 3.5, the ball stops at rest. In (3.4), the performance index is
[TABLE]
where the integrand cost function is
[TABLE]
for positive coefficients , , and , . The first summands , , in limit the magnitude of the acceleration of the control mass parameterization and the final summands , , in encourage the ball’s GC to avoid the pair of obstacles. For the obstacle avoidance function in , is either the time-reversed sigmoid function (2.3) or the cutoff function
[TABLE]
In (3.16), is the rectified linear unit function frequently used in the machine learning literature [23]. In (3.15), the coefficients , , and , , depend on the scalar continuation parameter so that a sequence of optimal control problems may be constructed. Note that a solution obtained by the optimal control procedure, that minimizes (2.14) for the rolling disk or (3.14) for the rolling ball, is a “compromise” between several, often conflicting, components, where some components of the performance index can be made more prominent by making their coefficients appropriately larger. The minimization of the performance index does not guarantee the minimization of each component individually.
There is also a DAE formulation of the optimal control problem for the rolling ball which explicitly enforces the algebraic versor constraint on and which is mathematically equivalent to (3.4). In the DAE formulation, the first component, , of the versor is moved from the state to the control and an imitator state, , is used to replace in . , so that with perfect integration (i.e. no numerical integration errors), for . Defining
[TABLE]
then with perfect integration,
[TABLE]
for . is added to the state since the final conditions require knowledge of , which is unavailable if it has been moved to the control since the final conditions are not a function of the control. The DAE formulation of the rolling ball’s optimal control problem is
[TABLE]
where
[TABLE]
[TABLE]
and
[TABLE]
Even though the DAE formulation (3.19) is mathematically equivalent to the ODE formulation (3.4), the DAE formulation (3.19) tends to be numerically more stable to solve than the ODE formulation (3.4), as explained in Example 6.12 “Reorientation of an Asymmetric Rigid Body” of [7].
As explained in Appendix A, the controlled equations of motion for the ODE formulaton (3.4) of the rolling ball’s optimal control problem are encapsulated by the ODE TPBVP:
[TABLE]
Subappendix A.2 of [1] derives the formulas for constructing . In (3.23), is the endpoint function
[TABLE]
where and are constant Lagrange multiplier vectors enforcing the initial and final conditions, (3.10) and (3.11), respectively. In (3.23), is the Hamiltonian
[TABLE]
where is a time-varying Lagrange multiplier vector enforcing the dynamics (3.9). In (3.23), is an analytical formula expressing the control as a function of the state and the costate . The components of are given by
[TABLE]
for and where . In (3.23), is the regular Hamiltonian
[TABLE]
The reader is referred to [1] for a more general description of the ODE and DAE formulations, (3.4) and (3.19), of the rolling ball’s optimal control problem and the controlled equations of motion (3.23) correpsonding to (3.4). The DAE TPBVP encapsulating the controlled equations of motion corresponding to the DAE formulation (3.19) of the rolling ball’s optimal control problem were not investigated since a robust DAE TPBVP solver is not readily available in LAB. COLDAE is a robust DAE TPBVP solver that uses collocation [24]; however, COLDAE is only available in Fortran and thus was not used in our calculations.
@fb@secFB
3.2 Numerical Solutions: Sigmoid Obstacle Avoidance
The controlled equations of motion (3.23) for the rolling ball are solved numerically to move the ball between the pair of points while avoiding the pair of obstacles, where the obstacle avoidance function in (3.15) is realized via the time-reversed sigmoid function (2.3) with . The direct method solver PS-II is used to solve the DAE formulation (3.19) of the optimal control problem, where the obstacle heights appearing in the integrand cost function (3.15) are and where the values for the other integrand cost function coefficients are given in Table 3.6. Using this direct method solution as an initial guess, PS-II is used again to solve the ODE formulation (3.4) of the same optimal control problem. Predictor-corrector continuation is then used to solve the controlled equations of motion (3.23), starting from the second direct method solution. The continuation parameter is , which is used to adjust according to the linear homotopy shown in Table 3.6, so that when and when . The predictor-corrector continuation begins at , which is consistent with the direct method solution obtained at .
For the direct method, PS-II is run using the NLP solver SNOPT. The PS-II mesh error tolerance is 1\mathrm{e}\scalebox{0.75}[1.0]{-}6 and the SNOPT error tolerance is 1\mathrm{e}\scalebox{0.75}[1.0]{-}7. In order to encourage convergence of SNOPT, a constant is added to the integrand cost function in (3.15). The sweep predictor-corrector continuation method discussed in Appendix D is used by the indirect method. For the sweep predictor-corrector continuation method, there are predictor-corrector steps, the maximum tangent steplength in each step is , the direction of the initial unit tangent is determined by setting d=\scalebox{0.75}[1.0]{-}2 to force the continuation parameter to initially decrease, the relative error tolerance is 1\mathrm{e}\scalebox{0.75}[1.0]{-}6, the unit tangent solver is bvpc_m, and the monotonic “sweep” continuation solver is cc. The numerical results are shown in Figures 3.2, 3.3, and 3.4. As decreases from down to during continuation (see Figure 3.4a), increases from [math] up to (see Figure 3.4b). Since is ratcheted up during continuation, thereby increasing the penalty in the integrand cost function (3.15) when the GC intrudes into the obstacles, by the end of continuation, the ball’s GC avoids both obstacles while veering smartly around the first obstacle (compare Figures 3.2a vs 3.2b), at the expense of slightly larger magnitude controls (compare Figures 3.2e vs 3.2f). The ball does not detach from the surface since the magnitude of the normal force is always positive (see Figures 3.3a and 3.3b). The ball rolls without slipping if the coefficient of static friction is at least for the direct method solution (see Figure 3.3c) and if is at least for the indirect method solution (see Figure 3.3d). As shown in Figures 3.4a-3.4c, the sweep predictor-corrector continuation indirect method encounters turning points at solutions 3 and 4.
@fb@secFB
3.3 Numerical Solutions: Obstacle Avoidance
The controlled equations of motion (3.23) for the rolling ball are solved numerically again to move the ball between the pair of points while avoiding the pair of obstacles, but this time the obstacle avoidance function in (3.15) is realized via the cutoff function (3.16). With the obstacle heights appearing in the integrand cost function (3.15) set to and with the values for the other integrand cost function coefficients set according to Table 3.6, the same double pass (DAE formulation followed by ODE formulation) direct method, with all the same settings, parameters, and initial conditions, is used as in the previous subsection to generate the same initial solution. Starting from the direct method solution, two rounds of the same sweep predictor-corrector continuation method that was used in the previous subsection are again used here to solve the controlled equations of motion (3.23), with all the same settings and parameters, except for the number of predictor-corrector steps and maximum tangent steplengths used. In the first round, the continuation parameter is used to adjust according to the linear homotopy shown in Table 3.6, so that when and when . This predictor-corrector continuation begins at , which is consistent with the direct method solution obtained at . In the first round, two predictor-corrector steps are made with the maximum tangent steplengths . Starting from the predictor-corrector continuation solution obtained in the first round, a second predictor-corrector continuation is used to solve the controlled equations of motion (3.23), where the continuation parameter is , which is now used to adjust according to the linear homotopy shown in Table 3.7, so that when and \gamma_{1}=\gamma_{2}=\gamma_{3}=\scalebox{0.75}[1.0]{-}1{,}000 when . The second predictor-corrector continuation begins at , which is consistent with the first predictor-corrector continuation solution obtained at . Moreover, during the second predictor-corrector continuation, the obstacle heights are fixed at , which is consistent with the final obstacle heights obtained by the first predictor-corrector continuation solution. In the second continuation, four predictor-corrector steps are made with the maximum tangent steplengths .
The numerical results are shown in Figures 3.5, 3.6, and 3.7. As decreases from down to \scalebox{0.75}[1.0]{-}7.453\mathrm{e}{5} during the first round of predictor-corrector continuation, increases from [math] up to (see Figure 3.7a). Since is ratcheted up during continuation, thereby increasing the penalty in the integrand cost function (3.15) when the GC intrudes into the obstacles, by the end of continuation, the ball’s GC completely exits the second obstacle and approaches the boundary of the first obstacle (compare Figures 3.5a vs 3.5b). As decreases from down to during the second round of predictor-corrector continuation, decreases from down to (see Figure 3.7b). Since is ratcheted down during continuation, thereby decreasing the penalty in the integrand cost function (3.15) for large magnitude accelerations of the control mass parameterizations, and since the obstacle heights are held fixed at , by the end of continuation, the ball’s GC avoids both obstacles while veering smartly around the first obstacle (compare Figures 3.5b vs 3.5c). Figure 3.7c shows that the performance index increases from up to as the obstacle heights are ramped up in the first round of predictor-corrector continuation; Figure 3.7d shows that the performance index then decreases down to as the control coefficients are ramped down and the ball’s GC fully departs the tall obstacles in the second round of predictor-corrector continuation.
4 Summary, Discussion, and Future Work
The controlled equations of motion for the rolling disk and ball were solved numerically using predictor-corrector continuation, starting from an initial solution obtained via a direct method, to solve trajectory tracking problems for the rolling disk and obstacle avoidance problems for the rolling ball. These optimal control maneuvers were achieved by performing predictor-corrector continuation in weighting factors that scale penalty functions in the integrand cost function of the performance index.
This paper focused on the indirect, rather than direct, method to numerically solve the optimal control problems. Because the indirect and direct methods only converge to a local minimum solution near the initial guess, a robust continuation algorithm capable of handling turning points is needed to obtain indirect and direct method solutions of complicated, nonconvex optimal control problems. A continuation indirect method requires a continuation ODE or DAE TPBVP solver, while a continuation direct method requires a continuation NLP solver. Predictor-corrector continuation ODE TPBVP algorithms were presented in Appendices C and D and implemented in LAB to realize the continuation indirect method used to solve the rolling disk and ball optimal control problems. Even though predictor-corrector continuation NLP solver algorithms are provided in the literature (e.g. see [16, 17]), there do not seem to be any publicly available predictor-corrector continuation NLP solvers, which inhibited the use of a continuation direct method in this paper. When compared against the direct method, the indirect method suffers from two major deficiencies:
Unlike the direct method, the indirect method has a very small radius of convergence and therefore requires a very accurate initial solution guess [7, 6, 5]. Moreover, unlike the direct method, the indirect method requires a guess of the costates, which are unphysical. 2. 2.
Unlike the direct method, the indirect method is unable to construct the switching structure (i.e. the times when the states and/or controls enter and exit the boundary) of an optimal control problem having path inequality constraints.
Since predictor-corrector continuation was used in this paper, the first deficiency in the indirect method only applied when constructing the solution of the initial ODE TPBVP, and this deficiency was circumvented by using a direct method to solve the optimal control problem corresponding to that initial ODE TPBVP. To circumvent the second deficiency in the indirect method, path inequality constraints were incorporated into the optimal control problems as soft constraints through penalty functions in the integrand cost functions.
The predictor-corrector continuation methods presented in Appendices C and D work if the control can be expressed analytically as a function of the state and costate, e.g. if the Hamiltonian is quadratic in the control. That is, those methods perform continuation only in the state and costate after the original optimal control DAE TPBVP is transformed into an ODE TPBVP through elimination of the control. For more complicated Hamiltonians (such as when penalty functions are added to the integrand cost function to softly enforce bounded body frame accelerations of the control masses, the no-detachment constraint, and the no-slip constraint), numerical methods (such as Newton’s method) must be used to construct the control numerically from the state, costate, and a good initial guess of the control. In these cases, the predictor-corrector continuation method of Appendix C must be extended to perform continuation in the state, costate, and control by solving the optimal control DAE TPBVP. This will be investigated in subsequent work.
In future work, instead of using LAB, the simulation code could be reimplemented in the higher performance programming languages Julia or C++, while relying on Fortran routines like COLNEW [25], COLMOD [26], TWPBVP(C) [27, 28], TWPBVPL(C) [29, 30], and ACDC(C) [26, 15] to solve the underlying ODE TPBVPs, to obtain faster numerical results. Julia and C++ feature several mature and efficient automatic differentiation libraries [31] capable of constructing the Jacobians and Hessians needed by the ODE TPBVP solvers. In addition, a more efficient and robust predictor-corrector adaptive tangent steplength algorithm, such as described in [32, 33], could be implemented.
Another avenue for future investigation is to use a neighboring extremal optimal control (NEOC) method [34], which constructs a homotopy between the controlled equations of motion and their linearization about a nominal solution; however, the NEOC method in [34] could be made more robust by using predictor-corrector, rather than monotonic, continuation in the homotopy parameter. Yet another avenue for future investigation is to perform predictor-corrector continuation in a weighting factor that scales a term in the endpoint cost function measuring the deviation between the actual and prescribed final conditions.
Additionally, throughout the paper we have kept the initial and final times fixed. It would be interesting to perform additional studies when the time duration is free, as outlined in Appendix A, especially regarding problems of navigation over complex terrains and slippery surfaces. Complex terrains will affect both the uncontrolled equations of motion, due to gravity, and the performance index, for example, through potential energy penalty functions that discourage the ball from ascending steep slopes. If the substrate is slippery, for example, due to the presence of moisture, one can imagine situations where the valleys are wet and the slopes are dry and thus less slippery. Then, one can introduce an additional term in the performance index penalizing motion through the valleys where the possibility of a slip is high. The interplay between the terms in the performance index discouraging and encouraging motion up the slopes will give a very interesting control system. These and other interesting questions will be considered in future work.
Acknowledgements
We are indebted to our colleagues A.M. Bloch, D.M. de Diego, F. Gay-Balmaz, D.D. Holm, M. Leok, A. Lewis, T. Ohsawa, and D.V. Zenkov for useful and fruitful discussions. M.J. Weinsten provided copious advice on using the LAB automatic differentiation toolbox Gator and fixed numerous bugs in Gator that were revealed in the course of this research. A.V. Rao provided a free license to use the LAB direct method optimal control solver PS-II for some of this research. P. Tallapragada observed that the reaction forces exerted on the ball by the accelerating internal point masses may cause the ball to detach from the surface, which prompted the inclusion of plots depicting the normal force and minimum coefficient of static friction. G.M. Rozenblat pointed out the necessary and sufficient conditions that must be satisfied by a ball’s physical parameters in [18].
This research was partially supported by the NSERC Discovery Grant, the University of Alberta Centennial Fund, and the Alberta Innovates Technology Funding (AITF) which came through the Alberta Centre for Earth Observation Sciences (CEOS). S.M. Rogers also received support from the University of Alberta Doctoral Recruitment Scholarship, the FGSR Graduate Travel Award, the IGR Travel Award, the GSA Academic Travel Award, the AMS Fall Sectional Graduate Student Travel Grant, Target Corporation, and the Institute for Mathematics and its Applications at the University of Minnesota, Twin Cities.
Appendix A Optimal Control: Variational Pontryagin’s Minimum Principle
This appendix presents necessary conditions, called the variational Pontryagin’s minimum principle, which a solution to an optimal control problem lacking path inequality constraints must satisfy; there is a more general version of Pontryagin’s minimum principle that applies to optimal control problems possessing path inequality constraints. In this paper, these necessary conditions, in the context of describing the optimal control of the rolling ball, are referred to as the controlled equations of motion. In the literature, application of Pontryagin’s minimum principle to solve an optimal control problem is called the indirect method. Let . Let be a prescribed or free initial time and let be such that if is prescribed and if is free. Let be a prescribed or free final time and let be such that if is prescribed and if is free. Suppose a dynamical system has state and control and the control is sought that minimizes the performance index
[TABLE]
subject to the system dynamics defined for
[TABLE]
the prescribed initial conditions at time
[TABLE]
and the prescribed final conditions at time
[TABLE]
is a scalar-valued function called the endpoint cost function, is a scalar-valued function called the integrand cost function, and are vector-valued functions, is an vector-valued function, is a vector-valued function, and is a vector-valued function. is a prescribed scalar parameter which may be exploited to numerically solve this problem via continuation. More concisely, this optimal control problem may be stated as
[TABLE]
Observe that the optimal control problem encapsulated by (A.5) ignores path inequality constraints such as , where is an vector-valued function for . Path inequality constraints can be incorporated into (A.5) as soft constraints through penalty functions in the integrand cost function or the endpoint cost function . By omitting hard path inequality constraints from (A.5), a solution of (A.5) does not lie on the boundary of a compact set and the calculus of variations may be applied to derive necessary conditions, called the variational Pontryagin’s minimum principle, which a solution of (A.5) must satisfy.
Define the endpoint function and the Hamiltonian by
[TABLE]
where is a constant Lagrange multiplier vector, is a constant Lagrange multiplier vector, and is an time-varying Lagrange multiplier vector. In the literature, the time-varying Lagrange multiplier vector used to adjoin the system dynamics to the integrand cost function is often called the adjoint variable or the costate. Henceforth, the time-varying Lagrange multiplier vector is referred to as the costate and the elements in this vector are referred to as the costates. The necessary conditions [35] on , , and which a solution of (A.5) must satisfy are the DAEs defined for
[TABLE]
the left boundary conditions defined at time
[TABLE]
and the right boundary conditions defined at time
[TABLE]
If the initial time is prescribed, then the left boundary condition is dropped. If the final time is prescribed, then the right boundary condition is dropped. The necessary conditions (A.7), (A.8), and (A.9) constitute a differential-algebraic equation two-point boundary value problem (DAE TPBVP).
If is nonsingular, then the optimal control problem is said to be regular or nonsingular; otherwise if is singular, then the optimal control problem is said to be singular. If is nonsingular, then by the implicit function theorem, the algebraic equation in (A.7) guarantees the existence of a unique function, say , for which
[TABLE]
If is nonsingular, it may be possible to solve the algebraic equation in (A.7) analytically for in terms of , , , and to construct explicitly in (A.10); otherwise, the value of in (A.10) may be constructed numerically in an efficient and accurate manner (with quadratic convergence) via a few iterations of Newton’s method applied to starting from an initial guess of :
[TABLE]
Using (A.10), the Hamiltonian may be re-expressed as a function of , , , and via the regular or reduced Hamiltonian
[TABLE]
Note that by construction of ,
[TABLE]
By using the definition (A.12) of the regular Hamiltonian , invoking (A.13), and defining
[TABLE]
it follows from the chain rule that
[TABLE]
[TABLE]
[TABLE]
and
[TABLE]
By using (A.10) to eliminate the algebraic equation from (A.7), by plugging (A.17) and (A.16) into the right hand sides of the ODEs in (A.7), and by plugging the definition (A.12) into the left and right boundary conditions (A.8) and (A.9), the necessary conditions on and which a solution of (A.5) must satisfy are the ODEs defined for
[TABLE]
the left boundary conditions defined at time
[TABLE]
and the right boundary conditions defined at time
[TABLE]
If the initial time is prescribed, then the left boundary condition is dropped. If the final time is prescribed, then the right boundary condition is dropped. The necessary conditions (A.19), (A.20), and (A.21) constitute an ODE TPBVP. Appendix B provides implementation details for numerically solving the ODE TPBVP (A.19), (A.20), and (A.21).
A solution of the DAE TPBVP (A.7), (A.8), and (A.9) or of the ODE TPBVP (A.19), (A.20), and (A.21) is said to be an extremal solution of the optimal control problem (A.5). Note that an extremal solution only satisfies necessary conditions for a minimum of the optimal control problem (A.5), so that an extremal solution is not guaranteed to be a local minimum of (A.5).
Since the DAE TPBVP (A.7), (A.8), and (A.9) and the ODE TPBVP (A.19), (A.20), and (A.21) have small convergence radii [5, 6, 7], a continuation method (performing continuation in the parameter ) is often required to numerically solve them starting from a solution to a simpler optimal control problem [36]. The solution to the simpler optimal control problem might be obtained via analytics, the gradient method [5, 6], the method of successive approximations [37, 38, 39, 40], or the direct method [7, 8]. For example in [41], the continuation parameter is used to vary integrand cost function coefficients in in order to numerically solve the optimal control ODE TPBVPs for Suslov’s problem via monotonic continuation, starting from an analytical solution to a singular optimal control problem. In Sections 2 and 3, the continuation parameter is used to vary integrand cost function coefficients in in order to numerically solve the optimal control ODE TPBVPs for the rolling disk and ball via predictor-corrector continuation, starting from a direct method solution to a simpler optimal control problem. Appendices C and D describe predictor-corrector continuation methods for solving ODE TPBVPs and which are used to solve the optimal control ODE TPBVPs for the rolling disk and ball in Sections 2 and 3.
Appendix B Implementation Details for Solving the ODE TPBVP for a Regular Optimal Control Problem
Details for numerically solving the ODE TPBVP (A.19), (A.20), and (A.21) associated with the indirect method solution of a regular optimal control problem are presented here. There are two general methods, initial value and global, for numerically solving an ODE TPBVP. An initial value method, such as single or multiple shooting, subdivides the integration interval into a fixed, finite mesh and integrates the ODE on each mesh subinterval using a guess of the unknown initial conditions at one endpoint in each mesh subinterval. A root-finder is used to iteratively adjust the guesses of the unknown initial conditions until the solution segments are continuous at the internal mesh points and until the boundary conditions at the endpoints and are satisfied. A global method, such as a Runge-Kutta, collocation, or finite-difference scheme, subdivides the integration interval into a finite, adaptive mesh and solves a large nonlinear system of algebraic equations obtained by imposing the ODE constraints at a finite set of points in each mesh subinterval, by imposing continuity of the solution at internal mesh points, and by imposing the boundary conditions at the endpoints and . By estimating the error in each mesh subinterval, a global method iteratively refines or adapts the mesh until a prescribed error tolerance is satisfied. Because initial value methods cannot integrate unstable ODEs, global methods are preferred [36, 42, 43].
@fb@secFB
B.1 Normalization and ODE Velocity Function
There are many solvers available to numerically solve the ODE TPBVP (A.19), (A.20), and (A.21). For example, 4c [44], 5c [45], p [14], and twp [15] (which encapsulates bvp_m, bvpc_m, bvp_l, bvpc_l, c, and cc) are LAB Runge-Kutta or collocation ODE TPBVP solvers, while COLSYS [46], COLNEW [25], COLMOD [26], COLCON [32], BVP_M-2 [47], TWPBVP [27], TWPBVPC [28], TWPBVPL [29], TWPBVPLC [30], ACDC [26], and ACDCC [15] are Fortran Runge-Kutta or collocation ODE TPBVP solvers. The reader is referred to the Appendix in [41] for a comprehensive list of ODE TPBVP solvers. In order to numerically solve the ODE TPBVP (A.19), (A.20), and (A.21), many solvers (such as the global method LAB and Fortran solvers just listed) require that the ODE TPBVP be defined on a fixed time interval and any unknown parameters, such as , , , and , must often be modeled as dummy constant dependent variables with zero derivatives. In addition, to aid convergence, many solvers can exploit Jacobians of the ODE velocity function and of the two-point boundary condition function. Thus, (A.19) is redefined on the normalized time interval through the change of independent variable , where . Note that . Define the normalized state and normalized costate . Define the expanded un-normalized ODE TPBVP dependent variable vector
[TABLE]
Defining , the expanded normalized ODE TPBVP dependent variable vector is
[TABLE]
By the chain rule, (A.19), and since ,
[TABLE]
Define to be the right-hand side of (B.3), i.e. the normalized ODE velocity function, so that
[TABLE]
The Jacobian of with respect to is
[TABLE]
and the Jacobian of with respect to is
[TABLE]
In (B.5) and (B.6), shorthand notation is used for conciseness and all zeroth and first derivatives of and all first and second derivatives of are evaluated at . An explanation of the meaning of the shorthand notation used to express all zeroth and first derivatives of and all first and second derivatives of is given in Table B.8. In rows through and columns through of (B.5), Clairaut’s Theorem was used to obtain , recalling from (A.17) that .
Recall that is defined in (A.14) in terms of and . By using the chain rule, the first derivatives of that appear in (B.5), (B.6), and Table B.8 may be computed from first derivatives of and as follows:
[TABLE]
[TABLE]
[TABLE]
and
[TABLE]
Recall that by construction of , , as stated previously in (A.13). Differentiating with respect to , , , and , in turn, and using the chain rule gives
[TABLE]
[TABLE]
[TABLE]
and
[TABLE]
(B.11), (B.12), (B.13), and (B.14) may be solved for , , , and , respectively:
[TABLE]
[TABLE]
[TABLE]
and
[TABLE]
In (B.15), Clairaut’s Theorem was used to obtain , since . As will be stated again later, (B.15), (B.16), (B.17), and (B.18) are especially useful if the value of is constructed numerically via Newton’s method as in (A.11); if is given analytically, then it should be possible to construct , , , and via manual, symbolic, or automatic differentiation of the analytical formula for .
Since Clairaut’s Theorem guarantees that
[TABLE]
and
[TABLE]
(B.12) may be solved for :
[TABLE]
By differentiating (A.16) with respect to , , and , using the chain rule, and exploiting (B.21), the second derivatives of that appear in (B.5), (B.6), and Table B.8 may be computed from first derivatives of and second derivatives of as follows:
[TABLE]
[TABLE]
and
[TABLE]
If the value of is constructed numerically via Newton’s method as in (A.11) rather than analytically, then (B.15), (B.16), (B.17), and (B.18) should be used to evaluate , , , and , which appear in the formulas for given in (B.7), given in (B.8), given in (B.9), given in (B.10), given in (B.22), given in (B.23), and given in (B.24). The second equation in (B.22), (B.23), and (B.24) is given because it may be more computationally efficient than the first equation if is given analytically, so that (B.15), (B.16), (B.17), and (B.18) need not be used to evaluate , , , and .
@fb@secFB
B.2 Two-Point Boundary Condition Function
Now the boundary conditions (A.20)-(A.21) are considered. Letting
[TABLE]
[TABLE]
and
[TABLE]
the boundary conditions (A.20)-(A.21) in un-normalized dependent variables are given by the two-point boundary condition function
[TABLE]
The Jacobians of with respect to , , and are
[TABLE]
[TABLE]
and
[TABLE]
where
[TABLE]
[TABLE]
[TABLE]
[TABLE]
[TABLE]
and
[TABLE]
In equations (B.32), (B.33), and (B.34), and all first derivatives of in row are evaluated at as shown in Table B.9, all first derivatives of in rows through are evaluated at as shown in Table B.10, and all first derivatives of in row are evaluated at as shown in Table B.11, and all first derivatives of in rows through are evaluated at as shown in Table B.12. Since , in row and columns through of (B.32) and in row and columns through of (B.33). In equations (B.35), (B.36), and (B.37), all second derivatives of are evaluated at , while all first derivatives of and are evaluated at and , respectively, as shown in Tables B.10 and B.12. To simplify (B.35) and (B.36), Clairaut’s Theorem, , and are used to get , , , , , , , and .
To express the boundary conditions (A.20)-(A.21) in terms of normalized dependent variables, let , , and . Thus
[TABLE]
[TABLE]
and
[TABLE]
and the boundary conditions (A.20)-(A.21) in normalized dependent variables are given by the normalized two-point boundary condition function
[TABLE]
The Jacobians of with respect to , , and are
[TABLE]
[TABLE]
and
[TABLE]
where the equality between the Jacobians of , , and with respect to , , and and the Jacobians of , , and with respect to , , and is given in Table B.13.
Special care must be taken when implementing the Jacobians (B.42) and (B.43). Since the unknown constants , , , and appear at the end of both and , the unknown constants from only one of and are actually used to construct each term in involving , , , and . The trailing columns in (B.42) are actually the Jacobian of with respect to , , , and in , while the trailing columns in (B.43) are actually the Jacobian of with respect to , , , and in . Thus, the trailing columns in (B.42) and (B.43) corresponding to the Jacobian of with respect to , , , and should not coincide in a software implementation. For example, if the unknown constants are extracted from to construct , is as shown in (B.42) while the trailing columns in (B.43) corresponding to the Jacobian of with respect to the unknown constants in should be all zeros. Alternatively, if the unknown constants are extracted from to construct , is as shown in (B.43) while the trailing columns in (B.42) corresponding to the Jacobian of with respect to the unknown constants in should be all zeros.
@fb@secFB
B.3 Final Details
In equations (B.1), (B.2), (B.3), (B.4), and (B.6), the second to last row is needed only if the initial time is free and the last row is needed only if the final time is free. In equation (B.5), the second to last row and column are needed only if the initial time is free and the last row and column are needed only if the final time is free.
In equations (B.25), (B.26), (B.27), (B.28), (B.31), (B.34), (B.37), (B.38), (B.39), (B.40), (B.41), and (B.44) the first row is needed only if the initial time is free and row is needed only if the final time is free. In equations (B.29), (B.30), (B.32), (B.33), (B.35), (B.36), (B.42), and (B.43) the first row and second to last column are needed only if the initial time is free and row and the last column are needed only if the final time is free.
In order to numerically solve the ODE TPBVP (A.19), (A.20), and (A.21) without continuation or with a monotonic continuation solver (such as c or cc), the solver should be provided (B.4), (B.5), (B.40), (B.42), and (B.43). In order to numerically solve the ODE TPBVP (A.19), (A.20), and (A.21) with a non-monotonic continuation solver (such as the predictor-corrector methods discussed in Appendices C and D), the solver should be provided (B.4), (B.5), (B.6), (B.40), (B.42), (B.43), and (B.44).
The first and second derivatives required to construct (B.4), (B.5), (B.6), (B.40), (B.42), (B.43), and (B.44) are generally quite tedious to derive manually. Instead, symbolic differentiation [48], complex/bicomplex step differentiation [49, 50, 51, 52], dual/hyper-dual numbers [53, 54, 55, 56], and automatic differentiation [57, 58] are computational alternatives. If fact, it may be shown that the use of dual/hyper-dual numbers to compute first and second derivatives is equivalent to automatic differentiation [56]. While symbolic differentiation suffers from expression explosion and complex/bicomplex step differentiation only applies to real analytic functions, dual/hyper-dual numbers and automatic differentiation are more robust and broadly-applicable.
Therefore, while (B.4), (B.5), (B.6), (B.40), (B.42), (B.43), and (B.44) are complicated, they may be readily constructed numerically through automatic differentiation of , , , , , and if is given analytically and of , , , , and if the value of is constructed numerically via Newton’s method as in (A.11). There are many free automatic differentiation toolboxes available [31], such as the LAB automatic differentiation toolbox Gator [12, 13]. Moreover, Gator is able to construct vectorized automatic derivatives, which is extremely useful for realizing the vectorized version of (B.4), (B.5), and (B.6), as the non-vectorized version of these equations execute too slowly in LAB to solve the ODE TPBVP (A.19), (A.20), and (A.21) in a timely manner.
Appendix C Predictor-Corrector Continuation Method for Solving an ODE TPBVP
@fb@secFB
C.1 Introduction
Suppose it is desired to solve the ODE TPBVP:
[TABLE]
where are prescribed with , is the independent variable, is the prescribed number of dependent variables in , is an unknown function which must be solved for, is a prescribed scalar parameter, is a prescribed ODE velocity function defining the velocity of , and is a prescribed two-point boundary condition function. Observe that if , , , and are scalar-valued functions, while if , , , and are vector-valued functions. The Jacobian of with respect to is and the Jacobian of with respect to is . The Jacobian of with respect to is , the Jacobian of with respect to is , and the Jacobian of with respect to is . If is linear in and is linear in and , then (C.1) is said to be a linear ODE TPBVP; otherwise, (C.1) is said to be a nonlinear ODE TPBVP.
Note that a solution to (C.1) depends on the given value of the scalar parameter , so a solution to (C.1) will be denoted by the pair . Usually it is not possible to solve (C.1) analytically. Instead, a numerical method such as a shooting, finite-difference, or Runge-Kutta method (collocation is a special kind of Runge-Kutta method) must be utilized to construct an approximate solution to (C.1). All such numerical methods require an initial solution guess and convergence to a solution is guaranteed only if the initial solution guess is sufficiently near the solution. Thus, solving (C.1) numerically requires construction of a good initial solution guess.
One way to construct a good initial solution guess for (C.1) is through continuation in the scalar parameter . If solves (C.1) and it is desired to solve (C.1) for , it may be possible to construct a finite sequence of solutions starting at the known solution and ending at the desired solution , using the previous solution as an initial solution guess for the numerical solver to obtain the next solution , , in the sequence. denotes the number of solutions in the sequence after the known solution.
This appendix describes a particular such continuation method, called predictor-corrector continuation, for solving (C.1). The treatment given here follows [59]. In the literature, predictor-corrector continuation is also called path-following [60], predictor-corrector path-following [61], and differential path-following [62]. AUTO [63], COLCON [32], and the algorithm presented in [64] are Fortran predictor-corrrector continuation codes, while suite1.1 [65], bfun’s lowpath [59], and O [66] are LAB predictor-corrrector continuation codes. All these codes rely on global methods for solving ODE BVPs (e.g. Runge-Kutta, collocation, and finite-difference schemes), which are more robust than initial value methods for solving ODE BVPs (i.e. single and multiple shooting) because initial value methods cannot integrate unstable ODEs [36, 42, 43].
Before delving into the details, some functional analysis is reviewed which is necessary to understand how the predictor-corrector continuation method is applied to solve (C.1).
@fb@secFB
C.2 A Hilbert Space
Let . is a Hilbert space over . If and , then
[TABLE]
the inner product on is
[TABLE]
and the norm on , induced by the inner product, is
[TABLE]
and are said to be orthogonal iff , and is said to be of unit length iff .
@fb@secFB
C.3 The Fréchet Derivative and Newton’s Method
Given a function , recall that ordinary vector calculus defines the Jacobian of as the function such that is the linearization of at . Given normed vector spaces and and an open subset of , the Fréchet derivative is an extension of the Jacobian to an operator . Before giving the definition of the Fréchet derivative, recall that denotes the space of continuous linear operators from to . Now for the definition of the Fréchet derivative, which comes from Definition 2.2.4 of [59].
Definition C.3.1
Suppose that and are normed vector spaces, and let be an open subset of . Then the operator is said to be Fréchet differentiable at if and only if there exists an operator such that
[TABLE]
The operator is then called the Fréchet derivative of at , often denoted by . If is Fréchet differentiable at all points in , is said to be Fréchet differentiable in .
Given a function , Newton’s method is an algorithm to solve for and when satisfies certain mild conditions. Starting from an initial solution guess sufficiently close to a solution, Newton’s method converges to a solution of by iteratively solving the equations
[TABLE]
starting at , where denotes the Jacobian of and for . The iteration in (C.6) continues until (or ) or until exceeds a maximum iteration threshold.
Now consider an operator , where and are Banach spaces and is an open subset of . Kantorovich [67] provided an extension of Newton’s method to solve for and when satisfies certain mild conditions. Starting from an initial solution guess sufficiently close to a solution, Kantorovich’s extension of Newton’s method converges to a solution of by iteratively solving the equations
[TABLE]
starting at , where denotes the Fréchet derivative of and for . The iteration in (C.7) continues until (or ) or until exceeds a maximum iteration threshold.
@fb@secFB
C.4 The Davidenko ODE IVP
To motivate the predictor-corrector continuation method, the Davidenko ODE IVP is first presented. Let denote the solution manifold of (C.1). Suppose the solution manifold is parameterized by arclength , so that an element of is , the tangent to at satisfies (i.e. is a unit tangent), and the solution manifold can be described as a solution curve. With this arclength parameterization, , , , , is shorthand for , and is shorthand for . Note that the components of the unit tangent to at are given explicitly by and .
The Fréchet derivative of the ODE TPBVP (C.1) with respect to about the solution , in conjunction with the arclength constraint and the initial condition , gives the nonlinear ODE IVP in the independent arclength variable :
[TABLE]
which must be solved for starting at from an initial solution of (C.1). (C.8) is called the Davidenko ODE IVP and its solution is called the Davidenko flow [68, 69, 70, 33, 59, 71]. The first two equations in (C.8) constitute the Fréchet derivative of the ODE TPBVP (C.1), the third equation is the arclength constraint, and the final equation is the initial condition. By introducing a dummy scalar-valued function to represent the integrand of the arclength constraint, (C.8) can be re-written:
[TABLE]
Again, letting vary, (C.9) is a nonlinear ODE IVP which must be solved for (i.e. and ) starting at from an initial solution of (C.1). However, for a fixed , (C.9) is a nonlinear ODE TPBVP which must be solved for , , and and where the independent variable is .
As explained in Chapter 5 of [33], it is inadvisable to integrate the Davidenko ODE IVP (C.8), or equivalently (C.9). Instead, a predictor-corrector continuation method, depicted in Figure C.1 and explained in detail in the following subappendices, is used to generate a solution sequence which is a discrete subset of the Davidenko flow such that .
@fb@secFB
C.5 Construct the Tangent
Given a solution to (C.1) and a unit tangent to the previous solution to (C.1), we seek to construct a tangent to the solution curve at which is roughly of unit length. The arclength constraint is
[TABLE]
which is nonlinear in the tangent . An alternative constraint, the pseudo-arclength constraint, is
[TABLE]
which, in contrast to the arclength constraint (C.10), is linear in the tangent . The linearization (i.e. Fréchet derivative) of the ODE TPBVP (C.1) about the solution , in conjunction with the pseudo-arclength condition (C.11), gives the linear ODE TPBVP:
[TABLE]
which must be solved for , , and and where is a tangent to at . Note that the first, second, and third equations in (C.12) are the ODEs, while the fourth, fifth, and sixth equations constitute the boundary conditions. The first, second, and fourth equations in (C.12) are the linearization (i.e. Fréchet derivative) of (C.1) about the solution and ensure that a tangent is produced, while the third, fifth, and sixth equations in (C.12) enforce the pseudo-arclength condition (C.11). The initial solution guess to solve (C.12) is and , , for . For , define . Note that the construction of the initial guess for can be realized efficiently via the LAB routine trapz.
Note that the linear ODE TPBVP (C.12) can be solved numerically via the LAB routines p or twp, which offers 4 algorithms: bvp_m, bvpc_m, bvp_l, and bvpc_l; moreover, p and twp have special algorithms to solve linear ODE TPBVPs. Since and are usually only known at a discrete set of points in , the values of these functions at the other points in must be obtained through interpolation in order to numerically solve (C.12). The LAB routine erp1 performs linear, cubic, pchip, makima, and spline interpolation and may be utilized to interpolate and while solving (C.12).
Because the numerical solvers usually converge faster when provided Jacobians of the ODE velocity function and of the two-point boundary condition function, these are computed below. Let
[TABLE]
The ODE velocity function in (C.12) is
[TABLE]
The Jacobian of the ODE velocity function with respect to is
[TABLE]
The two-point boundary condition in (C.12) is
[TABLE]
where is the two-point boundary condition function
[TABLE]
The Jacobians of the two-point boundary condition function with respect to and are
[TABLE]
and
[TABLE]
Special care must be taken when implementing the Jacobians (C.18) and (C.19). Since the unknown constant appears as the second to last element of both and , from only one of and is actually used to construct each term in involving . The middle column of (C.18) is actually the derivative of with respect to the in , while the middle column of (C.19) is actually the derivative of with respect to the in . Thus, the middle columns in (C.18) and (C.19) corresponding to the derivative of with respect to should not coincide in a software implementation. For example, if is constructed from the in , is as shown in (C.18) while the middle column of (C.19) corresponding to the derivative of with respect to the in is all zeros. Alternatively, if is constructed from the in , is as shown in (C.19) while the middle column of (C.18) corresponding to the derivative of with respect to the appearing in is all zeros.
@fb@secFB
C.6 Normalize the Tangent
The tangent at obtained by solving (C.12) in the previous step is only roughly of unit length. A unit tangent at is obtained from through normalization:
[TABLE]
where
[TABLE]
The integration operator to construct the normalization scalar in (C.21) can be realized via the LAB routine pz.
@fb@secFB
C.7 Construct the Tangent Predictor
The unit tangent constructed in (C.20) is used to obtain a guess (the so-called “tangent predictor”) for the next solution as follows:
[TABLE]
where is a steplength and where . Concretely, might be and might be . is adapted during the predictor-corrector continuation method based on the corrector step, discussed in the next subappendix. Initially, the value of is set to . The notation is used to denote the tangent predictor in (C.22) because, as discussed in the next subappendix, the tangent predictor is used as the initial corrector in an iterative Newton’s method that projects the tangent predictor onto .
@fb@secFB
C.8 Construct the Corrector
Since the tangent predictor constructed in (C.22) does not necessarily lie on , must be projected onto to obtain the next solution (the so-called “corrector”) . This projection process is the corrector step. In order to perform the projection efficiently, the difference between the next solution and the tangent predictor, , should be orthogonal to the unit tangent . That is, the orthogonality constraint is
[TABLE]
The tangent predictor can be iteratively corrected by applying Newton’s method to (C.1), while enforcing the orthogonality constraint (C.23), to generate a sequence of correctors . Applying Newton’s method to the ODE TPBVP (C.1) about the current corrector , in conjunction with the orthogonality constraint (C.23), gives the linear ODE TPBVP:
[TABLE]
which must be solved for , , and and where represents a correction to the current corrector . Note that the first, second, and third equations in (C.24) are the ODEs, while the fourth, fifth, and sixth equations constitute the boundary conditions. The first, second, and fourth equations in (C.24) are the result of applying Newton’s method to (C.1) about the current corrector , while the third, fifth, and sixth equations in (C.24) enforce the orthogonality constraint (C.23). (C.24) must be solved iteratively for at most iterations, so that . The initial solution guess to solve (C.24) at the beginning of each iteration is and , . The initial corrector about which Newton’s method is applied in the first iteration is the tangent predictor . At the end of each iteration, the corrector about which Newton’s method is applied for the next iteration is updated via . At the end of each iteration, convergence to should be tested via:
[TABLE]
where is a small threshold such as . Since Newton’s method enjoys quadratic convergence near a solution, only a few (say ) iterative solves of (C.24) should be attempted. If convergence has not been attained in iterations, the steplength should be reduced:
[TABLE]
where is a reduction scale factor such as and the corrector step should be restarted at the new tangent predictor , based on the updated value of realized in (C.26). If, as a result of the reduction realized in (C.26), , the algorithm should halt and predictor-corrector continuation failed. However, if convergence has been achieved in iterations, the next solution can be taken to be or the corrector can be further polished as explained in the next subappendix. Moreover, if convergence has been achieved rapidly in no more than iterations, where and, concretely, might be 3, then the steplength may be increased:
[TABLE]
where is an increase scale factor such as .
Note that the linear ODE TPBVP (C.24) can be solved numerically via the LAB routines p or twp, which offers 4 algorithms: bvp_m, bvpc_m, bvp_l, and bvpc_l; moreover, p and twp have special algorithms to solve linear ODE TPBVPs. Since , , and are usually only known at a discrete set of points in , the values of these functions at the other points in must be obtained through interpolation in order to numerically solve (C.24). The LAB routine erp1 performs linear, cubic, pchip, makima, and spline interpolation and may be utilized to interpolate , , and while solving (C.24).
Because the numerical solvers usually converge faster when provided Jacobians of the ODE velocity function and of the two-point boundary condition function, these are computed below. Let
[TABLE]
The ODE velocity function in (C.24) is
[TABLE]
The Jacobian of the ODE velocity function with respect to is
[TABLE]
The two-point boundary condition in (C.24) is
[TABLE]
where is the two-point boundary condition function
[TABLE]
The Jacobians of the two-point boundary condition function with respect to and are
[TABLE]
and
[TABLE]
Special care must be taken when implementing the Jacobians (C.33) and (C.34). Since the unknown constant appears as the second to last element of both and , from only one of and is actually used to construct each term in involving . The middle column of (C.33) is actually the derivative of with respect to the in , while the middle column of (C.34) is actually the derivative of with respect to the in . Thus, the middle columns in (C.33) and (C.34) corresponding to the derivative of with respect to should not coincide in a software implementation. For example, if is constructed from the in , is as shown in (C.33) while the middle column of (C.34) corresponding to the derivative of with respect to the in is all zeros. Alternatively, if is constructed from the in , is as shown in (C.34) while the middle column of (C.33) corresponding to the derivative of with respect to the appearing in is all zeros.
@fb@secFB
C.9 Polish the Corrector
The final corrector from the previous step can be further polished by finding that solves (C.1) while satisfying the orthogonality constraint (C.23). This yields the ODE TPBVP:
[TABLE]
which must be solved for , , and . Note that the first, second, and third equations in (C.35) are the ODEs, while the fourth, fifth, and sixth equations constitute the boundary conditions. The first, second, and fourth equations in (C.35) ensure that the solution lies on (i.e. satisfies (C.1)), while the third, fifth, and sixth equations in (C.35) enforce the orthogonality constraint (C.23). The initial solution guess to solve (C.35) is the final corrector from the previous step and , .
Note that the ODE TPBVP (C.35) can be solved numerically via the LAB routines p or twp, which offers 4 algorithms: bvp_m, bvpc_m, bvp_l, and bvpc_l. Since and are usually only known at a discrete set of points in , the values of these functions at the other points in must be obtained through interpolation in order to numerically solve (C.35). The LAB routine erp1 performs linear, cubic, pchip, makima, and spline interpolation and may be utilized to interpolate and while solving (C.35).
Because the numerical solvers usually converge faster when provided Jacobians of the ODE velocity function and of the two-point boundary condition function, these are computed below. Let
[TABLE]
The ODE velocity function in (C.35) is
[TABLE]
The Jacobian of the ODE velocity function with respect to is
[TABLE]
The two-point boundary condition in (C.35) is
[TABLE]
where is the two-point boundary condition function
[TABLE]
The Jacobians of the two-point boundary condition function with respect to and are
[TABLE]
and
[TABLE]
Special care must be taken when implementing the Jacobians (C.41) and (C.42). Since the unknown constant appears as the second to last element of both and , from only one of and is actually used to construct each term in involving . The middle column of (C.41) is actually the derivative of with respect to the in , while the middle column of (C.42) is actually the derivative of with respect to the in . Thus, the middle columns in (C.41) and (C.42) corresponding to the derivative of with respect to should not coincide in a software implementation. For example, if is constructed from the in , is as shown in (C.41) while the middle column of (C.42) corresponding to the derivative of with respect to the in is all zeros. Alternatively, if is constructed from the in , is as shown in (C.42) while the middle column of (C.41) corresponding to the derivative of with respect to the appearing in is all zeros.
@fb@secFB
C.10 Pseudocode for Predictor-Corrector Continuation
Below is pseudocode that realizes the predictor-corrector continuation method.
Appendix D Sweep Predictor-Corrector Continuation Method for Solving an ODE TPBVP
@fb@secFB
D.1 Introduction
In this appendix, an alternative predictor-corrector continuation method is presented that exploits a monotonic continuation ODE TPBVP solver, such as twp’s c or cc, to monotonically increase (i.e. sweep) the tangent steplength from [math] up until a maximum threshold is reached or until the next turning point is reached.
@fb@secFB
D.2 Construct the Tangent
Given a solution to (C.1), we seek to construct a unit tangent to the solution curve at . Recall the arclength constraint
[TABLE]
The linearization (i.e. Fréchet derivative) of the ODE TPBVP (C.1) about the solution , in conjunction with the arclength constraint (D.1), gives the nonlinear ODE TPBVP:
[TABLE]
which must be solved for , , and and where is a unit tangent to at . Note that the first, second, and third equations in (D.2) are the ODEs, while the fourth, fifth, and sixth equations constitute the boundary conditions. The first, second, and fourth equations in (D.2) are the linearization (i.e. Fréchet derivative) of (C.1) about the solution and ensure that a tangent is produced, while the third, fifth, and sixth equations in (D.2) enforce the arclength constraint (D.1) ensuring that the tangent is of unit length. The initial solution guess to solve (D.2) is and , .
Note that the ODE TPBVP (D.2) can be solved numerically via the LAB routines p or twp, which offers 4 algorithms: bvp_m, bvpc_m, bvp_l, and bvpc_l. Since is usually only known at a discrete set of points in , the values of this function at the other points in must be obtained through interpolation in order to numerically solve (D.2). The LAB routine erp1 performs linear, cubic, pchip, makima, and spline interpolation and may be utilized to interpolate while solving (D.2).
Because the numerical solvers usually converge faster when provided Jacobians of the ODE velocity function and of the two-point boundary condition function, these are computed below. Let
[TABLE]
The ODE velocity function in (D.2) is
[TABLE]
The Jacobian of the ODE velocity function with respect to is
[TABLE]
The two-point boundary condition in (D.2) is
[TABLE]
where is the two-point boundary condition function
[TABLE]
The Jacobians of the two-point boundary condition function with respect to and are
[TABLE]
and
[TABLE]
Special care must be taken when implementing the Jacobians (D.8) and (D.9). Since the unknown constant appears as the second to last element of both and , from only one of and is actually used to construct each term in involving . The middle column of (D.8) is actually the derivative of with respect to the in , while the middle column of (D.9) is actually the derivative of with respect to the in . Thus, the middle columns in (D.8) and (D.9) corresponding to the derivative of with respect to should not coincide in a software implementation. For example, if is constructed from the in , is as shown in (D.8) while the middle column of (D.9) corresponding to the derivative of with respect to the in is all zeros. Alternatively, if is constructed from the in , is as shown in (D.9) while the middle column of (D.8) corresponding to the derivative of with respect to the appearing in is all zeros.
@fb@secFB
D.3 Determine the Tangent Direction
The unit tangent at obtained by solving (D.2) must be scaled so that the sweep predictor-corrector continuation method does not reverse direction. As shown in [60], the correct direction for the unit tangent is obtained via:
[TABLE]
where is the inner product of the previous and current unit tangents:
[TABLE]
The integration operator to construct the inner product in (D.11) can be realized via the LAB routine pz. With the sign direction selected by (D.10), the inner product of the previous and current unit tangents is positive:
[TABLE]
@fb@secFB
D.4 Sweep along the Tangent
By monotonically increasing (or sweeping) the tangent steplength from [math], the current solution and its unit tangent can be used to find the next solution that solves (C.1) while satisfying the orthogonality constraint:
[TABLE]
This yields the ODE TPBVP:
[TABLE]
which must be solved for , , and by monotonically increasing (or sweeping) . Note that the first, second, and third equations in (D.14) are the ODEs, while the fourth, fifth, and sixth equations constitute the boundary conditions. The first, second, and fourth equations in (D.14) ensure that the solution lies on (i.e. satisfies (C.1)), while the third, fifth, and sixth equations in (D.14) enforce the orthogonality constraint (D.13). The initial solution guess to solve (D.14) is the current solution and , . starts at [math], since the initial solution guess for is , and increases monotonically until the maximum threshold is reached or until the ODE TPBVP solver halts (due to reaching a turning point).
Note that the ODE TPBVP (D.14) can be solved numerically via the LAB routine twp, which offers 2 continuation algorithms: c and cc. The continuation algorithms c and cc assume that the continuation parameter (in this case ) is monotonically increasing or decreasing, so that they will halt at a turning point in the continuation parameter. Since and are usually only known at a discrete set of points in , the values of these functions at the other points in must be obtained through interpolation in order to numerically solve (D.14). The LAB routine erp1 performs linear, cubic, pchip, makima, and spline interpolation and may be utilized to interpolate and while solving (D.14).
Because the numerical solvers usually converge faster when provided Jacobians of the ODE velocity function and of the two-point boundary condition function, these are computed below. Let
[TABLE]
The ODE velocity function in (D.14) is
[TABLE]
The Jacobian of the ODE velocity function with respect to is
[TABLE]
The two-point boundary condition in (D.14) is
[TABLE]
where is the two-point boundary condition function
[TABLE]
The Jacobians of the two-point boundary condition function with respect to and are
[TABLE]
and
[TABLE]
Special care must be taken when implementing the Jacobians (D.20) and (D.21). Since the unknown constant appears as the second to last element of both and , from only one of and is actually used to construct each term in involving . The middle column of (D.20) is actually the derivative of with respect to the in , while the middle column of (D.21) is actually the derivative of with respect to the in . Thus, the middle columns in (D.20) and (D.21) corresponding to the derivative of with respect to should not coincide in a software implementation. For example, if is constructed from the in , is as shown in (D.20) while the middle column of (D.21) corresponding to the derivative of with respect to the in is all zeros. Alternatively, if is constructed from the in , is as shown in (D.21) while the middle column of (D.20) corresponding to the derivative of with respect to the appearing in is all zeros.
@fb@secFB
D.5 Pseudocode for Sweep Predictor-Corrector Continuation
Below is pseudocode that realizes the sweep predictor-corrector continuation method.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] V. Putkaradze and S.M. Rogers “On the Optimal Control of a Rolling Ball Robot Actuated by Internal Point Masses” In Journal of Dynamic Systems, Measurement, and Control 142.5 American Society of Mechanical Engineers Digital Collection, 2020
- 2[2] V. Putkaradze and S.M. Rogers “On the dynamics of a rolling ball actuated by internal point masses” In Meccanica 53.15 , 2018, pp. 3839–3868 DOI: 10.1007/s 11012-018-0904-5 · doi ↗
- 3[3] V. Putkaradze and S.M. Rogers “On the Normal Force and Static Friction Acting on a Rolling Ball Actuated by Internal Point Masses” In Regular and Chaotic Dynamics 24.2 Springer, 2019, pp. 145–170
- 4[4] D.D. Holm “Geometric Mechanics: Rotating, translating, and rolling”, Geometric Mechanics Imperial College Press, 2011
- 5[5] A.E. Bryson and Y.-C. Ho “Applied optimal control: optimization, estimation and control” CRC Press, 1975
- 6[6] A.E. Bryson “Dynamic optimization” Prentice Hall, 1999
- 7[7] J.T. Betts “Practical methods for optimal control and estimation using nonlinear programming” Siam, 2010
- 8[8] M.A. Patterson and A.V. Rao “GPOPS-II: A MATLAB software for solving multiple-phase optimal control problems using hp-adaptive Gaussian quadrature collocation methods and sparse nonlinear programming” In ACM Transactions on Mathematical Software (TOMS) 41.1 ACM, 2014, pp. 1
