# 4Weed Dataset: Annotated Imagery Weeds Dataset

Varun Aggarwal
Electrical and Computer Engineering
Purdue University
West Lafayette, IN
<EMAIL_ADDRESS>
Aanis Ahmad
Electrical and Computer Engineering
Purdue University
West Lafayette, IN
<EMAIL_ADDRESS>
Aaron Etienne
Agricultural and Biological Engineering
Purdue University
West Lafayette, IN
<EMAIL_ADDRESS>
Dharmendra Saraswat
Agricultural and Biological Engineering
Purdue University
West Lafayette, IN
<EMAIL_ADDRESS>
Use footnote for providing further information about author (webpage,
alternative address)— _not_ for acknowledging funding agencies.

###### Abstract

Weeds are a major threat to crops and are responsible for reducing crop yield
worldwide. To mitigate their negative effect, it is advantageous to accurately
identify them early in the season to prevent their spread throughout the
field. Traditionally, farmers rely on manually scouting fields and applying
herbicides for different weeds. However, it is easy to confuse between crops
with weeds during the early growth stages. Recently, deep learning-based weed
identification has become popular as deep learning relies on convolutional
neural networks that are capable of learning important distinguishable
features between weeds and crops. However, training robust deep learning
networks requires access to large imagery datasets. Therefore, an early-season
weeds dataset was acquired under field conditions. The dataset consists of 159
Cocklebur images, 139 Foxtail images, 170 Redroot Pigweed images and 150 Giant
Ragweed images corresponding to four common weed species found in corn and
soybean production systems.. Bounding box annotations were created for each
image to prepare the dataset for training both image classification and object
detection deep learning networks capable of accurately locating and
identifying weeds within corn and soybean fields. (https://osf.io/w9v3j/)

_Keywords_ Weed Identification $\cdot$ Precision Agriculture $\cdot$ Deep
Learning $\cdot$ Weeds Dataset $\cdot$ Cocklebur $\cdot$ Foxtail $\cdot$
Ragweed $\cdot$ Pigweed

##  1 Introduction

Weeds threaten crops worldwide causing considerable yield loss (Chauhan,
2020). In the US corn belt alone, weeds have the potential to reduce corn and
soybean crop yield by almost 50% in fields without any weed control compared
to the field with weed control (Soltani et al., 2016, 2017). Therefore, it is
crucial to control the spread of weeds within corn and soybean production
systems.

Implementing effective weed management practices is dependent on accurate weed
identification. Currently, automation in weed identification has achieved high
accuracy for identification due to the emergence of deep learning for computer
vision. Although, training robust deep learning networks largely depends on
the availability of high quality and well-annotated training data. Hence, this
paper introduces a large annotated handheld imagery dataset called 4Weed
Dataset. It consists of images acquired under complex field conditions for
four different weed species: namely Cocklebur (_xanthium strumarium_), Foxtail
(_setaria viridis_), Redroot Pigweed (_amaranthus retroflexus_), and Giant
Ragweed (_setaria viridis_).

The 4Weed dataset was previously used in a study to accurately identify weeds
using deep learning-based image classification and object detection networks.
(Ahmad et al., 2021).

##  2 Materials and Methods

###  2.1 Dataset

The 4Weed dataset consists of a total of 618 red, green, and blue (RGB) images
that were acquired under complex field conditions at Purdue University’s
Agronomy Center for Research and Education (ACRE) during the summer months, as
well as at the Purdue University greenhouse during winter months. The dataset
is comprised of four common weed species to corn and soybean production
systems: namely Cocklebur (_xanthium strumarium_) images, Foxtail (_setaria
viridis_) images, Redroot Pigweed (_amaranthus retroflexus_) images, and Giant
Ragweed(_setaria viridis_) (Figure 1, Table 1). The dataset can be found at:
https://osf.io/w9v3j/

Figure 1: Cocklebur, Foxtail, Redroot Pigweed, and Giant Ragweed images from 4Weed dataset Table 1: 4Weed Dataset Summary Weed | Number of Images
---|---
Cocklebur | 159
Foxtail | 139
Redroot Pigweed | 170
Giant Ragweed | 150

The field images were collected using an array of six Logitech 920 web-cameras
(Logitech, Newark, CA, USA) installed and positioned at the front end of a
utility terrain vehicle (UTV) chassis. The resolution of the cameras was 1080
x 720 pixels. They were installed at a height of 14 inches above ground level
(AGL). In addition, several images were captured at a resolution of 1200 x 900
pixels with a handheld Sony WX350 camera, both infield and greenhouse.
Overall, the resulting dataset comprised of 35 Cocklebur images, 73 Foxtail
images, 170 Redroot Pigweed images, and 150 Giant Ragweed images.

As the initial dataset was unbalanced, additional images for Cocklebur and
Foxtail were acquired using Google Pixel 3 and Apple iPhone 11 Pro mobile
cameras in corn and soybean fields at Purdue University’s ACRE farm. Each
image had a resolution of 4032 x 3024 pixels. Hence, the final dataset was
nearly balanced and had 618 images (Table 1).

After the images were acquired, the LabelImg tool (Tzutalin, 2015) annotation
tool was used to create bounding box annotations and label them in order to
prepare the dataset for training both image classification and object
detection deep learning networks (Table 1).

## References

  * Chauhan (2020) B. S. Chauhan,  Grand challenges in weed management,  Frontiers in Agronomy 1 (2020) 3.
  * Soltani et al. (2016) N. Soltani, J. A. Dille, I. C. Burke, W. J. Everman, M. J. VanGessel, V. M. Davis, P. H. Sikkema,  Potential corn yield losses from weeds in north america,  Weed Technology 30 (2016) 979–984.
  * Soltani et al. (2017) N. Soltani, J. A. DIlle, I. C. Burke, W. J. Everman, M. J. Vangessel, V. M. Davis, P. H. Sikkema,  Perspectives on potential soybean yield losses from weeds in north america,  Weed Technology 31 (2017) 148–154.
  * Ahmad et al. (2021) A. Ahmad, D. Saraswat, V. Aggarwal, A. Etienne, B. Hancock,  Performance of deep learning models for classifying and detecting common weeds in corn and soybean production systems,  Computers and Electronics in Agriculture 184 (2021) 106081.
  * Tzutalin (2015) Tzutalin, Labelimg, 2015. URL: https://github.com/tzutalin/labelImg.


the first term, and recalling the properties of the Pöppe product, we observe

$1\ast n+n\ast 1=2n+1(n+1)+2\cdot(11n)+(n+1)1+n2+2\cdot(n11).$

Substituting this result into the previous expression and rearranging, we
find,

$(n+2)={\boldsymbol{(n+2)}}+\mathfrak{d}^{2}\hat{\pi}_{n}-(1\ast n+n\ast
1)-\bigl{(}1(n+1)+(n+1)1+2\cdot(1n1)\bigr{)}.$

To find a closed form expression for the terms ‘$1(n+1)+(n+1)1+2\cdot(1n1)$’
in terms of a Pöppe polynomial, we use the following result relating the Pöppe
product and the derivation operation $\mathfrak{d}$.

###### Lemma 6

Given two arbitrary compositions
$ua,bv\in{\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$ where we
distinguish the final and beginning single letters $a$ and $b$ as shown, we
have:

$ua\ast bv=\mathfrak{d}(uabv)-(\mathfrak{d}u)abv-uab(\mathfrak{d}v)+ua1bv.$

###### Proof

From the definition of $\mathfrak{d}$ we have
$\mathfrak{d}(uabv)=(\mathfrak{d}u)abv+u\bigl{(}\mathfrak{d}(ab)\bigr{)}v+uab(\mathfrak{d}v)$.
Thus from the definition of the Pöppe product, the result follows as we
observe $ua\ast bv$ equals $u(a+1)bv+ua(b+1)v+2\cdot(ua1bv)$, which in turn
can be expressed as $u\bigl{(}\mathfrak{d}(ab)\bigr{)}v+ua1bv$, which itself
in turn can be expressed as $\mathfrak{d}(uabv)-(\mathfrak{d}u)abv-
uab(\mathfrak{d}v)+ua1bv$.∎

Now we observe that since $\mathfrak{d}(n)=1n+(n+1)+n1$ then utilising Lemma 6
with $ua=1$ and then $bv$ successively equal to $1n$, $(n+1)$ and $n1$, and
vice-versa, we have:

$\displaystyle 1\ast\mathfrak{d}(n)+\mathfrak{d}(n)\ast 1=$
$\displaystyle\;\mathfrak{d}\bigl{(}1(n+1)+(n+1)1+2\cdot(1n1)+11n+n11\bigr{)}$
$\displaystyle\;-\Bigl{(}11\mathfrak{d}(n)+\mathfrak{d}(n)11+1n\mathfrak{d}(1)+\mathfrak{d}(1)n1+2\cdot\bigl{(}1(n+1)1\bigr{)}\Bigr{)}$
$\displaystyle=$
$\displaystyle\;\mathfrak{d}\bigl{(}1(n+1)+(n+1)1+2\cdot(1n1)\bigr{)}$
$\displaystyle\;-\Bigl{(}21n+12n+2\cdot(111n)-2n1-1(n+1)1-2\cdot(11n1)$
$\displaystyle\;+n21+n12+2\cdot(n111)-1(n+1)1-1n2-2\cdot(1n11)\Bigr{)}$
$\displaystyle=$
$\displaystyle\;\mathfrak{d}\bigl{(}1(n+1)+(n+1)1+2\cdot(1n1)\bigr{)}$
$\displaystyle\;-1\ast(1n)+1\ast(n1)-(n1)\ast 1+(1n)\ast 1$ $\displaystyle=$
$\displaystyle\;\mathfrak{d}\bigl{(}1(n+1)+(n+1)1+2\cdot(1n1)\bigr{)}-[1,1n]_{\ast}+[1,n1]_{\ast},$

where in the second step we expanded the derivation terms
$\mathfrak{d}(11n+n11)$, and for
$u,v\in{\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$ the expression
$[u,v]_{\ast}$ denotes the Pöppe product commutator of $u$ and $v$, i.e.
$[u,v]_{\ast}\coloneqq u\ast v-v\ast u$. Using Lemma 6 with $u$ and $v$ as the
empty compositions and $a=1$ and $b=n$, as well as vice-versa, we deduce that,

$1\ast n-n\ast 1=\mathfrak{d}(1n-n1)\qquad\Leftrightarrow\qquad
1n-n1=\mathfrak{d}^{-1}\bigl{(}1\ast n-n\ast 1\bigr{)}.$

Subsituting this into the expression involving
$-[1,1n]_{\ast}+[1,n1]_{\ast}\equiv-[1,1n-n1]_{\ast}$ just above and
rearranging, we observe,

$1(n+1)+(n+1)1+2\cdot(1n1)=\mathfrak{d}^{-1}\Bigl{(}\bigl{(}1\ast\mathfrak{d}(n)+\mathfrak{d}(n)\ast
1\bigr{)}+\bigl{[}1,\mathfrak{d}^{-1}[1,n]_{\ast}\bigr{]}_{\ast}\Bigr{)}.$

By substituting this result into the expression for
$(n+2)\in{\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$ just preceding
Lemma 6 we have established the first part of the following result. The second
part is established in the proof of the theorem that follows.

######  Theorem 7.1 (Non-Commutative Lax hierarchy)

Let $n\in\mathbb{N}$ be a given odd natural number with $n\geqslant 3$. Assume
there exists a polynomial
$\hat{\pi}_{n}=\hat{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{(n-2)}}\bigr{)}$
such that for the composition element
$n\in{\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$ we have

$n={\boldsymbol{n}}+\hat{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{(n-2)}}\bigr{)}.$

For $n=3$, such a polynomial
$\hat{\pi}_{3}=-3\cdot{\boldsymbol{1}}\ast{\boldsymbol{1}}$ exists. By
successively applying the derivation operation twice we deduce

$(n+2)={\boldsymbol{(n+2)}}+\mathfrak{d}^{2}\hat{\pi}_{n}-(1\ast n+n\ast
1)-\mathfrak{d}^{-1}\bigl{(}1\ast\mathfrak{d}(n)+\mathfrak{d}(n)\ast
1\bigr{)}-\bigl{[}1,\mathfrak{d}^{-1}[1,n]_{\ast}\bigr{]}_{\ast}.$

In addition there exists a polynomial
$\tilde{\pi}_{n}=\tilde{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{n}}\bigr{)}$
in ${\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$ such that

$\mathfrak{d}^{-1}\bigl{(}1\ast\mathfrak{d}(n)+\mathfrak{d}(n)\ast
1\bigr{)}+\bigl{[}1,\mathfrak{d}^{-1}[1,n]_{\ast}\bigr{]}_{\ast}=\tilde{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{n}}\bigr{)}.$

###### Remark 12

Note we can substitute for ‘$n$’ in the term $(1\ast n+n\ast 1)$ in the second
statement in Theorem 7.1 from the first statement in the theorem.

###### Remark 13

The expression for $(n+2)$ in Theorem 7.1 matches that for the non-commutative
potential Korteweg–de Vries hierarchy in Carillo and Schoenlieb (CSII, , Sec.
II).

###### Proof

We establish the existence of the polynomial
$\tilde{\pi}_{n}=\tilde{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{n}}\bigr{)}$
for the terms shown in the theorem. From the arguments preceding the theorem,
we know that
$\mathfrak{d}^{-1}\bigl{(}1\ast\mathfrak{d}(n)+\mathfrak{d}(n)\ast
1\bigr{)}+\bigl{[}1,\mathfrak{d}^{-1}[1,n]_{\ast}\bigr{]}_{\ast}\equiv
1(n+1)+(n+1)1+2\cdot(1n1)$. Hence, equivalently, we can show there exists a
polynomial
$\tilde{\pi}_{n}=\tilde{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{n}}\bigr{)}$
such that

