Viability, task switching, and fall avoidance of the simplest dynamic walker

Walking humans display great versatility when achieving task goals, like avoiding obstacles or walking alongside others, but the relevance of this to fall avoidance remains unknown. We recently demonstrated a functional connection between the motor regulation needed to achieve task goals (e.g., maintaining walking speed) and a simple walker’s ability to reject large disturbances. Here, for the same model, we identify the viability kernel—the largest state-space region where the walker can step forever via at least one sequence of push-off inputs per state. We further find that only a few basins of attraction of the speed-regulated walker’s steady-state gaits can fully cover the viability kernel. This highlights a potentially important role of task-level motor regulation in fall avoidance. Therefore, we posit an adaptive hierarchical control/regulation strategy that switches between different task-level regulators to avoid falls. Our task switching controller only requires a target value of the regulated observable—a “task switch”—at every walking step, each chosen from a small, predetermined collection. Because humans have typically already learned to perform such goal-directed tasks during nominal walking conditions, this suggests that the “information cost” of biologically implementing such controllers for the nervous system, including cognitive demands in humans, could be quite low.

www.nature.com/scientificreports/ sequence of its push-off inputs for every starting state. The viable regions of walking models with definite swing leg dynamics, including the compass walker studied here, have not yet been explicitly estimated. Conversely, in the nonviable set of states, the walker cannot avoid falls, let alone regulate to achieve task goals, with any possible active push-off control. Therefore, the viable region is also the set within which different motor regulation strategies can be meaningfully compared for their effect on the walker's ability to avoid falls, i.e., their global stability. Taking step-to-step speed regulation as a model task-level motor regulation strategy 9,14,19 , we estimate the speed-regulated walker's basins for several target speeds vis-à-vis the viable region. Not only do the speedregulated walker's basins occupy large regular regions, but we find that only a small collection of these basins covers nearly the entire viable region itself. Motivated by these results, we propose a hierarchical task switching controller that, at least in principle, allows the walker to avoid falls by appropriately switching between different task-level regulators at each walking step. Our work suggests a possible mechanism by which humans could avoid falls, by exploiting redundancy in previously learned regulation strategies to achieve task goals in a variety of walking contexts, including that of responding to a large, unexpected disturbance.