$1(n+1)+(n+1)1+2\cdot(1n1)=\tilde{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{n}}\bigr{)}.$

The argument required to establish this is analogous to that used in the proof
of Theorem 6.1 in Section 6, with some slight modifications, particularly in
the first steps. Suppose
$\tilde{\pi}_{n}=\tilde{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{n}}\bigr{)}$
has the form

$\tilde{\pi}_{n}\coloneqq\sum_{k=1}^{\frac{1}{2}(n+3)}\sum_{a_{1}a_{2}\cdots
a_{k}\in{\mathcal{C}}^{\ast}(n+2)}\tilde{c}_{a_{1}a_{2}\cdots
a_{k}}\cdot{\boldsymbol{a}}_{1}\ast{\boldsymbol{a}}_{2}\ast\cdots\ast{\boldsymbol{a}}_{k}.$

Note, implicitly, we exclude the possibility of the single term monomial
‘${\boldsymbol{(n+2)}}$’. When we explicitly evaluate the Pöppe products in
the monomials shown on the right in this expression for $\tilde{\pi}_{n}$, we
generate linear combinations of compositions in ${\mathcal{C}}(n+2)$. Just
like in the proof of Theorem 6.1, imagine constructing a table whose rows are
parametrised by the set of compositions ${\mathcal{C}}(n+2)$, ordered
according to descent order, and whose columns are parametrised by the set of
compositions ${\mathcal{C}}^{\ast}(n+2)$, also ordered according to descent
order. Our goal is to prove there exists a unique set of real coefficients
$\\{\tilde{c}_{w}\colon w\in{\mathcal{C}}^{\ast}(n+2)\backslash(n+2)\\}$ such
that in ${\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$, we have

$\sum_{k=1}^{\frac{1}{2}(n+3)}\sum_{a_{1}\cdots
a_{k}\in{\mathcal{C}}^{\ast}(n+2,k)}\tilde{c}_{a_{1}\cdots
a_{k}}\cdot{\boldsymbol{a}}_{1}\ast\cdots\ast{\boldsymbol{a}}_{k}=1(n+1)+(n+1)1+2\cdot(1n1).$

We nominate the final column in the table to represent the right-hand side in
the equation above which is
$1(n+1)+(n+1)1+2\cdot(1n1)\in{\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$.
Just as in the proof of Theorem 6.1, the table represents a linear equation of
the form

$\tilde{A}\,\tilde{C}=\tilde{B},$

where $\tilde{C}$ is the vector of unknown coefficients
$\\{\tilde{c}_{w}\colon w\in{\mathcal{C}}^{\ast}(n+2)\backslash(n+2)\\}$, in
descent order so
$C=(\tilde{c}_{n1},\tilde{c}_{(n-1)2},\ldots,\tilde{c}_{1n},c_{(n-2)11},\ldots)^{\mathrm{T}}$.
The vector $\tilde{B}$ contains all zeros apart from the rows corresponding to
the compositions $(n+1)1$, $1(n+1)$ and $1n1$, where it contains the
respective real values $1$, $1$ and $2$. As in the proof of Theorem 6.1 we
decompose the rows of $\tilde{A}$ into blocks of compositions in
${\mathcal{C}}(n+2,k^{\prime})$ for $k^{\prime}=2,\ldots,n$, and we can
decompose columns of $\tilde{A}$ into blocks of compositions in
${\mathcal{C}}^{\ast}(n-k+3,k)$ for $k=2,\ldots,\frac{1}{2}(n+3)$. In terms of
blocks, the matrix $\tilde{A}$ is lower block triangular. We proceed block by
block. To begin, we focus on the $2$-part composition sub-block of $\tilde{A}$
parametrised by the columns ${\mathcal{C}}^{\ast}(n+1,2)$ and by the rows
${\mathcal{C}}(n+2,2)$, both in descent order. The entries in $\tilde{A}$ are
equivalent to those shown in Table 2, once we neglect the first column and
replace $n$ by $n+2$ therein. This block has size $(n+1)\times n$. The first
equation in this block is $\tilde{c}_{n1}=1$. However, we temporarily ignore
this equation and the information it carries. The remaining $n\times n$ block
whose rows correspond to the compositions $n2$, $(n-1)3$, …, $1(n+1)$,
contains $(n-1)$ homogeneous linear equations for $\ell=2,\ldots,n$, given by

$\tilde{c}_{(n-\ell+2)(\ell-1)}+\tilde{c}_{(n-\ell+1)\ell}=0,$

and a final non-homogenous linear equation $\tilde{c}_{1n}=1$. Note, all the
signature coefficients are equal to $1$. Due to the inherent symmetry in the
relation between the terms given by $1(n+1)+(n+1)1+2\cdot(1n1)$ and
$\tilde{\pi}_{n}$ proposed above, we _replace_ this final equation by the
homogensous linear equation $-\tilde{c}_{n1}+\tilde{c}_{1n}=0$. The
homogeneous linear system of equations represent by those shown above for
$\ell=2,\ldots,n$ can by straightforwardly solved, systematically working
through the equations in order, giving
$\tilde{c}_{(n-\ell+1)\ell}=(-1)^{(\ell-1)}\tilde{c}_{n1}$. Note when $\ell=n$
we have
$\tilde{c}_{1n}=(-1)^{n-1}\tilde{c}_{n1}=(-1)^{2m}\tilde{c}_{n1}=\tilde{c}_{n1}$
when $n=2m+1$ is odd. This is thus consistent with the replacement we
introduced above. We henceforth retain the homogeneous linear system of
equations for $\ell=2,\ldots,n$ shown above, and the final replacement
homogeneous linear equation. We nominate the “free” variable to be
$\tilde{c}_{n1}$. This resulting $n\times n$ system of homogeneous linear
equations is upper triangular with all the leading diagonal entries non-zero.
Thus all these leading diagonal entries can be used as pivots in a Gaussian
elimination process to render all the entries in the corresponding columns in
the rows below this block to be zero.

We now adopt a strategy for solution for the linear system
$\tilde{A}\,\tilde{C}=\tilde{B}$, analogous to that in the proof of Theorem
6.1. However, before proceeding there is one minor _snag_ in the procedure we
must deal with first. The snag is that all the remaining linear equations are
homogeneous apart from one, namely that for the row corresponding to the
composition $1n1$. This non-homogeneous linear equation has the form

$\chi_{1(n-1){\otimes}1}\,\tilde{c}_{n1}+\chi_{1{\otimes}(n-1)1}\,\tilde{c}_{1n}+\chi_{1{\otimes}(n-2){\otimes}1}\,\tilde{c}_{1(n-2)1}=2.$

Note hereafter in this proof we denote the arguments of the signature
character maps $\chi$ as sub-indicies, as indicated in the equation above, for
brevity. Since we know that
$\chi_{1(n-1){\otimes}1}=\chi_{1{\otimes}(n-1)1}=\chi_{1(n-1)}\,\chi_{1}=n$
and $\chi_{1{\otimes}(n-2){\otimes}1}=1$, the equation above is equivalent to
$n\,\tilde{c}_{n1}+n\,\tilde{c}_{1n}+\tilde{c}_{1(n-2)1}=2$. This equation is
in turn equivalent to the relation $\tilde{c}_{1(n-2)1}=2-2n\,\tilde{c}_{1n}$.
We now demonstrate that this equation is consistent with the preceding pivot
equations, in terms of descent order. Recall our dicussion involving the level
$2$, $3$-part composition sub-blocks of $A$ in the proof of Theorem 6.1. The
pivot equation in the row preceding the row $1n1$ for the equation shown above
occurs in the row corresponding to the composition $2(n-1)1$. The pivot
equation in that row, i.e. in the row corresponding to $2(n-1)1$, involves the
unknown $\tilde{c}_{2(2-3)1}$, and so we must invoke the pivot equation
corresponding to that variable that lies in a preceding row. Iteratively
continuing this procedure we arrive at the following system of homogeneous
linear equations respectively given by the rows corresponding to the
compositions $2(n-1)1$, $3(n-2)1$, $4(n-3)1$, …, $(n-2)11$:

$\displaystyle\tilde{c}_{1(n-2)1}+\tilde{c}_{2(n-3)1}+\chi_{(n-2){\otimes}1}\,\tilde{c}_{n1}+\chi_{2{\otimes}(n-2)1}\,\tilde{c}_{2(n-1)}+\chi_{1{\otimes}(n-1)1}\,\tilde{c}_{1n}$
$\displaystyle=0,$
$\displaystyle\tilde{c}_{2(n-3)1}+\tilde{c}_{3(n-4)1}+\chi_{(n-3){\otimes}1}\,\tilde{c}_{n1}+\chi_{3{\otimes}(n-3)1}\,\tilde{c}_{3(n-2)}+\chi_{2{\otimes}(n-2)1}\,\tilde{c}_{2(n-1)}$
$\displaystyle=0,$
$\displaystyle\tilde{c}_{3(n-4)1}+\tilde{c}_{4(n-5)1}+\chi_{(n-4){\otimes}1}\,\tilde{c}_{n1}+\chi_{4{\otimes}(n-4)1}\,\tilde{c}_{4(n-3)}+\chi_{3{\otimes}(n-3)1}\,\tilde{c}_{3(n-2)}$
$\displaystyle=0,$ $\displaystyle\vdots$
$\displaystyle\tilde{c}_{(n-3)21}+\tilde{c}_{(n-2)11}+\chi_{(n-2)2{\otimes}1}\,\tilde{c}_{n1}+\chi_{(n-2){\otimes}21}\,\tilde{c}_{(n-2)3}+\chi_{(n-3){\otimes}31}\,\tilde{c}_{(n-3)4}$
$\displaystyle=0,$
$\displaystyle\tilde{c}_{(n-2)11}+\chi_{(n-1)1{\otimes}1}\,\tilde{c}_{n1}+\chi_{(n-1){\otimes}11}\,\tilde{c}_{(n-1)2}+\chi_{(n-2){\otimes}21}\,\tilde{c}_{(n-2)3}$
$\displaystyle=0.$

We now utilise that for $\ell=2,\ldots,n$ we know
$\tilde{c}_{(n-\ell+1)\ell}=(-1)^{(\ell-1)}\tilde{c}_{n1}$. Solving the
homogeneous linear system of equations above in reverse we observe:

$\displaystyle\tilde{c}_{(n-2)11}$
$\displaystyle=\bigl{(}\chi_{(n-1)1}-1\bigr{)}\,\tilde{c}_{n1},$
$\displaystyle\tilde{c}_{(n-3)21}$
$\displaystyle=\bigl{(}\chi_{(n-1)1}-\chi_{(n-2)2}+2\bigr{)}\,\tilde{c}_{n1},$
$\displaystyle\vdots$ $\displaystyle\tilde{c}_{1(n-2)1}$
$\displaystyle=\bigl{(}\chi_{(n-1)1}+\cdots+(-1)^{n-1}\chi_{2(n-2)}+(-1)^{n-2}(n-2)\bigr{)}\,\tilde{c}_{n1}.$

We observe that the coefficient of $\tilde{c}_{n1}$ on the right for odd $n$
is given by,

$\displaystyle\chi_{(n-1)1}-$
$\displaystyle\chi_{(n-2)2}+\cdots+(-1)^{n-1}\chi_{2(n-2)}+(-1)^{n-2}(n-2)$
$\displaystyle=\begin{pmatrix}n\\\ (n-1)\end{pmatrix}-\begin{pmatrix}n\\\
(n-2)\end{pmatrix}+\cdots+(-1)^{n-1}\begin{pmatrix}n\\\
2\end{pmatrix}+(-1)^{n-2}(n-2)$
$\displaystyle=-\Bigl{(}(1-x)^{n}-1-n(-x)^{n-1}-(-x)^{n}\Bigr{)}\Big{|}_{x=1}-(n-2)$
$\displaystyle=2-2n.$

Hence we observe that we have the two expressions resulting from the row
corresponding to the composition $1n1$, namely
$\tilde{c}_{1(n-2)1}=2-2n\,\tilde{c}_{1n}$ and
$\tilde{c}_{1(n-2)1}=(2-2n)\,\tilde{c}_{1n}$. Temporarily holding these two
equations back, we observe that we can proceed to determine all of the
coefficients $\tilde{c}_{w}$ for
$w\in{\mathcal{C}}^{\ast}(n+1)\backslash(n+2)$ in terms of $\tilde{c}_{n1}$ by
precisely following the procedure outlined in the proof of Theorem 6.1.
Finally we recover the first equation, i.e. that $\tilde{c}_{n1}=1$, which
determines all the coefficients $\tilde{c}_{w}$ uniquely, and shows the two
equations we temporarily held back are consistent. ∎

######  Remark 14 (The Lax hierarchy is unique)

The hierarchy given in Theorem 6.1 at each odd order $n$ has a field given by
a unique polynomial
$\pi_{n}=\pi_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{(n-2)}},{\boldsymbol{n}}\bigr{)}$
in ${\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$. For the Lax hierarchy
presented in Theorem 7.1 the vector field has the polynomial form
${\boldsymbol{n}}+\hat{\pi}_{n}\bigl{(}{\boldsymbol{1}},{\boldsymbol{2}},\ldots,{\boldsymbol{(n-2)}}\bigr{)}$
in ${\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$. The uniqueness of the
former polynomial guarantees the two hierarchies are uniquely one and the
same.

##  8 Conclusion

We have shown that integrability in the sense of linearisation for the whole
Korteweg–de Vries hierarchy is equivalent to the existence of polynomial
expansions for basic compositions in the real algebra of compositions equipped
with the Pöppe product, ${\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$.
This procedure opens many new research directions we intend to pursue next:

  1. (i)

Do all compositions and/or linear combinations of compositions in
${\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$ have Pöppe polynomial
expansions?

  2. (ii)

There are natural connections to shuffle algebras, Rota–Baxter operators,
symmetric functions and so forth, do these provide any further insight into
integrability in this context?

  3. (iii)

The Pöppe product can be considered as a quasi-Leibniz product with the third
term in Definition 7 considered to be the modification from the Leibniz
product. This term is analogous to the the modification distinguishing the
quasi-shuffle product from the shuffle product, see for example Curry et al.
CE-FMW . A natural question is, how robust are the results established in
Sections 6 and 7 to perturbation of the coefficient ‘$2$’ in front of the
third modification term in the Pöppe product?

  4. (iv)

The shuffle product and de-shuffle co-product are adjoint operators, as are
the concatenation product and deconcatenation, see Reutenauer (Reu, , p. 27).
Can we prove that the Pöppe product and de-Pöppe co-product are adjoint
operations?

  5. (v)

Following on from (iv), and as hinted at in Section 5, a natural progression
is to introduce the following tensor product of algebras:
${\mathbb{S}}\otimes{\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$. Note
we have
${\mathbb{S}}\cong{\mathbb{R}}{\langle}{\mathcal{C}}^{\otimes}{\rangle}$. The
idea is to pull back linear combinations and/or polynomials in
${\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}\cong\chi({\mathbb{S}})\otimes{\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$
to ${\mathbb{S}}\otimes{\mathbb{R}}{\langle}{\mathcal{C}}{\rangle}_{\ast}$ and
then perform computations in this latter algebra. Then further natural
questions arise concerning whether it is possible to endow ${\mathbb{S}}$ with
a compatible product and
${\mathbb{R}}{\langle}{\mathcal{C}}^{\otimes}{\rangle}$ a compatible co-
product to raise their status to bi-algebras and perhaps even Hopf algebras?

  6. (vi)

The generation of the Korteweg–de Vries hierarchy via the Lax iteration shown
in Theorem 7.1 involves evaluating a second order derivation
$\mathfrak{d}^{2}$ together with the other terms shown. We know from Theorem
7.1 that overall, the terms generated via the Lax iteration can be expressed
in the form of a polynomial in the signature expansions. Further for example,
the nonlinear terms can be expressed in terms of derivations as follows. For
the quintic non-commutative potential Korteweg–de Vries equation, the
quadratic nonlinear terms can be encoded as
$5\cdot\bigl{(}\mathfrak{d}^{2}(\boldsymbol{1}\ast\boldsymbol{1})-\boldsymbol{2}\ast\boldsymbol{2}\bigr{)}$.
For the septic version in the hierarchy the quadratic nonlinear terms can be
encoded as
$7\cdot\bigl{(}\mathfrak{d}^{4}(\boldsymbol{1}\ast\boldsymbol{1})-2\cdot\mathfrak{d}^{2}(\boldsymbol{2}\ast\boldsymbol{2})+\boldsymbol{3}\ast\boldsymbol{3}\bigr{)}$.
The question is, can the cubic and higher degree terms be similarly encoded
and this formulation of the nonlinear terms be propagated to all orders?

  7. (vii)

Finally, crucially, Doikou et al. DMS20  prove that the non-commutative
nonlinear Schrö-dinger and modified Korteweg–de Vries flows are Grassmannian
flows and integrable in this sense. Indeed we show that nonlocal reverse time
and reverse space-time versions of these equations are also Grassmannian
flows. See Ablowitz and Musslimani AM , Gürses and Pekcan GP2019a ; GP2019b ;
GP2018 ; GP2020  and Fokas LABEL:Fokas2016 for more details on such systems.
Further, Malham M-quinticNLS  demonstrated that the local and nonlocal non-
commutative fourth order quintic nonlinear Schrödinger flow is also a
Grassmannian flow. A natural extension is to determine if the combinatorial
algebraic procedure we develop herein can be extended, in modified form, to
all orders in the classical hierarchies for such non-commutative integrable
systems? A modification is necessary as the linear system of equations
required to prescribe the Grassmannian flow for these systems has the form:
$\mathcal{P}=\mathcal{G}({\mathrm{id}}+\mathcal{Q})$, where

$\mathcal{P}=\begin{pmatrix}P\\\
\tilde{P}\end{pmatrix},\qquad\mathcal{Q}=\begin{pmatrix}Q&O\\\
O&\tilde{Q}\end{pmatrix}\qquad\text{and}\qquad\mathcal{G}=\begin{pmatrix}G\\\
\tilde{G}\end{pmatrix}.$

Here the block operators shown satisfy the following linear system of
equations: $\partial_{t}P=d(\partial)P$,
$\partial_{t}\tilde{P}=\tilde{d}(\partial)\tilde{P}$, $Q\coloneqq\tilde{P}P$
and $\tilde{Q}\coloneqq P\tilde{P}$, and $d$ as well as $\tilde{d}$ are
suitable constant coefficient polynomials in $\partial$. Note once the
operators $P$ and $\tilde{P}$ are determined as solutions to the linear
partial differential systems shown, the operators $Q$ and $\tilde{Q}$ are
prescibed by the quadratic forms shown. It is these definitions for $Q$ and
$\tilde{Q}$ that necessitate, for the fully general case, a non-trivial
extension of the combinatorial algebra introduced herein.

###### Acknowledgements.

SJAM thanks Ioannis Stylianidis for some very helpful discussions.

## References

  * (1) Abbondandolo A, Majer P. 2009 Infinite dimensional Grassmannians. J. Operator Theory 61(1).
  * (2) Ablowitz MJ, Musslimani ZH. 2017 Integrable Nonlocal Nonlinear Equations, Stud. Appl. Math. 139(1).
  * (3) Ablowitz MJ, Prinari B, Trubatch D. 2004 Discrete and Continuous Nonlinear Schrödinger Systems, Cambridge University Press.
  * (4) M.J. Ablowitz, A. Ramani, H. Segur, A connection between nonlinear evolution equations and ordinary differential equations of P-type. II, Journal of Mathematical Physics 21, 1006–1015 (1980).
  * (5) P. Adamopoulou, G. Papamikos, Drinfel’d–Sokolov construction and exact solutions of vector modified KdV hierarchy, Nuclear Physics B 952, 114933 (2020).
  * (6) H. Aden, B. Carl, On realizations of solutions of the KdV equation by determinants on operator ideals, J. Math. Phys. 37, 1833 (1996).
  * (7) E. Andruchow, G. Larotonda, Lagrangian Grassmannian in infinite dimension, Journal of Geometry and Physics 59, 306–320 (2009).
  * (8) W. Bauhardt, Ch. Pöppe, The Zakharov–Shabat inverse spectral problem for operators, J. Math, Phys. 34(7), 3073–3086 (1993).
  * (9) M. Beck, S.J.A. Malham, Computing the Maslov index for large systems, PAMS 143, 2159–2173 (2015).
  * (10) M. Beck, A. Doikou, S.J.A. Malham, I. Stylianidis, Grassmannian flows and applications to nonlinear partial differential equations, Proc. Abel Symposium (2018).
  * (11) M. Beck, A. Doikou, S.J.A. Malham, I. Stylianidis, Partial differential systems with nonlocal nonlinearities: generation and solutions, Phil. Trans. R. Soc. A 376(2117) (2018).
  * (12) G. Blower, S. Newsham, On tau functions associated with linear systems, Operator theory advances and applications: IWOTA Lisbon 2019. ed. Amelia Bastos; Luis Castro; Alexei Karlovich. Springer Birkhäuser, 2020. (International Workshop on Operator Theory and Applications).
  * (13) A. Buryak, P. Rossi, Quadratic double ramification integrals and the noncommutative KdV hierarchy, arXix:1909.11617v3, (2021).
  * (14) S. Carillo, C. Schoenlieb, Noncommutative Korteweg–de Vries and modified Korteweg–de Vries hierarchies via recursion methods, J. Math. Phys. 50, 073510 (2009).
  * (15) S. Carillo, C. Schoenlieb, Matrix Korteweg–de Vries and modified Korteweg–de Vries hierarchies: Noncommutative soliton solutions, J. Math. Phys. 52, 053507 (2011).
  * (16) S. Carillo, C. Schoenlieb, Nonlinear evolution equations: Bäcklund transformations and Bäcklund charts, Acta Appl. Math. 122, 93–106 (2012).
  * (17) C. Curry, K. Ebrahimi-Fard, S.J.A. Malham, A. Wiese, Algebraic structures and stochastic differential equations driven by Lévy processes, Proc. R. Soc. A 475, Issue 2221 (2015).
  * (18) A. Degasperis, S. Lombardo, Multicomponent integrable wave equations: II. Soliton solutions, J. Phys. A: Math. Theor. 42(38) (2009).
  * (19) A. Dimakis, F. Müller–Hoissen, An algebaric scheme associated with the noncommutative KP hierarchy and some of its extensions, J. Phys. A: Math. Gen. 38, 5453–5505 (2005).
  * (20) A. Dimakis, F. Müller–Hoissen, Weakly non-associative algebras, Riccati and KP hierarchies, in Generalized Lie Theory in Mathematics, Physics and Beyond, edited by S. Silvestrov, E. Paal, V. Abramov and A. Stolin, Springer–Verlag, 9–27 (2008).
  * (21) A. Doikou, S.J.A. Malham, I. Stylianidis, Grassmannian flows and applications to non-commutative non-local and local integrable systems, Physica D 415, 132744 (2021).
  * (22) A. Doikou, S.J.A. Malham, I. Stylianidis, A. Wiese, Applications of Grassmannian flows to nonlinear systems, submitted (2020).
  * (23) F.J. Dyson, Fredholm determinants and inverse scattering problems, Commun. Math. Phys. 47, 171–183 (1976).
  * (24) K. Ebrahimi–Fard, A. Lundervold, S.J.A. Malham, H. Munthe–Kaas, A. Wiese, Algebraic structure of stochastic expansions and efficient simulation, Proc. R. Soc. A 468, 2361–2382 (2012).
  * (25) K. Ebrahimi–Fard, S.J.A. Malham, F. Patras, A. Wiese, The exponential Lie series for continuous semimartingales, Proc. R. Soc. A 471 (2015).
  * (26) N. Ercolani, H.P. McKean, Geometry of KDV (4): Abel sums, Jacobi variety, and theta function in the scattering case, Invent. Math. 99, 483–-544 (1990).
  * (27) A.S. Fokas, Integrable multidimensional versions of the nonlocal nonlinear Schrödinger equation, Nonlinearity 29, 319–324 (2016).
  * (28) A.S. Fokas, M.J. Ablowitz, Linearization of the Kortweg de Vries and Painlevé II Equations, Phys. Rev. Lett. 47, 1096 (1981).
  * (29) A. S. Fokas, B. Pelloni, Unified Transform for Boundary Value Problems: Applications and Advances, Society for Industrial and Applied Mathematics (2014).
  * (30) A.P. Fordy, P.P. Kulish, Nonlinear Schrödinger Equations and Simple Lie Algebras, Commun. Math. Phys. 89, 427–443 (1983).
  * (31) W. Fu, Direct linearisation of discrete and continuous integrable systems: The KP hierarchy and its reductions, PhD Thesis, University of Leeds (2018).
  * (32) W. Fu, F.W. Nijhoff, Elementary introduction to direct linearisation of integrable systems, Chapter in the book “Nonlinear Systems and Their Remarkable Mathematical Structures”, Chapman and Hall/CRC (2021).
  * (33) V.S. Gerjikov, On Kaup–Kuperschmidt-type equations and their soliton solutions, Nuovo Cim. C 38 (2016).
  * (34) G.G. Grahovski, A.J. Mohammed, H. Susanto, Nonlocal Reductions of the Ablowitz-Ladik Equation, Theor. Math. Phys. 197, 1412–1429 (2018).
  * (35) S. Grellier, P. Gerard, The cubic Szegö equation and Hankel operators, Astérisque 389 (2017), Société Mathématique de France, Paris.
  * (36) S. Grudsky, A. Rybkin, On classical solutions of the KdV equation, Proc. London Math. Soc. 121, 354–371 (2020).
  * (37) S. Grudsky, A. Rybkin, Soliton theory and Hankel operators, SIAM J. Math. Anal. 47(3), 2283–2323 (2015).
  * (38) A. Grünrock, On the hierarchies of higher order mKdV and KdV equations, Cent. Eur. J. Math. 8(3), 500–536 (2010).
  * (39) M. Gürses, A. Pekcan, Superposition of the coupled NLS and MKdV Systems, Appl. Math. Lett. 98, 157–163 (2019).
  * (40) M. Gürses, A. Pekcan, Nonlocal modified KdV equations and their soliton solutions, Commun. Nonlinear Sci. Numer. Simul. 67, 427–448 (2019).
  * (41) M. Gürses, A. Pekcan, Nonlocal nonlinear Schrodinger equations and their soliton solutions, J. Math. Phys. 59, 051501 (2018).
  * (42) M. Gürses, A. Pekcan, Nonlocal KdV equations, arXiv:2004.07144 (2020).
  * (43) M. Hamanaka, K. Toda, Towards noncommutative integrable equations, Proceedings of the Institute of Mathematics of NAS of Ukraine 50(1), 404–411 (2004).
  * (44) A. Kasman, Bispectral KP solutions and linearization of Calogero–Moser particle systems, Comm. Math.Phys. 172, 427–448 (1995).
  * (45) A. Kasman, Grassmannians, nonlinear wave equations and generalized Schur functions, in Contemporary Mathematics: Geometry and Topology in Dynamics, Volume 246, AMS (1999).
  * (46) S.J.A. Malham, Integrability of local and nonlocal non-commutative fourth order quintic nonlinear Schrödinger equations, submitted (2021).
  * (47) S.J.A. Malham, A. Wiese, Stochastic expansions and Hopf algebras, Proc. R. Soc. A 465, 3729–3749 (2009).
  * (48) S.V. Manakov, On the theory of two-dimensional stationary self-focusing of electromagnetic waves, Sov. Phys. - JETP 38(2), 248–253 (1974).
  * (49) V.B. Matveev, A.O. Smirnov, AKNS and NLS hierarchies, MRW solutions, $P_{n}$ breathers, and beyond, Journal of Mathematical Physics 59, 091419 (2018).
  * (50) H.P. McKean, Fredholm determinants, Cent. Eur. J. Math. 9, 205–243 (2011).
  * (51) Meyer CD, 2000. Matrix analysis and applied linear algebra, SIAM.
  * (52) D. Mumford Tata lectures on Theta II, Modern Birkhauser Classics (1984).
  * (53) F.W. Nijhoff, G.R.W. Quispel, J. Van Der Linden, H.W. Capel, On some linear integral equations generating solutions of nonlinear partial differential equations, Physica A 119, 101–142 (1983).
  * (54) D.E. Pelinovsky, Y.A. Stepanyants, Helical solitons in vector modified Korteweg-de Vries equations, Physics Letters A 382, 3165–3171 (2018).
  * (55) C. Pöppe, Construction of solutions of the sine-Gordon equation by means of Fredholm determinants, Physica D 9, 103–139 (1983).
  * (56) C. Pöppe, The Fredholm determinant method for the KdV equations, Physica D 13, 137–160 (1984).
  * (57) C. Pöppe, General determinants and the $\tau$ function for the Kadomtsev-Petviashvili hierarchy, Inverse Problems 5, 613–630 (1984).
  * (58) C. Pöppe, D.H. Sattinger, Fredholm determinants and the $\tau$ function for the Kadomtsev-Petviashvili hierarchy, Publ. RIMS, Kyoto Univ. 24, 505–538 (1988).
  * (59) A. Pressley, G. Segal, Loop groups, Oxford Mathematical Monographs, Clarendon Press, Oxford (1986).
  * (60) C. Reutenauer, Free Lie Algebras, London Mathematical Society Monographs, Clarendon Press, Oxford (1993).
  * (61) M. Sato, Soliton equations as dynamical systems on a infinite dimensional Grassmann manifolds. RIMS 439, 30–46 (1981).
  * (62) M. Sato, The KP hierarchy and infinite dimensional Grassmann manifolds, Proceedings of Symposia in Pure Mathematics 49 Part 1, 51–66 (1989).
  * (63) G. Segal, G. Wilson, Loop groups and equations of KdV type, Inst. Hautes Etudes Sci. Publ. Math. 61, 5-–65 (1985).
  * (64) Simon B 2005 _Trace ideals and their applications_ , 2nd edn. Mathematical Surveys and Monographs, vol. 120. Providence, RI: AMS.
  * (65) C.M. Sooman, Soliton solutions of noncommutative integrable systems, PhD Thesis, University of Glasgow (2009).
  * (66) I. Stylianidis, Grassmannian flows: applications to PDEs with local and nonlocal nonlinearities, PhD Thesis (2021).
  * (67) F. Treves, Noncommutative KdV hierarchy, Revi. Math. Phys. 19, 677–724 (2007).
  * (68) F. Treves, Multidimensional soliton integrodifferential systems, in Advances in Phase Space Analysis of Partial Differential Equations, Progress in Nonlinear Differential Equations and Their Applications, Volume 78, Eds. A. Bove, D. Del Santo, M.K. Venkatesha Murthy, Birkhäuser (2009).
  * (69) V.E. Zakharov, A.B. Shabat, A scheme for integrating the nonlinear equations of mathematical physics by the method of the inverse scattering problem I, Funct. Anal. Appl. 8, 226–235 (1974).
  * (70) V.E. Zakharov, A.B. Shabat, Integration of nonlinear equations of mathematical physics by the method of inverse scattering II, Funct. Anal. Appl. 13(3), 166–-174 (1979).

##  Appendix A Signature co-algebra proof

We prove Theorem 5.1. First, let us prove axiom (i). Since the co-unit given
in Definition 11 sends all non-empty words to $0\in{\mathbb{R}}$ and the empty
word $\nu$ to $1\in{\mathbb{R}}$, if we apply
${\mathrm{id}}\otimes\varepsilon$ to the form for $\Delta(a_{1}a_{2}\cdots
a_{n})$ given in Lemma 5, we observe the only non-zero image would be from the
final term for which $({\mathrm{id}}\otimes\varepsilon)\circ(a_{1}\cdots
a_{n}\otimes\nu)=a_{1}\cdots a_{n}={\mathrm{id}}\circ(a_{1}\cdots a_{n})$.
Likewise the only non-zero image of $\varepsilon\otimes{\mathrm{id}}$ would be
from the first term for which
$(\varepsilon\otimes{\mathrm{id}})\circ(\nu\otimes a_{1}\cdots
a_{n})=a_{1}\cdots a_{n}={\mathrm{id}}\circ(a_{1}\cdots a_{n})$. Hence axiom
(i) is satisfied.

Second, we focus on proving axiom (ii). It helps to consider the co-product
$\delta\colon{\mathcal{C}}\to{\mathcal{C}}\otimes{\mathcal{C}}$ which denotes
the standard deconcatenation co-product, i.e. for any composition
$a_{1}a_{2}\cdots a_{n}\in{\mathcal{C}}$ we have

$\delta(a_{1}a_{2}\cdots a_{n})=\sum_{k=0}^{n}a_{1}\cdots a_{k}\otimes
a_{k+1}\cdots a_{n},$

where we use the convention that when $k=0$ and $k=n$, the corresponding terms
are respectively $\nu\otimes a_{1}a_{2}\cdots a_{n}$ and $a_{1}\cdots
a_{n}\otimes\nu$. Note we have $\delta(\nu)=\nu\otimes\nu$. We observe that if
we apply $({\mathrm{id}}\otimes\delta)$ to the last expression we get

$\displaystyle({\mathrm{id}}\otimes\delta)\circ\delta(a_{1}a_{2}\cdots a_{n})$
$\displaystyle=\sum_{k=0}^{n}a_{1}\cdots a_{k}\otimes\delta(a_{k+1}\cdots
a_{n})$ $\displaystyle=\sum_{k=0}^{n}a_{1}\cdots
a_{k}\otimes\Biggl{(}\sum_{\ell=0}^{n-k}a_{k+1}\cdots a_{k+\ell}\otimes
a_{k+\ell+1}\cdots a_{n})\Biggr{)}$
$\displaystyle=\sum_{k=0}^{n}\sum_{\ell=0}^{n-k}a_{1}\cdots a_{k}\otimes
a_{k+1}\cdots a_{k+\ell}\otimes a_{k+\ell+1}\cdots a_{n}.$

We observe the last line represents the sum over all possible ways to
deconcatenate $a_{1}\cdots a_{n}$ into three parts, by performing a “left-to-
right” secondary deconcatenation after the first. Hence we expect the action
of $(\delta\otimes{\mathrm{id}})$ on $\delta(a_{1}a_{2}\cdots a_{n})$ to
correspond to performing “right-to-left” secondary deconcatenation after the
first, producing the same triple deconcatenation result. Indeed we observe,

$\displaystyle(\delta\otimes{\mathrm{id}})\circ\delta(a_{1}a_{2}\cdots a_{n})$
$\displaystyle=\sum_{k=0}^{n}\delta(a_{1}\cdots a_{k})\otimes a_{k+1}\cdots
a_{n}$ $\displaystyle=\sum_{k=0}^{n}\Biggl{(}\sum_{\ell=0}^{k}a_{1}\cdots
a_{\ell}\otimes a_{\ell+1}\cdots a_{k}\Biggr{)}\otimes a_{k+1}\cdots a_{n}$
$\displaystyle=\sum_{k=0}^{n}\sum_{\ell=0}^{k}a_{1}\cdots a_{\ell}\otimes
a_{\ell+1}\cdots a_{k}\otimes a_{k+1}\cdots a_{n}$
$\displaystyle=\sum_{\ell=0}^{n}\sum_{k=\ell}^{n}a_{1}\cdots a_{\ell}\otimes
a_{\ell+1}\cdots a_{k}\otimes a_{k+1}\cdots a_{n}$
$\displaystyle=\sum_{\ell=0}^{n}\sum_{k=0}^{n-\ell}a_{1}\cdots a_{\ell}\otimes
a_{\ell+1}\cdots a_{k+\ell}\otimes a_{k+\ell+1}\cdots a_{n},$

which is the same as the “left-to-right” sum once we swap the identities of
the dummy summation variables $k$ and $\ell$. The identification of
$({\mathrm{id}}\otimes\Delta)\circ\Delta$ and
$(\Delta\otimes{\mathrm{id}})\circ\Delta$ follows in exactly the same way. For
the $\Delta(a_{1}\cdots a_{n})$ co-product expansion, except for the
$\nu\otimes a_{1}\cdots a_{n}$ and $a_{1}\cdots a_{n}\otimes\nu$ terms, we
replace the terms $a_{1}\cdots a_{k}\otimes a_{k+1}\cdots a_{n}$ in
$\delta(a_{1}\cdots a_{n})$ for $k=1,\ldots,n-1$ by the pair of terms

$a_{1}\cdots a_{k-1}(a_{k}-1)\otimes a_{k+1}\cdots a_{n}+a_{1}\cdots
a_{k}\otimes(a_{k+1}-1)a_{k+2}\cdots a_{n}.$

The co-product $\Delta(a_{1}\cdots a_{n})$ tensorally decomposes $a_{1}\cdots
a_{n}$ into the sum of all possible composition pairs that produce
$a_{1}\cdots a_{n}$ via the Pöppe product $\ast$, including the empty
composition $\nu$. Hence $({\mathrm{id}}\otimes\Delta)\circ\Delta$ will
tensorally decompose $a_{1}\cdots a_{n}$ into the sum of all possible
composition triples $u\otimes v\otimes w$ that produce $a_{1}\cdots a_{n}$ via
the Pöppe product $u\ast v\ast w$. The action of
$({\mathrm{id}}\otimes\Delta)\circ\Delta$ is to perform a “left-to-right”
secondary de-Pöppe co-product after a first application of the de-Pöppe co-
product. The action of $(\Delta\otimes{\mathrm{id}})\circ\Delta$ is to perform
a “right-to-left” secondary de-Pöppe co-product after a first application of
the de-Pöppe co-product. Both generate the same sum over all triples $u\otimes
v\otimes w$ that produce $a_{1}\cdots a_{n}$. As in the proof of Lemma 5, care
must be taken to account for instances when $a_{k}=1$. These can be taken care
of by a post-application of $\theta\otimes\theta\otimes\theta$ and extending
the definition of $\theta$ to include the circumstance
$\theta\colon-\boldsymbol{1}\mapsto 0\,\nu$ where in the image
$0\in{\mathbb{R}}$ so the corresponding term is eliminated. The expression
$-\boldsymbol{1}$ could arise through a double application of
$\mathfrak{d}^{-1}$ to a letter $a=1$. We have thus established that axiom
(ii) is satisfied. The proof is complete.

##  Appendix B Tables

Table 3: Non-zero signature coefficients in $\pi_{n}$ appearing in the $3$-part composition blocks of $A$. The coefficients are the $\chi$-images of the signature entries shown. $\\!\phantom{\biggl{|}}{\mathcal{C}}\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!4)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!5)}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!5)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{2}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!6)}\scriptsize{\ast}\boldsymbol{3}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!6)}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{2}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!6)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{3}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!7)}\scriptsize{\ast}\boldsymbol{4}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!7)}\scriptsize{\ast}\boldsymbol{3}\scriptsize{\ast}\boldsymbol{2}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!7)}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{3}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!7)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{4}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!8)}\scriptsize{\ast}\boldsymbol{5}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\cdots$
---|---|---|---|---|---|---|---|---|---|---|---|---
$\\!\\!(n-2)11\\!\\!$ |  |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-3)21\\!\\!$ | $\\!\\!(n-4){\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-3)12\\!\\!$ | $\\!\\!(n-4){\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-4)31\\!\\!$ | $\\!\\!(n-4){\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-5){\otimes}2{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-4)22\\!\\!$ | $\\!\\!(n-4){\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-5){\otimes}2{\otimes}1\\!\\!$ | $\\!\\!(n-5){\otimes}1{\otimes}2\\!\\!$ |  |  |  |  |  |  |  |  |
$\\!\\!(n-4)13\\!\\!$ |  |  | $\\!\\!(n-5){\otimes}1{\otimes}2\\!\\!$ |  |  |  |  |  |  |  |  |
$\\!\\!(n-5)41\\!\\!$ |  | $\\!\\!(n-5){\otimes}2{\otimes}1\\!\\!$ |  | $\\!\\!(n-6){\otimes}3{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |
$\\!\\!(n-5)32\\!\\!$ |  | $\\!\\!(n-5){\otimes}2{\otimes}1\\!\\!$ | $\\!\\!(n-5){\otimes}1{\otimes}2\\!\\!$ | $\\!\\!(n-6){\otimes}3{\otimes}1\\!\\!$ | $\\!\\!(n-6){\otimes}2{\otimes}2\\!\\!$ |  |  |  |  |  |  |
$\\!\\!(n-5)23\\!\\!$ |  |  | $\\!\\!(n-5){\otimes}1{\otimes}2\\!\\!$ |  | $\\!\\!(n-6){\otimes}2{\otimes}2\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}3\\!\\!$ |  |  |  |  |  |
$\\!\\!(n-5)14\\!\\!$ |  |  |  |  |  | $\\!\\!(n-6){\otimes}1{\otimes}3\\!\\!$ |  |  |  |  |  |
$\\!\\!(n-6)51\\!\\!$ |  |  |  | $\\!\\!(n-6){\otimes}3{\otimes}1\\!\\!$ |  |  | $\\!\\!(n-7){\otimes}4{\otimes}1\\!\\!$ |  |  |  |  |
$\\!\\!(n-6)42\\!\\!$ |  |  |  | $\\!\\!(n-6){\otimes}3{\otimes}1\\!\\!$ | $\\!\\!(n-6){\otimes}2{\otimes}2\\!\\!$ |  | $\\!\\!(n-7){\otimes}4{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}3{\otimes}2\\!\\!$ |  |  |  |
$\\!\\!(n-6)33\\!\\!$ |  |  |  |  | $\\!\\!(n-6){\otimes}2{\otimes}2\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}3\\!\\!$ |  | $\\!\\!(n-7){\otimes}3{\otimes}2\\!\\!$ | $\\!\\!(n-7){\otimes}2{\otimes}3\\!\\!$ |  |  |
$\\!\\!(n-6)24\\!\\!$ |  |  |  |  |  | $\\!\\!(n-6){\otimes}1{\otimes}3\\!\\!$ |  |  | $\\!\\!(n-7){\otimes}2{\otimes}3\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}4\\!\\!$ |  |
$\\!\\!(n-6)15\\!\\!$ |  |  |  |  |  |  |  |  |  | $\\!\\!(n-7){\otimes}1{\otimes}4\\!\\!$ |  |
$\\!\\!(n-7)61\\!\\!$ |  |  |  |  |  |  | $\\!\\!(n-7){\otimes}4{\otimes}1\\!\\!$ |  |  |  | $\\!\\!(n-8){\otimes}5{\otimes}1\\!\\!$ |
$\\!\\!(n-7)52\\!\\!$ |  |  |  |  |  |  | $\\!\\!(n-7){\otimes}4{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}3{\otimes}2\\!\\!$ |  |  | $\\!\\!(n-8){\otimes}5{\otimes}1\\!\\!$ |
$\\!\\!(n-7)43\\!\\!$ |  |  |  |  |  |  |  | $\\!\\!(n-7){\otimes}3{\otimes}2\\!\\!$ | $\\!\\!(n-7){\otimes}2{\otimes}3\\!\\!$ |  |  |
$\vdots$ |  |  |  |  |  |  |  |  |  |  |  |
Table 4: Non-zero signature coefficients in $\pi_{n}$ appearing in the $4$-part composition blocks of $A$. The coefficients are the $\chi$-images of the signature entries shown. $\\!\phantom{\biggl{|}}{\mathcal{C}}\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!6)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!7)}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!7)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!7)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{2}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!8)}\scriptsize{\ast}\boldsymbol{3}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!8)}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!8)}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{2}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!8)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{3}\scriptsize{\ast}\boldsymbol{1}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!8)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{2}\scriptsize{\ast}\boldsymbol{2}\\!\\!$ | $\\!\\!\boldsymbol{(n\\!-\\!8)}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{1}\scriptsize{\ast}\boldsymbol{3}\\!\\!$ | $\cdots$
---|---|---|---|---|---|---|---|---|---|---|---
$\\!\\!(n-3)111\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-4)211\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-4)121\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-4)112\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-5)311\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-5)221\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-5)212\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-5)131\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-5)122\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-5)113\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-6)411\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-6)321\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}2{\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |
$\\!\\!(n-6)312\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}2{\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |  |
$\\!\\!(n-6)231\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}2{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}2{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |
$\\!\\!(n-6)222\\!\\!$ | $\\!\\!(n-6){\otimes}1{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}2{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}2{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}1{\otimes}2\\!\\!$ |  |  |  |  |  |  |
$\\!\\!(n-6)213\\!\\!$ |  |  |  | $\\!\\!(n-7){\otimes}1{\otimes}1{\otimes}2\\!\\!$ |  |  |  |  |  |  |
$\\!\\!(n-6)141\\!\\!$ |  |  | $\\!\\!(n-7){\otimes}1{\otimes}2{\otimes}1\\!\\!$ |  |  |  |  |  |  |  |
$\\!\\!(n-6)132\\!\\!$ |  |  | $\\!\\!(n-7){\otimes}1{\otimes}2{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}1{\otimes}2\\!\\!$ |  |  |  |  |  |  |
$\\!\\!(n-6)123\\!\\!$ |  |  |  | $\\!\\!(n-7){\otimes}1{\otimes}1{\otimes}2\\!\\!$ |  |  |  |  |  |  |
$\\!\\!(n-6)114\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-7)511\\!\\!$ |  |  |  |  |  |  |  |  |  |  |
$\\!\\!(n-7)421\\!\\!$ |  | $\\!\\!(n-7){\otimes}2{\otimes}1{\otimes}1\\!\\!$ |  |  | $\\!\\!(n-8){\otimes}3{\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |
$\\!\\!(n-7)412\\!\\!$ |  | $\\!\\!(n-7){\otimes}2{\otimes}1{\otimes}1\\!\\!$ |  |  | $\\!\\!(n-8){\otimes}3{\otimes}1{\otimes}1\\!\\!$ |  |  |  |  |  |
$\\!\\!(n-7)331\\!\\!$ |  | $\\!\\!(n-7){\otimes}2{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}2{\otimes}1\\!\\!$ |  | $\\!\\!(n-8){\otimes}3{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-8){\otimes}2{\otimes}2{\otimes}1\\!\\!$ |  |  |  |  |
$\\!\\!(n-7)322\\!\\!$ |  | $\\!\\!(n-7){\otimes}2{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}2{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}1{\otimes}2\\!\\!$ | $\\!\\!(n-8){\otimes}3{\otimes}1{\otimes}1\\!\\!$ | $\\!\\!(n-8){\otimes}2{\otimes}2{\otimes}1\\!\\!$ | $\\!\\!(n-8){\otimes}2{\otimes}1{\otimes}2\\!\\!$ |  |  |  |
$\\!\\!(n-7)313\\!\\!$ |  |  |  | $\\!\\!(n-7){\otimes}1{\otimes}1{\otimes}2\\!\\!$ |  |  | $\\!\\!(n-8){\otimes}2{\otimes}1{\otimes}2\\!\\!$ |  |  |  |
$\\!\\!(n-7)241\\!\\!$ |  |  | $\\!\\!(n-7){\otimes}1{\otimes}2{\otimes}1\\!\\!$ |  |  | $\\!\\!(n-8){\otimes}2{\otimes}2{\otimes}1\\!\\!$ |  | $\\!\\!(n-8){\otimes}1{\otimes}3{\otimes}1\\!\\!$ |  |  |
$\\!\\!(n-7)232\\!\\!$ |  |  | $\\!\\!(n-7){\otimes}1{\otimes}2{\otimes}1\\!\\!$ | $\\!\\!(n-7){\otimes}1{\otimes}1{\otimes}2\\!\\!$ |  | $\\!\\!(n-8){\otimes}2{\otimes}2{\otimes}1\\!\\!$ | $\\!\\!(n-8){\otimes}2{\otimes}1{\otimes}2\\!\\!$ | $\\!\\!(n-8){\otimes}1{\otimes}3{\otimes}1\\!\\!$ | $\\!\\!(n-8){\otimes}1{\otimes}2{\otimes}2\\!\\!$ |  |
$\\!\\!(n-7)223\\!\\!$ |  |  |  | $\\!\\!(n-7){\otimes}1{\otimes}1{\otimes}2\\!\\!$ |  |  | $\\!\\!(n-8){\otimes}2{\otimes}1{\otimes}2\\!\\!$ |  | $\\!\\!(n-8){\otimes}1{\otimes}2{\otimes}2\\!\\!$ | $\\!\\!(n-8){\otimes}1{\otimes}1{\otimes}3\\!\\!$ |
$\\!\\!(n-7)214\\!\\!$ |  |  |  |  |  |  |  |  |  | $\\!\\!(n-8){\otimes}1{\otimes}1{\otimes}3\\!\\!$ |
$\vdots$ |  |  |  |  |  |  |  |  |  |  |


Lab-Sticc, ENSTA-Bretagne

# Modeling and control of the rodwheel

Luc Jaulin

Abstract. The rodwheel is a wheel equipped with a rod motorized on the axle.
This paper proposes a Lagrangian approach to find the state equations of the
rodwheel rolling on a plane without friction. The approach takes advantage of
a symbolic computation. A controller is proposed to stabilize the rodwheel
with the rod upward and going straight at a desired speed.

##  1 Introduction

Consider a disk rolling on a plane without friction with a rod which can move
along the wheel plane [4] as shown on Figure 1. In the axle of the wheel, we
have a motor which produces a torque $u$ between the wheel and the rod.

Figure 1: Disk rolling on a plane with a rod

The disk has a mass $m=5\text{kg}$ and its radius is $r=1m$. The gravity is
taken as $g=9.81ms^{-2}.$ The mass $\mu=1\text{kg}$ of the rod is reduced to
the single point s which is at a distance $\ell=2m$ to the center $\mathbf{c}$
of the wheel.

In this paper, we want to find the state equations describing the motion of
the rodwheel. The rolling wheel model has already been found since a long time
(see _e.g._ [1]) and even highly studied since (see _e.g._ [8]). Extension to
more general wheel based vehicle have also been proposed (see _e.g._ [2] for
the bicycle). The problem of the wheel with the rod seems to be original and I
believe it can be used as a fast, light terrestrial robot to move in a urban
environment with a reduced amount of batteries. Computing the state equations
for a rodwheel is a tedious task. In this paper, I want to take advantage of
symbolic computing (here the sympy package of Python) in order to derive these
state equations. The Lagrangian approach [9], often applied to model robots
[3], will be chosen.

Once we have found the state model of the rodwheel, we will propose a
controller to make the rodwheel going straight ahead at a desired speed with
the rod upward. The control approach uses techniques dedicated to
underactuated mechanical systems [5].

##  2 Modeling

###  2.1 State vector

We take the state vector
$\mathbf{x}=(c_{1},c_{2},\varphi,\theta,\psi,\beta,\dot{\varphi},\dot{\theta},\dot{\psi},\dot{\beta})$
where $(c_{1},c_{2})$ is the vertical projection of center
$\mathbf{c}=(c_{1},c_{2},c_{3})$ of the disk, $\varphi,\theta,\psi$ are the
three Euler angles and $\beta$ is the rod angle. As illustrated by Figure 1,

  * •

$\varphi$ is the spin angle

  * •

$\theta$ is the stand angle, _i.e._ , when $\theta=0$, the disk is vertical

  * •

$\psi$ is the heading, _i.e._ , the horizontal orientation of the disk

  * •

$\beta$ is the angle of the rod with respect to the vertical axis.

Therefore, we should be able to find a state equations of the form

$\dot{\mathbf{x}}=\mathbf{f}(\mathbf{x},u).$ (1)

to represent the dynamics of the rodwheel. For this, we will follow the
approach presented in [7].

To use sympy, we first declare the symbolic variables and functions to be
used:

  * from sympy import *

t=symbols(’t’)

m,g,r,$\mu$,l= symbols(’m g r, $\mu$,l’)

c1,c2 = Function(’c1’)(’t’),Function(’c2’)(’t’)

dc1,dc2 = Function(’dc1’)(’t’),Function(’dc2’)(’t’)

ddc1,ddc2 = Function(’ddc1’)(’t’),Function(’ddc2’)(’t’),

$\varphi$,$\theta$,$\psi$,$\beta$ =
Function(’$\varphi$’)(’t’),Function(’$\theta$’)(’t’),Function(’$\psi$’)(’t’),Function(’$\beta$’)(’t’)

d$\varphi$,d$\theta$,d$\psi$,d$\beta$ =
Function(’d$\varphi$’)(’t’),Function(’d$\theta$’)(’t’),

Function(’d$\psi$’)(’t’),Function(’d$\beta$’)(’t’)

dd$\varphi$,dd$\theta$,dd$\psi$,dd$\beta$ =
Function(’dd$\varphi$’)(’t’),Function(’dd$\theta$’)(’t’),

Function(’dd$\psi$’)(’t’),Function(’dd$\beta$’)(’t’)

$\lambda$1,$\lambda$2 =
Function(’$\lambda$1’)(’t’),Function(’$\lambda$2’)(’t’)

###  2.2 Orientation

The orientation of the disk is fixed by the three Euler angles
$\varphi,\theta,\psi$. The corresponding orientation matrix is

$\mathbf{R}_{\text{euler}}(\varphi,\theta,\psi)=\left(\begin{array}[]{ccccc}\cos\psi&&-\sin\psi&&0\\\
\sin\psi&&\cos\psi&&0\\\
0&&0&&1\end{array}\right)\mbox{$\cdot$}\left(\begin{array}[]{c}\cos\theta\\\
0\\\ -\sin\theta\end{array}\right.\begin{array}[]{c}0\\\ 1\\\
0\end{array}\left.\begin{array}[]{c}\sin\theta\\\ 0\\\
\cos\theta\end{array}\right)\cdot\left(\begin{array}[]{ccccc}1&&0&&0\\\
0&&\cos\varphi&&-\sin\varphi\\\ 0&&\sin\varphi&&\cos\varphi\end{array}\right)$
(2)

It is built by the following sympy function

  * def Reuler($\varphi,\theta,\psi$):

R$\varphi$ =
Matrix([[1,0,0],[0,cos($\varphi$),-sin($\varphi$)],[0,sin($\varphi$),cos($\varphi$)]])

R$\theta$ =
Matrix([[cos($\theta$),0,sin($\theta$)],[0,1,0],[-sin($\theta$),0,cos($\theta$)]])

R$\psi$ =
Matrix([[cos($\psi$),-sin($\psi$),0],[sin($\psi$),cos($\psi$),0],[0,0,1]])

Return R$\psi$*R$\theta$*R$\varphi$

The rotation vector depends on the Euler angles and their derivatives. Its
expression [6] can be obtained using the relation

$\mathbf{R}^{\text{T}}\mathbf{\dot{R}}=\left(\begin{array}[]{ccc}0&-\omega_{r3}&\omega_{r2}\\\
\omega_{r3}&0&-\omega_{r1}\\\ -\omega_{r2}&\omega_{r1}&0\end{array}\right)$
(3)

which gives us the following sympy function

  * def wr(R):

W=Transpose(R)*diff(R,t)

return Matrix([[-W[1,2]],[W[0,2]],[-W[0,1]]])

###  2.3 Lagrangian

In order, to get the state equations the rodwheel, we use a Lagrangian
approach. For this, we need to express the Lagrangian $\mathcal{L}$ with
respect to the state variables. Recall that

$\mathcal{L}=E_{K}-E_{p}$ (4)

where $E_{K}$ is the kinetic energy and $E_{p}$ is the potential energy. We
have

$E_{K}=\frac{1}{2}\boldsymbol{\omega}_{r}^{\text{T}}\mathbf{I}\boldsymbol{\omega}_{r}+\frac{1}{2}m\|\dot{\mathbf{c}}\|^{2}+\frac{1}{2}\mu\|\dot{\mathbf{s}}\|^{2}$
(5)

where $\mathbf{c}$ is the center of the wheel, $\mathbf{s}$ is the end point
of the rod given by

$\mathbf{s}=\mathbf{c}+\mathbf{R}_{\text{euler}}(\beta,\theta,\psi)$

and

$\mathbf{I}=\left(\begin{array}[]{lll}\frac{mr^{2}}{2}&0&0\\\
0&\frac{mr^{2}}{4}&0\\\ 0&0&\frac{mr^{2}}{4}\end{array}\right)$ (6)

is the inertia matrix of the disk. Denote by

$\mathbf{q}=\left(c_{1},c_{2},\varphi,\theta,\psi,\beta\right)$ (7)

the generalized coordinates of the system, _i.e._ , the degrees of freedom.
The Lagrangian, which is a function of $(\mathbf{q},\dot{\mathbf{q}})$, is
computed with sympy as follows:

  * def Lagrangian(q,dq):

c1,c2,$\varphi$,$\theta$,$\psi,\beta$=list(q)

R = Reuler($\varphi$,$\theta$,$\psi$)

c=Matrix([[c1],[c2],[r*cos($\theta$)]])

dc=diff(c,t)

s=Reuler($\beta,\theta,\psi$)*Matrix([[0],[0],[l]])+c

ds=diff(s,t)

Ep=m*g*c3+$\mu$*s[2]

I=Matrix([[1/2*m*r**2,0,0],[0,1/4*m*r**2,0],[0,0,1/4*m*r**2]])

Ek=1/2*m*(dc.dot(dc))+1/2*$\mu$*(ds.dot(ds))+1/2*wr(R).dot(I*wr(R))

L=subsdiff(Ek-Ep)

return L

where subsdiff(E) transforms the differentiation operator into the
corresponding state variables:

  * def subsdiff(E):

E=E.subs({diff(dc1,t): ddc1,diff(dc2,t): ddc2, diff(d$\varphi$,t):
dd$\varphi$,

diff(d$\theta$,t): dd$\theta$, diff(d$\psi$,t): dd$\psi$, diff(d$\beta$,t):
dd$\beta$})

E=E.subs({diff(c1,t): dc1,diff(c2,t): dc2, diff($\varphi$,t): d$\varphi$,

diff($\theta$,t): d$\theta$,diff($\psi$,t): d$\psi$, diff($\beta$,t):
d$\beta$})

return simplify(E)

We get

$\begin{array}[]{ccc}\mathcal{L}(\mathbf{q},\dot{\mathbf{q}})&=&\frac{m}{8}r^{2}(\dot{\theta}\sin\varphi-\dot{\psi}\cos\theta\cos\varphi)^{2}+\frac{m}{8}r^{2}(\dot{\theta}\cos\varphi+\dot{\psi}\sin\varphi\cos\theta)^{2}\\\
&&+\frac{m}{4}r^{2}(\dot{\varphi}-\dot{\psi}\sin\theta)^{2}+\frac{m}{2}(r^{2}\dot{\theta}^{2}\sin^{2}\theta+\dot{c}_{1}^{2}+\dot{c}_{2}^{2})\\\
&&-\mu(\ell\cos\beta+r)\cos\theta\\\
&&+\frac{\mu}{2}\left(\ell\sin\psi\cos\beta\cos\theta\dot{\theta}+\ell\left(\sin\beta\sin\psi+\sin\theta\cos\beta\cos\psi\right)\dot{\psi}-\ell(\sin\beta\sin\theta\sin\psi+\cos\beta\cos\psi)\dot{\beta}+\dot{c}_{2}\right)^{2}\\\
&&+\frac{\mu}{2}\left(\ell\cos\beta\cos\theta\cos\psi\dot{\theta}+\ell\left(\sin\beta\cos\psi-\sin\theta\sin\psi\cos\beta\right)\dot{\psi}+\ell\left(\sin\psi\cos\beta-\sin\beta\sin\theta\cos\psi\right)\dot{\beta}+\dot{c}_{1}\right){}^{2}\\\
&&+\frac{\mu}{2}\left(\ell\sin\beta\cos\theta\dot{\beta}+(\ell\sin\theta\cos\beta+r\sin\theta)\dot{\theta}\right)^{2}\\\
&&-gmr\cos\theta\end{array}$

In what follows, we will avoid writing such complex expressions (which can be
far larger than this one). Indeed, these expressions should remain transparent
for the user since is it handled by sympy.

###  2.4 Euler-Lagrange equations

The evolution of $\mathbf{q}$ obeys to the Euler-Lagrange equation for non-
holonomic systems:

$\underset{\mathcal{Q}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}})}{\underbrace{\frac{d}{dt}\left(\frac{\partial\mathcal{L}}{\partial\dot{\mathbf{q}}}\right)-\frac{\partial\mathcal{L}}{\partial\mathbf{q}}}}=\underset{\boldsymbol{\tau}}{\underbrace{\left(\begin{array}[]{c}\tau_{\mathbf{c}_{1}}\\\
\tau_{\mathbf{c}_{2}}\\\ \tau_{\varphi}\\\ \tau_{\theta}\\\ \tau_{\psi}\\\
\tau_{\beta}\end{array}\right)}}+\left(\begin{array}[]{c}0\\\ 0\\\ 1\\\ 0\\\
0\\\ -1\end{array}\right)\cdot u$ (8)