Results
We employ the simplest dynamic walker that walks on a level surface by means of impulsive push-off actuation, modeling ankle plantar flexion during toe-off in humans 21 (see "Methods"). The walker's state, just after heel strike, is fully described by the stance leg angle θ + and its angular rate θ + , in the inertial frame attached to the stance foot (Fig. 1). We study the walker's step-to-step dynamics as a hybrid Poincaré map, F , over the twodimensional state space (θ + ,θ + ) with push-off input P (Eq. 2). We further impose viability constraints on the walker that yield restrictions on its states and inputs (see "Methods"): specifically, the stance foot must remain on the ground throughout the stance phase; the impulsive actuation must be small enough to not lift the walker off the ground when the swing foot's heel strike is impending, and must be large enough to lift the stance foot off the ground after push-off.
Where are the compass walker's dynamics viable? 1-step viable region. Walking motions can start in the feasible region V 0 of the state space: We further restrict θ + 0.85 , which covers the range of stance angles observed in humans.
Previously 19 , we identified the "1-step" region of the powered compass walker (Fig. 1) as the set of states from which the walker can have at least one heel strike. The 1-step region is the wedge-shaped region within V 0 , demarcated by the curves low and high (Fig. 2a). However, our previous work did not seek to identify the walker's viability within this region.
swing leg stance leg "switch" legs stance phase hip Figure 1. Three snapshots of a 2D powered compass walker 21 walking on a level ground (step speed, V k ): (a) just after k th , (b) just before (k + 1) st and (c) just after (k + 1) st heel strike. The walker has straight, massless, stance (red) and swing (blue) legs, and a mass at the hip (circle). The masses at the feet (not shown) are infinitesimally small compared to the hip mass. The push-off impulse, P, is applied instantaneously just before heel strike. At the beginning of the k th step, the walker's state in the inertial frame is www.nature.com/scientificreports/ Here, we find the viable subset of the 1-step region, i.e., the 1-step viable region V 1 , by imposing viability constraints on the walker's dynamics over one step (Eq. 2). We visualize V 1 in a scaled state space (Fig. 2b), which we introduced previously 19 .
The nonnegativity constraint of the ground reaction force (GRF) at the stance foot yields two curves, Ŵ + GRF and Ŵ − GRF defined by the equalities in Eq. (5). Each of these curves partition the 1-step region into viable and nonviable sets. Specifically, the walker's stance foot maintains contact with the ground throughout when initialized from states on the sides of both Ŵ + GRF and Ŵ − GRF that contain the origin (0, 0) (Fig. 2b). The actuation limits (Eq. 8) by themselves do not further limit the push-off-powered walker's viability over a single step. Consequently, the walker's 1-step viable region V 1 is bounded by only four curves, viz., low , high , Ŵ + GRF , and Ŵ − GRF (Fig. 2). Also shown in Fig. 2 are the walker's period-1 gaits, i.e., gaits that repeat every step. The walker admits families of "long-period" and "short-period" gaits 16,21 , which are fixed points (θ * ,θ * ; P * ) of the map F (Eq. 2), for a given P * . While the long-and short-period gaits admit distinct step times and contrasting open-loop stability as θ + → 0 22 , their curves 19 intersect at (0, 0) in the original state space (Fig. 2a). In contrast, in the scaled state space (Fig. 2b), those very gaits remain bounded away from each other as θ + → 0 , which facilitates further analysis.
Viability kernel: ∞-step viable region. While the walker can definitely take a step in the 1-step viable region V 1 (Fig. 2), it is not guaranteed to walk forever, even with the best-possible push-off control. This is because the walker's state after taking a step need not remain in V 1 , but is only guaranteed to lie in V 0 (Eq. 1). We therefore identify the largest closed subset V of V 1 in which the walker can remain viable forever, i.e., for an infinite number of walking steps. That is, for any state x k := [θ + k ,θ + k ] ⊤ ∈ V , there exists at least one push-off input P k such that x k+1 := [θ + k+1 ,θ + k+1 ] ⊤ = F(x k ; P k ) ∈ V , satisfying viability constraints. The set V is thus the ∞-step viable region or the viability kernel 5,8 of the powered compass walker. It also follows that V is the largest positively invariant set (i.e., invariant in forward time) 23 under the walker's closed-loop dynamics, i.e., with state-dependent push-off input. Alternatively, V is the largest controlled-invariant set 23 of the push-off-powered compass walker. Outside V , the states are nonviable as no sequence of push-offs can prevent the walker from eventually failing (i.e., either violating at least one of the viability constraints or falling).
We employed the viability kernel algorithm 5 that avoids brute-force computation by utilizing the positive invariance property of V for its estimation (see "Methods"). Our implementation of that algorithm converged after 18 iterations so that the set V 18 , i.e., the 18-step viable region where the walker can take at least 18 steps, is the final estimate of the ∞-step region V (Fig. 3a) to within the resolution of the grid on the state space.
We estimated the areas of different regions in the original state space using the composite Simpson's rule. The ∞-step viable region V (Fig. 3a) occupies ≈ 97.46% area of the 1-step viable region V 1 (Fig. 2 Figure 2. Powered compass walker's 1-step viable region V 1 , i.e., the set of states beginning in which the walker takes at least one step while remaining viable, bounded by the curves low , high , Ŵ + GRF , and Ŵ − GRF : (a) In the wedge-shaped region in the middle ("1-step" region 19 ), demarcated by the curves low and high , the walker has at least one heel strike though it may not necessarily maintain a nonnegative GRF at the stance foot. Indeed, in the nonviable region, the stance leg either moves too slowly to swing past the vertical, moves too fast so that the walker falls forward, or fails to maintain ground contact throughout the stance phase. Thus, V 1 is a strict subset of the "1-step" region 19 . (b) To better visualize V 1 , we plot the state space with θ + scaled to θ + sc θ + −� low (θ + ) � low (θ + )−� high (θ + ) for any given θ + ∈ (0, 0.85] , so that the new variable θ + sc is 0 on the upper low curve and takes a value −1 on the lower high curve 19 (freehand arrows). The period-1 gaits of the walker, viz., "long-period" and "short-period" gaits that repeat every step, along with their open-loop stability, are as in our previous work 19  Unreachability within the viability kernel. We found the unreachable subset V UR of V that cannot be traversed by the walker's trajectories (see "Methods"). The set V UR consists of two disjoint subsets of V , together occupying ≈ 2.47% of its area (Fig. 3a). As expected, the walker's period-1 gaits lie entirely within the reachable subset of V. Evidently, any walking task or target that would require the walker to traverse such unreachable sets cannot be achieved. The walker's state can end up in V UR due to external disturbances or can be initialized within it; however, its state immediately (i.e., in one step) leaves V UR under the walker's dynamics (Eq. 14).
Viability kernel boundaries. The viability kernel algorithm guarantees that the trajectories of nonviable gridpoint states (Fig. 3) cannot enter the viability kernel V while those originating in the interior of V always remain in it. However, V is a closed set 5 , so states on its boundary must also satisfy the positive invariance property (Eq. 13): That is, the boundary of V can be mapped into itself or into the interior of V 24 , provided appropriate input push-offs are chosen.
The boundary of V is a union of three curves: Ŵ b , Ŵ t and Ŵ GRF (Fig. 3). Our numerical results indeed show the positive invariance of the estimated boundaries of V , which leads to their validation via the mathematical theory of dynamical systems (see "Methods").
Task-level regulation, global stability, and fall avoidance. No strategy can avoid falls for states outside the viability kernel V . Conversely, the walker can walk forever inside V by employing any one of infinitely many appropriate sequences of push-offs. However, the region V itself exists and is independent of any given control strategy the walker might choose. Thus, it is meaningful to assess the performance of different specific control strategies in avoiding falls only for the trajectories starting within V.
We are particularly interested in motor regulation templates, i.e., empirically motivated models of how humans manipulate task-level observables on a step-to-step basis 10,14 . As a model task-level regulation strategy, we here specify experimentally informed step-to-step speed regulation 9,14 on the walker ( Fig. 1): see "Methods". Specifically, we pick a push-off impulse at each step by minimizing the squared discrepancy between the speed V at the next step and its desired target value V * , chosen a priori. 19 , we demonstrated a functional connection between task-level motor regulation and the walker's ability to reject large disturbances, i.e., its global stability. The maximal attainable global stability for the walker, capable of applying arbitrary sequence of push-offs within its actuation limits, is, indeed, its viability. Therefore, we assess a walker's global stability via the basins of attraction of its steady-state gaits in the state space vis-à-vis the viability kernel V (Fig. 3). indeed, states within V 1 (or "1-step" region 19 ) that are either below Ŵ b or above Ŵ t are nonviable. The boundary Ŵ GRF is common to both V and V 1 . The curves of long-and short-period gaits are from  www.nature.com/scientificreports/ As in our recent work 19 , we numerically estimated basins by simulating the open-loop ( P k := P * ) walker's trajectories for 50 steps and those of the speed-regulated (Eq. 16) walker for 25 steps, starting from every state on the same grid that we used for the estimation of V . The walker's trajectories that fail to satisfy viability constraints are not considered part of its basins.

Global stability under task-level regulation: basins of attraction. Previously
The open-loop basins ( Fig. 4) are significantly smaller in area than those of the speed-regulated basins (Fig. 5). Moreover, the geometric structure of the open-loop basins becomes more intricate as push-off impulse P * increases, with a growing number of disjoint boundaries (see 19 for a discussion of the aspect of the noninvertibility structure of the open-loop basins). In contrast, the speed-regulated walker's basins occupy large areas within V and are highly regular (Fig. 5): their boundaries are given by level curves of the form θ − = constant 19 and/or are shared with the boundaries of V themselves.
In Fig. 6, we compare the normalized areas of the basins of attraction within the viability kernel V for the open-loop and speed-regulated walkers for target speeds V * 0.38301 (or, push-offs P * 0.79478 ), leading up to the transcritical bifurcation 19 .
The open-loop walker's basin shrinks significantly as P * increases from 0.01 to 0.1325, before the long-period gait loses open-loop stability at P * ≈ 0.13571 via a period-doubling bifurcation. The open-loop basin occupies a maximum of ≈ 8.4% of the area of V at P * = 0.01 . In comparison, the speed-regulated walker's basin of its long-period gait grows with speed until it achieves its maximum size, ≈ 56.4% area of V , at V * ≈ 0.23308 ( P * ≈ 0.24214 ) before shrinking significantly at higher speeds. Fig. 4 together occupy only ≈ 20.36% of the area of the viability kernel V with many hard-to-fill gaps in between. Furthermore, we estimate that all of the open-loop basins, corresponding to P * values of all the long-period gaits, together can cover no more than 40% of the area of V.