where the right hand side corresponds the generalized forces. It is composed
of the forces $\boldsymbol{\tau}$ generated by the ground and of the motor
forces corresponding to internal torque. The entries for the motor force
vector are consistent with the fact that the motor produces the torque $u$
between the degrees of freedom $\beta$ (the rod) and $\varphi$ (the wheel).

######  Remark 1.

Note that $\mathcal{Q}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}})$ is
affine in $\ddot{\mathbf{q}}$. This property will be used later to build the
state space model of the rodwheel.

An expression for $\mathcal{Q}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}})$
is obtained using sympy by:

  * q=Matrix([c1,c2,$\varphi$,$\theta$,$\psi$,$\beta$])

dq=Matrix([dc1,dc2,d$\varphi$,d$\theta$,d$\psi$,d$\beta$])

ddq=Matrix([ddc1,ddc2,dd$\varphi$,dd$\theta$,dd$\psi$,dd$\beta$])

L=Lagrangian(q,dq)

Q=subsdiff(diff(L.jacobian(dq),t)-L.jacobian(q))

The generalized forces
$\tau_{\mathbf{c}_{1}},\tau_{\mathbf{c}_{2}},\tau_{\varphi},\tau_{\theta},\tau_{\psi},\tau_{\beta}$
generated by the reaction of the ground are linked by constraints that should
now be written.

###  2.5 Non holonomic constraints

Without any reaction constraint of the ground onto the disk, the state vector
would have been

$(\mathbf{q},\dot{\mathbf{q}})=(c_{1},c_{2},\varphi,\theta,\psi,\beta,\dot{c}_{1},\dot{c}_{2},\dot{\varphi},\dot{\theta},\dot{\psi},\dot{\beta}),$
(9)

_i.e._ , it would have been composed of the degrees of freedom $\mathbf{q}$
and they derivatives $\dot{\mathbf{q}}$. Now, due to the ground forces, the
variables ($\mathbf{q}$,$\dot{\mathbf{q}}$) are linked by some differential
constraints. These constraints will be needed to derive the state equations
with
$\mathbf{x}=(c_{1},c_{2},\varphi,\theta,\psi,\beta,\dot{\varphi},\dot{\theta},\dot{\psi},\dot{\beta})$
as a state vector. Since we have two variables to eliminate (here
$\dot{c}_{1}$ and $\dot{c}_{2}$), we need to find two more differential
constraints. These two constraints are those generated by the ground forces.
They translate the fact that the point of the disk in contact with the ground
has a zero velocity. It means that the disk neither slides tangentially (it
could be the first equation) nor laterally (it could be the second equation).
We understand that these two equations have the form