Viability via hierarchical task switching control. The open-loop basins in
Conversely, the task-level speed regulator, while achieving the specified goal of maintaining a target speed at each step, allows the push-off powered compass walker to reject a large range of external disturbances, despite not being designed to do so 19 . The speed-regulated walker's basins occupy large, regular regions of V for a range of target speeds V * (Fig. 6). Furthermore, as we show in Fig. 7, only five of the speed-regulated walker's basins from Fig. 5 almost fully cover V . Thus, starting from almost every state in V , as might occur from an external disturbance, there is at least one task-level speed regulator (or V * ) that allows the walker to avoid falls as long as the state trajectory remains within the corresponding basin. Additionally, since a set of target speeds V * can be chosen so that any two adjacent speed-regulated basins overlap (as in Fig. 7), there is flexibility to switch between the corresponding regulators immediately ( V * i ↔ V * i+1 ) provided the walker's state lies within the basin intersection. Thus, this suggests that task-level speed regulation, unlike open-loop dynamics, could, at least in principle, be used to keep the walker viable for almost all states in V , i.e., allowing it to avoid falls forever, in response to any disturbance that does not push the system entirely out of V . For example, a plausible task switching controller could appropriately switch target speed at each step to one of the five values {V * i , i = 1, . . . , 5} , as in Fig. 7, so that the walker can move from one speed-regulated basin to another without falling. We posit that a similar adaptive hierarchical control/regulation strategy exists in human walking and provides a key mechanism used to avoid falling.
To further elucidate the function of such task switching control, we consider a scenario where the walker experiences a large disturbance while maintaining some desired speed V * f . Let the state of the walker immediately after the disturbance lie within the viability kernel: x k ∈ V at the k th walking step. Moreover, we assume that is the task-regulated basin corresponding to some suitably chosen intermediate target speed V * i . The walker then applies a push-off P opt k,i to achieve the target value V * i at the next step ( V * := V * i in Eq. 15). We construct a possibly minimal set, V p , of all such target speeds V * i such that the corresponding set of speed-regulated basins together can cover the viability kernel: V≈ ∪ i B (V * i ) (Fig. 7). Thus, specifying such a hierarchical control strategy amounts to specifying a suitable set of "task switches", i.e., target speeds {V * i ∈ V p } at each step, for the regulators. Such task switching control can, in principle, allow the walker to get back to its original task goal V * f ∈ V p while remaining viable throughout its post-disturbance recovery phase: at the (k + 1) st walking step, the walker's state x k+1 not only belongs to B (V * i ) but also to B (V * j ) for some V * j ∈ V p , j = i , by design. Once the walker's state trajectory enters the basin B (V * f ) corresponding to the original task, the relevant speed regulator to achieve that task goal is switched back on for subsequent walking steps, until the next large disturbance is encountered. See Figs. 7 and 8 for sample results illustrating the walker's recovery in the aforementioned scenario. These results also demonstrate the basic behavioral feature of the two levels of our hierarchical control/regulation strategy: First, the "high-level" task switching controller brings the walker rapidly (i.e., in a few steps) to the desired V * f -manifold within the basin B (V * f ) . Then, the "low-level" regulator targeting speed V * f makes relatively small adjustments (possibly over many steps) as the walker approaches its steady-state gait. Thus, using task switching, it is possible to return to the basin of attraction for the desired task goal, and thereby recover from a disturbance without falling, in only a few steps. Responses such as these are comparable to those predicted in other simple biped models 8 and also those observed in experiments in humans recovering from large balance perturbations 25,26 . Overall, following such a hierarchical strategy of switching between a small set of target speeds, the walker could walk forever while overcoming a wide range of large disturbances. Furthermore, because task switching is not mechanical, it is not affected by the the walker's inertial properties. Thus, the time scale of task switching in humans would be limited not by mechanics proper, but by the speed of processes in the nervous system related to perception, motor activation, and cognition (particularly executive function). Therefore, task switching can, in principle, be accomplished almost instantaneously. This would have obvious benefits for recovering from sudden, unexpected disturbances. www.nature.com/scientificreports/  Fig. 5. The open-loop basin at P * = 0.001 is similar in structure to that with no push-off ( P * = 0 ) that shares boundaries with V (Fig. 3b). As P * increases, the basins shift to the right within V , while shrinking progressively for P * 0.01 . The first period-doubling bifurcation occurs at P * ≈ 0. www.nature.com/scientificreports/