$\begin{array}[]{ccc}\dot{c}_{1}&=&\alpha_{1}\cdot\dot{\varphi}+\alpha_{2}\cdot\dot{\theta}+\alpha_{3}\cdot\dot{\psi}\\\
\dot{c}_{2}&=&\beta_{1}\cdot\dot{\varphi}+\beta_{2}\cdot\dot{\theta}+\beta_{3}\dot{\cdot\psi}\end{array}$
(10)

where the $\alpha_{i}$’s and the $\beta_{i}^{\prime}s$ depend on $\mathbf{q}$.
More precisely, as shown in [7] these constraints are

$\begin{array}[]{ccc}\dot{c}_{1}&=&r\sin\psi\cdot\dot{\varphi}+r\cos\psi\cos\theta\cdot\dot{\theta}-r\sin\psi\sin\theta\cdot\dot{\psi}\\\
\dot{c}_{2}&=&-r\cos\psi\cdot\dot{\varphi}+r\sin\psi\cos\theta\cdot\dot{\theta}+r\cos\psi\sin\theta\cdot\dot{\psi}\end{array}$
(11)

Figure 2 illustrates how these formulas are obtained . The left subfigure
shows that when $\dot{\theta}=0$ and $\dot{\psi}=0$, we have

$\begin{array}[]{ccc}\dot{c}_{1}&=&r\sin\psi\cdot\dot{\varphi}\\\
\dot{c}_{2}&=&-r\cos\psi\cdot\dot{\varphi}\end{array}$ (12)

The subfigure in the center illustrates that if $\dot{\varphi}=0$ and
$\dot{\psi}=0$,

$\begin{array}[]{ccc}\dot{c}_{1}&=&r\cos\psi\cos\theta\cdot\dot{\theta}\\\
\dot{c}_{2}&=&r\sin\psi\cos\theta\cdot\dot{\theta}\end{array}$ (13)

The right subfigure illustrates that if $\dot{\theta}=0$ and
$\dot{\varphi}=0$,

$\begin{array}[]{ccc}\dot{c}_{1}&=&-r\sin\psi\sin\theta\cdot\dot{\psi}\\\
\dot{c}_{2}&=&r\cos\psi\sin\theta\cdot\dot{\psi}\end{array}$ (14)

By superposition, we get Equation 11. These constraints are said to be non
holonomic since they will not allow us to express our system with a state
composed of some degrees of freedom $\mathbf{q}$ and their derivatives
$\mathbf{\dot{q}}$.

Figure 2: Wheel rolling on a plane (the rod is not represented)

###  2.6 D’Alembert’s principle

We need to find an expression for $\boldsymbol{\tau}$ which occurs in the
right hand side of (8). The components for $\boldsymbol{\tau}$ correspond to
the generalized ground forces applied to our system. Now, since the contact
point has no velocity, the ground force cannot modify the energy of the
system.