Discussion
We studied the simplest dynamic walker's viability, i.e., its ability to avoid falls forever by applying an appropriate sequence of push-off inputs. Specifically, for the push-off-powered compass walker 21 , we estimated the viability kernel V in its state space 5 and verified that our numerical results are consistent with the mathematical theory of dynamical systems. We found that the walker's push-off can be chosen to avoid falls forever beginning in almost all states that allow the walker to have a heel strike. Moreover, greater than 97% of the states within V remain reachable via push-off inputs, indicating a high degree of maneuverability of the viable walker. We posited that humans could remain viable, i.e., avoid falls forever, via a hierarchical schema consisting of both control and functionally distinct task-level step-to-step regulation of gait observables. As a model tasklevel motor regulation strategy for the walker, we imposed speed regulation 9,14 that, as we demonstrated in 19 , greatly enhances the walker's global stability (large disturbance rejection) compared to open-loop (unregulated) dynamics. Here, however, we assessed the walker's global stability relative to its viability-its maximal attainable global stability-via the basins of attraction of its steady-state gaits in the state space vis-à-vis V . This facilitated a direct comparison between open-loop dynamics, task-level regulation, and theoretically best-possible control strategies from the perspective of fall avoidance alone.
We found that the speed-regulated walker's basins, unlike the open-loop basins (Fig. 4), occupy large, regular regions within V (Figs. 5 and 6). Moreover, for a range of target speeds, their boundaries are given by simple level curves and/or are shared with the boundaries of V themselves. Furthermore, the speed-regulated basins corresponding to only a few target speeds together nearly cover the entirety of V even as any adjacent pairs of such basins overlap in the state space (Fig. 7). Our results thus strongly suggest a potential role of task-level regulation within high-level control strategies that are explicitly geared toward avoiding falls or attaining viability. In light of this, we proposed a high-level, adaptive task switching control strategy that, in principle, maintains viable walking by selecting between a small collection of task-level speed regulators corresponding to a few preselected target speeds-"task switches"-at each walking step. However, it is clear that, at least in principle, such task switching controllers could also employ qualitatively different regulators, based on gait observables other than walking speed (e.g., step length or time), or even a combination of such regulators. Thus, our proposed task switching schema is more general than the example implemented here using speed regulation alone.
The theoretically best-possible control strategies that guarantee the walker's viability could require specifying an entire sequence of push-offs for each different walking trajectory. In comparison, a hierarchical task switching controller seems advantageous from an information transmission and processing perspective: it needs specifying only a sequence of discrete task switches, each belonging to a small predetermined set. While we are agnostic as to how such hierarchical task switching control could be realized biologically, our results nevertheless suggest that its "information cost" could be relatively low for the nervous system. This is because the cognitive demands of discretely switching between a few (and likely already learned or "crystallized" 27,28 ) tasks could be substantially lower than estimating/specifying appropriate control inputs "from scratch" at each walking step. Thus, humans might prefer cognitively less-demanding hierarchical control strategies based on task switching. Indeed, task switching (or "set shifting") is already a well-established sub-component of executive function 29 . For older adults, executive function is crucial to their ability to avoid falling and impaired executive function predicts their fall risk [30][31][32] . The ability to task switch in particular declines in older adults 33 and predicts both poor balance 34 and fall www.nature.com/scientificreports/ history 35 . Our results thus provide direct theoretical support to the idea that the impaired ability to task switch appropriately and/or quickly enough likely contributes to increased fall risk in older adults. Our 2D deterministic walker does not explicitly include the effect of motor noise present in the human nervous system, neither does it capture certain important aspects of human walking like stance phase actuation and control of mediolateral balance. While sufficiently large noise in the push-off input P could make some of the walker's trajectories nonviable, we expect task switching to remain important in fall avoidance for the remaining majority of states within V . Similarly, our study could be repeated for a more elaborate model, such as a 3D walker that requires a lateral stability controller to take individual steps, albeit at significantly higher computational expense. While the specific results of any such model would differ, our general conclusion that task switching via an adaptive hierarchical control/regulation strategy can help avoid falls is expected to hold.
It is well known that humans can adapt their stepping to avoid falls, even when experiencing substantial external disturbances [36][37][38][39] . Walking humans can also readily achieve a variety of task goals in different 251} . These five basins together cover > 99.99% of the area of the viability kernel. Also, any two adjacent basins have some overlap with each other. We consider two examples of a scenario where the walker experiences a large disturbance while walking at some desired speed V * f , such that its "disturbed" state (star pentagons) lies within the speed-regulated basin B (V * i ) corresponding to some speed V * i . A sequence of walking steps (broken lines joining squares) then illustrates the walker's post-disturbance recovery back to the steady-state gait ( ) corresponding to speed V * f via task switching control of speed regulators: in example 1 (star pentagon, red), In both examples, the "high-level" task switching controller allows the walker to reach the desired V * f -manifold within the basin B (V * f ) in only three steps. After that, the "low-level" regulator targeting speed V * f allows the walker to transiently approach the steady-state gait over many steps. See Fig. 8 for the corresponding sequences of step speeds and push-off inputs employed by the walker during its recovery. www.nature.com/scientificreports/ environments 9,40-43 . However, it remains unknown how the human "controller" adapts to such task goals at a neurophysiological level. As in our previous work 19 , the structure of our model is based in part on experimental evidence of task-level motor regulation in human walking 9,14 . Here, we developed a general theoretical framework to show how humans can, at least in principle, avoid falls by switching between regulation strategies used to perform already-learned goal-directed tasks. We expect that our framework will pave the way for more focused experiments in the future. While our perspective is focused on goal-directed behavior of biological movement, our results have implications for robotics as well. Indeed, some high-level strategies based on switching between different controllers 44 or between limit cycles with speed changes have demonstrated improved stability and versatility of bipedal walking 45 and running 46 robot models. For multi-degree-of-freedom robot models, it is computationally difficult to map out the viability kernel in their high-dimensional state spaces. However, the concept of task switching within a hierarchical control/regulation strategy could be potentially employed to enhance the robustness of walking robots and help reduce (or perhaps minimize) their falls.