In order to use this information, let us to recall the principle of
d’Alembert: _for arbitrary virtual displacements, the constraint forces don’t
do any work_.

The virtual displacements are infinitesimal changes
$\delta\mathbf{q}=\mathbf{q}(t+dt)-\mathbf{q}(t)$ that should be consistent
with some feasible trajectories $\mathbf{q}(t)$. For our rolling system, the
virtual displacements satisfy

$\begin{array}[]{ccccc}\delta
c_{1}-r\sin\psi\cdot\delta\varphi-r\cos\psi\cos\theta\cdot\delta\theta+r\sin\psi\sin\theta\cdot\delta\psi&=&0&&(i)\\\
\delta
c_{2}+r\cos\psi\cdot\delta\varphi-r\sin\psi\cos\theta\cdot\delta\theta-r\cos\psi\sin\theta\cdot\delta\psi&=&0&&(ii)\end{array}$
(15)

for the same reasons than those used to derive (11). The fact that there is no
work translates into

$\begin{array}[]{ccc}\delta
W=\boldsymbol{\tau}^{\text{T}}\cdot\delta\mathbf{q}=\tau_{c_{1}}\cdot\delta
c_{1}+\tau_{c_{2}}\cdot\delta
c_{2}+\tau_{\varphi}\cdot\delta\varphi+\tau_{\theta}\cdot\delta\theta+\tau_{\psi}\cdot\delta\psi&+\tau_{\beta}\cdot\delta\beta=&0.\end{array}$
(16)

Equivalently, Equation 16 is a linear combination of the two equations (15),
_i.e._ , (16) $=\lambda_{1}\cdot$(15,i)$+\lambda_{2}\cdot$(15,ii). The
$\lambda_{i}$’s are called the _Lagrange parameters_. Therefore:

$\left(\begin{array}[]{c}\tau_{c_{1}}\\\ \tau_{c_{2}}\\\ \tau_{\varphi}\\\
\tau_{\theta}\\\ \tau_{\psi}\\\
\tau_{\beta}\end{array}\right)=\lambda_{1}\cdot\left(\begin{array}[]{c}1\\\
0\\\ -r\sin\psi\\\ -r\cos\psi\cos\theta\\\ r\sin\psi\sin\theta\\\
0\end{array}\right)+\lambda_{2}\cdot\left(\begin{array}[]{c}0\\\ 1\\\
r\cos\psi\\\ -r\sin\psi\cos\theta\\\ -r\cos\psi\sin\theta\\\
0\end{array}\right)$ (17)

or in a vector form:

$\boldsymbol{\tau}=\mathbf{A}^{\text{T}}(\mathbf{q})\left(\begin{array}[]{c}\lambda_{1}\\\
\lambda_{2}\end{array}\right)$ (18)

where

$\mathbf{A}(\mathbf{q})=\left(\begin{array}[]{cccccc}\,1&0&\,-r\sin\psi&\,-r\cos\psi\cos\theta&\,r\sin\psi\sin\theta&0\\\
0&1&r\cos\psi&-r\sin\psi\cos\theta&-r\cos\psi\sin\theta&0\end{array}\right).$
(19)

###  2.7 State equations

Using (8) with (18), we get

$\mathcal{Q}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}})-\boldsymbol{\tau}(\mathbf{q},\text{$\boldsymbol{\lambda}$})=\left(\begin{array}[]{c}0\\\
0\\\ u\\\ 0\\\ 0\\\ -u\end{array}\right)$ (20)

This system is made of 6 equations which are linear in 8 variables :
$\boldsymbol{\lambda}=(\lambda_{1},\lambda_{2})$ and
$\ddot{\mathbf{q}}=(\ddot{c}_{1},\ddot{c}_{2},\ddot{\varphi},\ddot{\theta},\ddot{\psi},\ddot{\beta})$
(see Equation 18 and Remark 1). In order to square the system, we need to add
two equations (to get 8 equations). They are obtained by differentiating of
the non-holonomic constraints (11) given by

$\underset{\mathbf{a}(\mathbf{q},\dot{\mathbf{q}})}{\underbrace{\mathbf{A}(\mathbf{q})\cdot\dot{\mathbf{q}}}}=\mathbf{0}.$
(21)

Let us differentiate this equation. We get:

$\underset{=\frac{d}{dt}\mathbf{a}(\mathbf{q},\dot{\mathbf{q}})}{\underbrace{\frac{\partial\mathbf{a}(\mathbf{q},\dot{\mathbf{q}})}{\partial\mathbf{q}}\cdot\dot{\mathbf{q}}+\frac{\partial\mathbf{a}(\mathbf{q},\dot{\mathbf{q}})}{\partial\dot{\mathbf{q}}}\cdot\ddot{\mathbf{q}}}}=\mathbf{0}$
(22)

Adding these two equations to (20) yields

$\left\\{\begin{array}[]{ccc}\frac{d}{dt}\mathbf{a}(\mathbf{q},\dot{\mathbf{q}})&=&\left(\begin{array}[]{c}0\\\
0\end{array}\right)\\\
\mathcal{Q}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}})-\boldsymbol{\tau}(\mathbf{q},\text{$\boldsymbol{\lambda}$})&=&\left(\begin{array}[]{c}0\\\
0\\\ u\\\ 0\\\ 0\\\ -u\end{array}\right)\end{array}\right.$

or equivalently

$\underset{\mathcal{S}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}},\text{$\boldsymbol{\lambda}$})}{\underbrace{\left(\begin{array}[]{c}\frac{\partial\mathbf{a}(\mathbf{q},\dot{\mathbf{q}})}{\partial\mathbf{q}}\cdot\dot{\mathbf{q}}+\frac{\partial\mathbf{a}(\mathbf{q},\dot{\mathbf{q}})}{\partial\dot{\mathbf{q}}}\cdot\ddot{\mathbf{q}}\\\
\mathcal{Q}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}})-\boldsymbol{\tau}(\mathbf{q},\text{$\boldsymbol{\lambda}$})\end{array}\right)}}=\underset{\mathbf{b}_{u}}{\underbrace{\left(\begin{array}[]{c}0\\\
0\\\ 0\\\ 0\\\ 1\\\ 0\\\ 0\\\ -1\end{array}\right)}\cdot}u$ (23)

Since
$\mathcal{S}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}},\text{$\boldsymbol{\lambda}$})$
is affine in $\boldsymbol{\lambda},\ddot{\mathbf{q}}$ (see Equation 18 and
Remark 1), we have

$\mathcal{S}(\mathbf{q},\dot{\mathbf{q}},\ddot{\mathbf{q}},\text{$\boldsymbol{\lambda}$})=\underset{=\mathbf{M}(\mathbf{q})}{\underbrace{\left(\begin{array}[]{ccc}\frac{\partial}{\partial\boldsymbol{\lambda}}\mathcal{S}(\mathbf{q},\dot{\mathbf{q}},\mathbf{0},\mathbf{0})&&\frac{\partial}{\partial\ddot{\mathbf{q}}}\mathcal{S}(\mathbf{q},\dot{\mathbf{q}},\mathbf{0},\mathbf{0})\end{array}\right)}}\cdot\left(\begin{array}[]{c}\boldsymbol{\lambda}\\\
\ddot{\mathbf{q}}\end{array}\right)+\underset{=-\mathbf{b}(\mathbf{q},\dot{\mathbf{q}})}{\underbrace{\mathcal{S}(\mathbf{q},\dot{\mathbf{q}},\mathbf{0},\mathbf{0})}}.$
(24)

where $\mathbf{M}(\mathbf{q})$ is a square matrix called the _mass matrix_ (we
can show that it does not depend on $\dot{\mathbf{q}}$, this is why we have
written $\mathbf{M}(\mathbf{q})$ instead of
$\mathbf{M}(\mathbf{q},\dot{\mathbf{q}})$). Thus (23) becomes

$\mathbf{M}(\mathbf{q})\cdot\left(\begin{array}[]{c}\boldsymbol{\lambda}\\\
\ddot{\mathbf{q}}\end{array}\right)=\mathbf{b}(\mathbf{q},\dot{\mathbf{q}})+\mathbf{b}_{u}\cdot
u.$ (25)

Isolating $\ddot{\mathbf{q}}$, we get

$\left(\begin{array}[]{c}\ddot{\varphi}\\\ \ddot{\theta}\\\ \ddot{\psi}\\\
\ddot{\beta}\end{array}\right)=\underset{\mathbf{P}}{\underbrace{\left(\begin{array}[]{cccccccc}0&0&0&0&1&0&0&0\\\
0&0&0&0&0&1&0&0\\\ 0&0&0&0&0&0&1&0\\\
0&0&0&0&0&0&0&1\end{array}\right)}}\cdot\mathbf{M}^{-1}(\mathbf{q})\cdot\left(\mathbf{b}(\mathbf{q},\dot{\mathbf{q}})+\mathbf{b}_{u}\cdot
u\right)$ (26)