Methods
Simplest dynamic walker. We employ a 2D compass walker (Fig. 1) that walks on a level surface by means of impulsive push-off actuation P. The continuous stance phase of this walker is unactuated with no foot placement control. This makes it the simplest actuated model having definite swing leg dynamics, unlike 2D inverted pendulum models 8 .
Every forward walking step (Fig. 1) consists of a continuous-time single-support stance phase followed by an instantaneous impulsive double-support phase. Thus, the walker's step-to-step dynamics are inherently hybrid. The walker's state, just after heel strike, is fully described by the stance leg angle θ + and its angular rate θ + , in the inertial frame attached to the stance foot. The walker's step-to-step dynamics can be studied as a hybrid Poincaré map, F [F 1 , F 2 ] ⊤ , over the two-dimensional state space (θ + ,θ + ) with push-off input P k applied just before heel strike at the end of step k 19,21 : The map F is non-invertible 19 , i.e., any given state of the walker could have zero, one, or more than one preimage under F , even when P is fixed. Also, across heel strikes 21 (Fig. 1): The walker's heel strike is legitimate (Fig. 1) when: a b Figure 8. The sequences of step speeds V k (a) and corresponding push-offs P k (b) during the walker's recovery (in two example scenarios depicted in Fig. 7) from large disturbances via task switching control of speed regulators. The walker's speed rapidly switches to the target speed V * f in three steps so that V 4 = V * f : in example 1 (star pentagon, red), V * f = V * 3 ; while in example 2 (star pentagon, blue), V * f = V * 2 . Subsequently, in example 1, the walker maintains its target speed throughout its approach to the steady-state gait: V k = V * 3 for k 5 . On the other hand, in example 2, the walker's approach to its steady-state gait is transiently affected by actuation limits (Eqs. 6 and 8): V k < V * 2 for 5 k 9 , and P k = P k,max for 4 k 8. www.nature.com/scientificreports/ We also assume no slipping at the foot-ground contact.
Viability constraints. For the walker to remain viable, its stance foot must remain on the ground so that the ground reaction force (GRF) at the stance foot is nonnegative throughout the stance phase. Since this GRF can be smallest either just after or before heel strike, we get two inequality constraints over the state space ( Fig. 1): Moreover, this places a state-dependent limit on the maximum push-off, P k,max , since the walker cannot lift off the ground when the swing foot's heel strike is impending 8 : Furthermore, the impulsive actuation cannot apply a braking force, i.e., P k 0 . Additionally, we assume that the stance foot must lift off the ground after push-off. This places a state-dependent limit on the minimum push-off, P k,min , so that the walking motion can continue (Eqs. 3b and 1): Therefore, the push-off impulse at each step k needs to satisfy actuation limits (Eqs. 6 and 7) for the walker to remain viable: Numerical estimation of the viability kernel. Estimating the viability kernel V for a given actuated dynamical system is in general a non-trivial task, even in low-dimensional state spaces 23 . For instance, V is more difficult to estimate than a basin of attraction, another positively invariant set. The trajectories originating in V can only be guaranteed to remain in an as yet unknown V ad infinitum by choosing an appropriate input sequence. Brute-force estimation of V requires the computation of many sufficiently long trajectories starting from each state, each of which differ due to distinct control input sequences. If at least one such trajectory satisfies viability constraints, then the corresponding starting state would likely belong to V . Conversely, the trajectories of basin states approach an attractor that is often known a priori. Thus, brute-force estimation of a basin requires only a single sufficiently long trajectory starting from each state and a decision as to whether or not it will eventually reach the attractor. A recent study 8 examined the viability of 2D inverted pendulum models of walking, which have a 1-dimensional state space and a 2-dimensional control input space. In contrast, the system considered here has a 2-dimensional state space and a 1-dimensional control input space.
The viability kernel algorithm 5 [pp. 153-154] avoids brute-force computation by utilizing the positive invariance property of V , which for the walker (Eq. 2) can be written as: Here, the set F(V; P ) {F(x; P(x)) | x ∈ V, P(x) ∈ P } , where P(x) is any appropriately chosen push-off P depending on the state x := [θ + ,θ + ] ⊤ , and the set P is the collection of all such push-offs matched to states such that the relation (9) holds. The positive invariance property pertains to sets in the state space alone. Since P is not known a priori, we consider all push-offs within the actuation limits (Eq. 8) to eliminate P from the relation (9).
The dynamics of a powered compass walker, capable of applying any push-off within the actuation limits at each step, is described by a difference inclusion 5 , i.e., a set-valued map F satisfying where the set F (x k ) is obtained from Eq. (2): where ˙ k+1 is an interval defined, using Eq. (3b) and the allowable range of push-offs P k (Eqs. 6 and 7), as: Thus, at step k, the set F (x k ) is a vertical line segment, ˙ k+1 , in the state space at θ + = θ + k+1 = −θ − k (Eq. 3a). Therefore, Eq. (9), expressed solely in terms of states, becomes: (8) P k,min P k P k,max .
Algorithm 1 is practically useful if it converges (stops) in a finite (preferably small) number of iterations. This requires an accurate representation of the boundaries of V j (at the j th iteration) so that the intersection F (x) ∩ V j in Algorithm 1 can be found reliably. The boundaries of V 1 ( low , high , Ŵ + GRF and Ŵ − GRF in Fig. 2) are smooth level curves, which we accurately represent via fitted piecewise cubic splines with continuous curvature (matlab's spline). Since sets {V j ; j 2} are recursively estimated as collections of j-step viable grid-point states, their boundaries are not known in closed form. We represent such boundaries by employing shape-preserving piecewise cubic polynomials (matlab's pchip) to reduce potential artifacts (overshoots and oscillations) in the fitted curves over the grid. We passed such fitted boundary curves through nonviable grid-point states tightly enveloping estimates of V j so as to avoid accidental removal of viable states during the iterations of Algorithm 1. Our implementation of Algorithm 1 converged at j = 18 , so that the set V 18 is the final estimate of the ∞-step region V (Fig. 3a) to within the grid resolution. We found that the set V UR consists of two disjoint subsets of V demarcated by the boundaries Ŵ 1 and Ŵ 2 (Fig. 3a). None of the grid-point states in V map above the boundary Ŵ 1 with P = 0 , and consequently for any P > 0 (Eq. 3b). Studies of non-invertible maps 47,48 thus suggest that the boundary Ŵ 1 belongs to a critical curve (often denoted as LC): the number of preimages of states on opposite sides of LC differs by two, which we also found to be the case for Ŵ 1 .
Furthermore, both boundaries Ŵ b \ � high and Ŵ t map into Ŵ b \ � high after one step of the walker with zero push-off. Moreover, the boundary Ŵ b is tangent to the curve of short-period gaits at the open-loop-unstable gait U (a saddle point) at {(θ * ,θ * ); P * } = {(0, 0); 0} (Fig. 3). These numerical results suggest that Ŵ b \ � high and Ŵ t belong to the stable set of the saddle U 19,48,49 of the walker's non-invertible map F with P = 0 in Eq. (2). Consistently, we found that both Ŵ b \ � high and Ŵ t are contained in the open-loop basin boundaries for P * = 0 (Fig. 3b), which constitute a stable set 19 . Since the stable set of a saddle is positively invariant, this confirms that the set {Ŵ b \ � high } ∪ Ŵ t is also positively invariant.
Step-to-step speed regulation as a model task-level regulation strategy. We pick a push-off impulse at each step based on the discrepancy between the speed V at the next step that depends on the walker's current state and its desired target value V * , chosen a priori. Thus, at step k, the smallest push-off, P opt k , that minimizes the next-step quadratic cost is 19 : www.nature.com/scientificreports/ where x k := [θ + k ,θ + k ] ⊤ is the walker's state at the beginning of step k. Then, the speed-regulated walker applies push-off P k that satisfies actuation limits (Eq. 8) at step k: We note that this speed regulation strategy (Eq. 15) does not explicitly utilize the location of the boundaries of V (Fig. 3) to infer P opt k . The push-off P opt k places the speed-regulated walker's state x k+1 on the target-speed manifold-a goal equivalent manifold 12 -that is a piecewise-smooth curve in the two-dimensional state space 19 , defined by: whenever P opt k ∈ [P k,min , P k,max ] (Eq. 8). We efficiently simulated the speed-regulated walker's trajectories by precomputing the target-speed manifold by solving Eqs. (17) using numerical continuation 19 . for P opt k ∈ [P k,min , P k,max ], P k,min for P opt k < P k,min , P k,max for P opt k > P k,max . www.nature.com/scientificreports/