where $\mathbf{P}$ is the projection matrix which selects the four last
components of the vector
$(\lambda_{1},\lambda_{2},\ddot{c}_{1},\ddot{c}_{2},\ddot{\varphi},\ddot{\theta},\ddot{\psi},\ddot{\beta}).$

The expression for $\mathbf{M}$ and $\mathbf{b}$ are obtained by:

  * A=Matrix([[1,0,-r*sin($\psi$),-r*cos($\psi$)*cos($\theta$),r*sin($\psi$)*sin($\theta$),0],

[0,1,
r*cos($\psi$),-r*sin($\psi$)*cos($\theta$),-r*cos($\psi$)*sin($\theta$),0]])

$\tau$=$\lambda$1*A[0,:]+$\lambda$2*A[1,:]

a=A*dq

da=diff(a,t)

S=Matrix([da,*list(Q-$\tau$)])

S=subsdiff(S)

M=S.jacobian([$\lambda$1,$\lambda$2,ddq])

b=-S.subs({$\lambda$1:0,$\lambda$2:0,ddc1:0,ddc2:0,dd$\varphi$:0,
dd$\theta$:0, dd$\psi$:0, dd$\beta$:0})

Therefore, the state equations of the rodwheel are

$\begin{array}[]{ccccc}\left(\begin{array}[]{c}\dot{c}_{1}\\\
\dot{c}_{2}\end{array}\right)&=&r\left(\begin{array}[]{ccccc}\sin\psi&&\cos\psi\cos\theta&&-\sin\psi\sin\theta\\\
-\cos\psi&&\sin\psi\cos\theta&&\cos\psi\sin\theta\end{array}\right)\left(\begin{array}[]{c}\dot{\varphi}\\\
\dot{\theta}\\\ \dot{\psi}\end{array}\right)&&\text{(see
(\ref{eq:nonholonomous:constraints}))}\\\
\left(\begin{array}[]{c}\dot{\varphi}\\\ \dot{\theta}\\\ \dot{\psi}\\\
\dot{\beta}\end{array}\right)&=&\left(\begin{array}[]{c}\dot{\varphi}\\\
\dot{\theta}\\\ \dot{\psi}\\\ \dot{\beta}\end{array}\right)\\\
\left(\begin{array}[]{c}\ddot{\varphi}\\\ \ddot{\theta}\\\ \ddot{\psi}\\\
\ddot{\beta}\end{array}\right)&=&\mathbf{P}\cdot\mathbf{M}^{-1}(\mathbf{q})\cdot\left(\mathbf{b}(\mathbf{q},\dot{\mathbf{q}})+\mathbf{b}_{u}\cdot
u\right)&&\text{(see (\ref{eq:lam:ddq}))}\end{array}$ (27)

The symbolic computation is only used to generate the Python functions for
$\mathbf{M}(\mathbf{q})$ and $\mathbf{b}(\mathbf{q},\dot{\mathbf{q}})$.
Getting an expression for
$\mathbf{v}(\mathbf{q},\dot{\mathbf{q}},u)=\mathbf{M}^{-1}(\mathbf{q})\cdot\left(\mathbf{b}(\mathbf{q},\dot{\mathbf{q}})+\mathbf{b}_{u}\cdot
u\right)$ would have been too heavy for sympy. This is why the choice has been
made to compute $\mathbf{v}(\mathbf{q},\dot{\mathbf{q}},u)$ numerically during
the simulation by solving the following linear system

$\mathbf{M}(\mathbf{q})\cdot\mathbf{v}=\mathbf{b}(\mathbf{q},\dot{\mathbf{q}})+\mathbf{b}_{u}\cdot
u$

each time we want to evaluate the evolution function
$\mathbf{f}(\mathbf{x},u).$ To build the Python function from a sympy
expression, we write

  * M,b=lambdify((c1,c2,$\varphi$,$\theta$,$\psi$,$\beta$,d$\varphi$,d$\theta$,d$\psi$,d$\beta$,m,g,r,$\mu$,l),(M,b))

##  3 Control

We want to build a controller for the rodwheel and validate on a simulation.
We first have to build a simulator based on the state space model.

###  3.1 Simulation

The Python code for the evolution function is:

  * def f(x,u):

c1,c2,$\varphi$,$\theta$,$\psi$,$\beta$,d$\varphi$,d$\theta$,d$\psi$,d$\beta$=list(x.flatten())

dc1=
r*sin($\psi$)*d$\varphi$+r*cos($\psi$)*cos($\theta$)*d$\theta$-r*sin($\theta$)*sin($\psi$)*d$\psi$

dc2=-r*cos($\psi$)*d$\varphi$+r*sin($\psi$)*cos($\theta$)*d$\theta$+r*sin($\theta$)*cos($\psi$)*d$\psi$

bu=array([[0],[0],[0],[0],[1],[0],[0],[-1]])

v=np.linalg.solve(M,b+bu*u)

dd$\varphi$,dd$\theta$,dd$\psi$,dd$\beta$=list((v[4:8]).flatten())

return
array([[dc1],[dc2],[d$\varphi$],[d$\theta$],[d$\psi$],[d$\beta$],[dd$\varphi$],[dd$\theta$],[dd$\psi$],[dd$\beta$]])

We use a Runge-Kutta integration scheme for the simulation

  * x=x+dt*(0.25*f(x,u)+0.75*(f(x+(2/3)*dt*f(x,u),u)))

We chose the initial state vector as

$\left(c_{1},c_{2},\varphi,\theta,\psi,\dot{\varphi},\dot{\theta},\dot{\psi}\right)=\left(4,0,0,0.3,0,-0.5,6,-3,0,0\right).$
(28)

and the parameters as

$(m,g,r,\mu,\ell)=(5,9.81,1,1,2).$ (29)

The result of the simulation without any control (_i.e._ , for $u=0$) is
represented on Figure 3. The rod is painted green. The blue wheel corresponds
to $t=0$ and the red wheel to $t=8$. The evolution of the wheel’s center and
of the contact point are represented in red and magenta respectively. The
simulation highlights the chaotic behavior of the rodwheel.

Figure 3: Evolution of rodwheel with no control

###  3.2 Controller

We want a controller that makes our rodwheel going straight, the rod upward at
a given speed. Several difficulties have to be raised:

  * •

We have a single input $u$ for several state variables to control.

  * •

The equations of the system are complex. It is difficult to write a closed
form for the state equations in less than one page.

  * •

The system is not controllable once the rodwheel goes straight.

  * •

The system is unstable with respect to the rod angle $\beta$.

  * •

The system is unstable with respect to the stand angle $\theta$.

Concerning the proof of the non controllability, instead of using the model,
it is more direct to use the symmetries of the problem. Assume that
$\dot{\psi}=0$, $\theta=0,\text{$\dot{\theta}=0$}$ (this is what we have once
our goal is reached). We have an evolution which remains symmetric with
respect to the vertical plane supported by the wheel. Thus, for any control
$u$, we are trapped in a situation where $\dot{\psi}=0$,
$\theta=0,\text{$\dot{\theta}=0$}.$

For the instability a linearisation around $\dot{\psi}=0$,
$\theta=0,\text{$\dot{\theta}=0$}$ could be used. Now, the instability with
respect to $\beta$ is intuitive and the instability with respect to $\theta$
is observed by simulation (see further). Indeed, when the rod is stabilized
above $\mathbf{c}$, the precession tends to amplify.

In what follows, we propose a very simple expression for a possible
controller. This will be enough to illustrate that the robot can be controlled
with $u$ as a single input.

Case 1. Consider the situation where the initial stand angle $\theta$ and its
derivative $\dot{\theta}$ are both equal to zero. Due to the symmetry of the
system, $\theta(t)=0$ for all $t$. Take the following proportional and
derivative controller

$\begin{array}[]{ccc}u&=&20(\beta-\beta_{0})+20\dot{\beta}\\\
\beta_{0}&=&\text{tanh}(2-\dot{\varphi})\end{array}$ (30)

where $\beta-\beta_{0}$ is the error. If the closed loop system is stable,
then $\beta\rightarrow\beta_{0}$ (this notations means that $\beta$ converges
to $\beta_{0}$ when $t\rightarrow\infty$). Now, the robot will accelerate (or
decelerate) until $\beta_{0}=0$, _i.e._ , $\dot{\varphi}=2$. This means that
we can control the speed of the rodwheel, at least when the stand angle
$\theta(t)$ is equal to zero. Figure 4 shows the behavior of the closed loop
for the initial state :

$(c_{1},c_{2},\varphi,\theta,\psi,\beta,\dot{\varphi},\dot{\theta},\dot{\psi},\dot{\beta})=(4,0,0,0,0,\pi,0,0,0,0)$
(31)

For the initialization, the rod is downward and stands up in order to create
the right acceleration. We observe that $\dot{\varphi}\rightarrow 2$ and that
$\beta\rightarrow 0$.

Figure 4: Rodwheel with $\theta(t)=0$ which accelerates to reach the speed of
$\dot{\varphi}=2$

To show the instability with respect to $\theta$, take $\theta(0)=2\cdot
10^{-12}$ instead of $\theta(0)=0$. The simulation generates Figure 5. We see
the rodwheel falling strongly after few seconds.

Figure 5: A tiny perturbation with respect to $\theta$ generates a fall of the
robot

To control the stand angle, we propose to add a term which accelerates when
$\theta$ deviates from zero. We get the following controller:

$\begin{array}[]{ccc}u&=&5(\beta-\beta_{0})+5\dot{\beta}+20\cdot|\theta|\\\
\beta_{0}&=&0.2\cdot\text{tanh}(10-\dot{\varphi})\end{array}$ (32)

The initial vector is the same as in Subsection 3.1, _i.e._ ,

$\left(c_{1},c_{2},\varphi,\theta,\psi,\dot{\varphi},\dot{\theta},\dot{\psi}\right)=\left(4,0,0,0.3,0,-0.5,6,-3,0,0\right).$
(33)

The controller is now able to limit the precession still maintaining the rod
upward as shown by Figure 6.

Figure 6: The controller stabilizes the precession of the rodwheel

##  4 Conclusion

In this paper, we have proposed a state space model and a simple controller
for the rodwheel. Since it is composed of one wheel, one motor and one rod,
the rodwheel can be seen as the most elementary wheeled robot than can be
built, _i.e_ , it seems impossible to build a fast vehicle with less
mechanical components. Due to its shape, with almost no front surface that
could slow down the vehicle, we could expect to have a fast robot which makes
long trips with few batteries. Moreover, the expected weight could be low
enough to limit the danger is case of collision.

We have shown that it was possible to stabilize the robot and control the
speed. Now, due to the singularity for $\theta=0$ (which corresponds to the
situation where the wheel goes straight ahead) the system becomes
uncontrollable. We should thus add a other actuator such as a small inertial
wheel fixed the end of the rod to be able to control the heading.

We have proposed a stability analysis which is based on simulation and
symmetries, which is clearly not enough. The stability should be studied by a
linearization to have a better understanding of the instabilities and to get a
better tuning of the control parameters.

Since the rodwheel is considered here as a mobile robot, the heading control
needs to be treated. An easy solution would be to add an additional actuated
inertial wheel spinning perpendicularly with respect to the rod. From a
control point of view, a more challenging question would be to control the
heading of the robot without changing the mechanics, _i.e._ , changing the
controller only.

The Python code associated to all examples can be found here:

https://www.ensta-bretagne.fr/jaulin/rodwheel.html

## References

  * [1] P. Appell.  Sur l’intégration des équations du mouvement d’un corps pesant de révolution roulant par une arête circulaire sur un plan horizontal; cas particulier du cerceau.  Rendiconti del Circolo Matematico di Palermo, 1900.
  * [2] F. Boyer, M. Porez, and J. Mauny.  Reduced dynamics of the non-holonomic whipple bicycle.  Journal of Nonlinear Science, 28, 06 2018.
  * [3] P. Corke.  Robotics, Vision and Control.  Springer, Berlin Heidelberg, 2011.
  * [4] D. Esnault.  Robot d’engagement gyrostabilisé de reconnaissance.  Rapport de PFE, ENSTA-Bretagne, Brest, France, 2023.
  * [5] I. Fantoni and R. Lozano.  Non-linear control for underactuated mechanical systems.  Springer-Verlag, 2001.
  * [6] L. Jaulin.  Mobile Robotics.  ISTE editions, 2015.
  * [7] L. Jaulin.  Modelisation of a rolling disk with sympy.  arXiv:2311.16624, math.NA, 2023.
  * [8] O. O’Reilly.  The dynamics of rolling disks and sliding disks.  Nonlinear Dynamics, 10(3):287–305, 1996.
  * [9] D.A. Wells.  Lagrangian Mechanics.  Schaum’s outlines, London, 1967.