<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article article-type="research-article" dtd-version="2.3" xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Robot. AI</journal-id>
<journal-title>Frontiers in Robotics and AI</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Robot. AI</abbrev-journal-title>
<issn pub-type="epub">2296-9144</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">631303</article-id>
<article-id pub-id-type="doi">10.3389/frobt.2021.631303</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Robotics and AI</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>A Recurrent Neural-Network-Based Real-Time Dynamic Model for Soft Continuum Manipulators</article-title>
<alt-title alt-title-type="left-running-head">Tariverdi et&#x20;al.</alt-title>
<alt-title alt-title-type="right-running-head">RNN-Based Model for Soft Manipulators</alt-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<name>
<surname>Tariverdi</surname>
<given-names>Abbas</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="corresp" rid="c001">&#x2a;</xref>
<uri xlink:href="https://loop.frontiersin.org/people/988018/overview"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Venkiteswaran</surname>
<given-names>Venkatasubramanian Kalpathy</given-names>
</name>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Richter</surname>
<given-names>Michiel</given-names>
</name>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Elle</surname>
<given-names>Ole J.</given-names>
</name>
<xref ref-type="aff" rid="aff3">
<sup>3</sup>
</xref>
<xref ref-type="aff" rid="aff4">
<sup>4</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/286246/overview"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>T&#xf8;rresen</surname>
<given-names>Jim</given-names>
</name>
<xref ref-type="aff" rid="aff4">
<sup>4</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/142977/overview"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Mathiassen</surname>
<given-names>Kim</given-names>
</name>
<xref ref-type="aff" rid="aff5">
<sup>5</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/274296/overview"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Misra</surname>
<given-names>Sarthak</given-names>
</name>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<xref ref-type="aff" rid="aff6">
<sup>6</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/147588/overview"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Martinsen</surname>
<given-names>&#xd8;rjan G.</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="aff" rid="aff7">
<sup>7</sup>
</xref>
</contrib>
</contrib-group>
<aff id="aff1">
<label>
<sup>1</sup>
</label>Department of Physics, University of Oslo, <addr-line>Oslo</addr-line>, <country>Norway</country>
</aff>
<aff id="aff2">
<label>
<sup>2</sup>
</label>Department of Biomechanical Engineering, University of Twente, <addr-line>Enschede</addr-line>, <country>Netherlands</country>
</aff>
<aff id="aff3">
<label>
<sup>3</sup>
</label>The Intervention Centre, Oslo University Hospital, <addr-line>Oslo</addr-line>, <country>Norway</country>
</aff>
<aff id="aff4">
<label>
<sup>4</sup>
</label>Department of Informatics, University of Oslo, <addr-line>Oslo</addr-line>, <country>Norway</country>
</aff>
<aff id="aff5">
<label>
<sup>5</sup>
</label>Department of Technology Systems, University of Oslo, <addr-line>Oslo</addr-line>, <country>Norway</country>
</aff>
<aff id="aff6">
<label>
<sup>6</sup>
</label>Department of Biomedical Engineering, University of Groningen and University Medical Centre Groningen, <addr-line>Groningen</addr-line>, <country>Netherlands</country>
</aff>
<aff id="aff7">
<label>
<sup>7</sup>
</label>Department of Clinical and Biomedical Engineering, Oslo University Hospital, <addr-line>Oslo</addr-line>, <country>Norway</country>
</aff>
<author-notes>
<fn fn-type="edited-by">
<p>
<bold>Edited by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/625510/overview">Thomas George Thuruthel</ext-link>, University of Cambridge, United&#x20;Kingdom</p>
</fn>
<fn fn-type="edited-by">
<p>
<bold>Reviewed by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/386260/overview">Marc Daniel Killpack</ext-link>, Brigham Young University, United&#x20;States</p>
<p>
<ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/383438/overview">Utku Culha</ext-link>, Max Planck Institute for Intelligent Systems, Germany</p>
</fn>
<corresp id="c001">&#x2a;Correspondence: Abbas Tariverdi, <email>abbast@uio.no</email>
</corresp>
<fn fn-type="other">
<p>This article was submitted to Soft Robotics, a section of the journal Frontiers in Robotics and&#x20;AI</p>
</fn>
</author-notes>
<pub-date pub-type="epub">
<day>18</day>
<month>03</month>
<year>2021</year>
</pub-date>
<pub-date pub-type="collection">
<year>2021</year>
</pub-date>
<volume>8</volume>
<elocation-id>631303</elocation-id>
<history>
<date date-type="received">
<day>19</day>
<month>11</month>
<year>2020</year>
</date>
<date date-type="accepted">
<day>05</day>
<month>02</month>
<year>2021</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#xa9; 2021 Tariverdi, Venkiteswaran, Richter, Elle, T&#xf8;rresen, Mathiassen, Misra and Martinsen.</copyright-statement>
<copyright-year>2021</copyright-year>
<copyright-holder>Tariverdi, Venkiteswaran, Richter, Elle, T&#xf8;rresen, Mathiassen, Misra and Martinsen</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/">
<p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these&#x20;terms.</p>
</license>
</permissions>
<abstract>
<p>This paper introduces and validates a real-time dynamic predictive model based on a neural network approach for soft continuum manipulators. The presented model provides a real-time prediction framework using neural-network-based strategies and continuum mechanics principles. A time-space integration scheme is employed to discretize the continuous dynamics and decouple the dynamic equations for translation and rotation for each node of a soft continuum manipulator. Then the resulting architecture is used to develop distributed prediction algorithms using recurrent neural networks. The proposed RNN-based parallel predictive scheme does not rely on computationally intensive algorithms; therefore, it is useful in real-time applications. Furthermore, simulations are shown to illustrate the approach performance on soft continuum elastica, and the approach is also validated through an experiment on a magnetically-actuated soft continuum manipulator. The results demonstrate that the presented model can outperform classical modeling approaches such as the Cosserat rod model while also shows possibilities for being used in practice.</p>
</abstract>
<kwd-group>
<kwd>continuum manipulators</kwd>
<kwd>soft robotics</kwd>
<kwd>dynamic models</kwd>
<kwd>Cosserat rod theory</kwd>
<kwd>Lie group variational integration</kwd>
<kwd>recurrent neural network</kwd>
</kwd-group>
<contract-sponsor id="cn001">H2020 European Research Council<named-content content-type="fundref-id">10.13039/100010663</named-content>
</contract-sponsor>
</article-meta>
</front>
<body>
<sec id="s1">
<title>Introduction</title>
<p>Soft continuum manipulators are flexible and highly deformable robots composed of soft and mostly elastic materials, and can serve as possible substitutes for rigid robots. Advantages of soft manipulator robots such as their compliance, dexterity, and adaptability to complex workspaces are driving the emergent research in this field. By contrast, rigidity of traditional rigid robots limits their use in constrained and confined environments, and reduces the possibilities for safe interaction with humans. Soft continuum manipulators have found applications in many areas, such as dexterous grasping (<xref ref-type="bibr" rid="B18">McMahan et&#x20;al., 2006</xref>; <xref ref-type="bibr" rid="B12">Katzschmann et&#x20;al., 2015</xref>) and assistive devices (<xref ref-type="bibr" rid="B1">Ansari et&#x20;al., 2017</xref>), and particularly in the field of minimally invasive surgeries, such as laryngeal surgery (<xref ref-type="bibr" rid="B27">Simaan et&#x20;al., 2004</xref>), catheter-based endovascular intervention (<xref ref-type="bibr" rid="B6">Grady et&#x20;al., 2000</xref>; <xref ref-type="bibr" rid="B3">Burgner et&#x20;al., 2013</xref>), and cardiovascular surgery (<xref ref-type="bibr" rid="B13">Kesner and Howe, 2011</xref>).</p>
<p>Analytical modeling of soft manipulators helps evaluate their motion and determine their workspace, in order to be used for control, motion planning, and animation purposes. Soft manipulators distinguish themselves by having an infinite number of degrees of freedom in any workspace they occupy. This characterization makes modeling complicated for soft manipulators. Several approaches have been investigated thus far in the literature. Most of the approaches consider the kinematic (i.e. static or quasi-static) modeling of the manipulators such as static analysis using virtual-work model (<xref ref-type="bibr" rid="B35">Xu and Simaan, 2010</xref>), Cosserat rod theory (<xref ref-type="bibr" rid="B19">Pai, 2002</xref>; <xref ref-type="bibr" rid="B10">Jones et&#x20;al., 2009</xref>; <xref ref-type="bibr" rid="B16">Mahvash and Dupont, 2011</xref>), and <italic>&#x3b1;</italic> Lie group formulation (<xref ref-type="bibr" rid="B7">Grazioso et&#x20;al., 2019</xref>). These models do not describe full dynamics of the manipulators, and they may show performance degradation when it comes to high-frequency applications or large and complex deformations. On the other hand, dynamical modeling approaches [e.g. <xref ref-type="bibr" rid="B34">Wen et&#x20;al. (2012)</xref>, <xref ref-type="bibr" rid="B11">Jung et&#x20;al. (2014)</xref>, <xref ref-type="bibr" rid="B9">Hyatt et&#x20;al. (2019)</xref>, <xref ref-type="bibr" rid="B24">Sadati et&#x20;al. (2019)</xref>, <xref ref-type="bibr" rid="B31">Till et&#x20;al. (2019)</xref>, <xref ref-type="bibr" rid="B28">Tariverdi et&#x20;al. (2020)</xref>], contain dynamics of the manipulators and also take into account time-varying responses of manipulators, including high-frequency modes. However, the dynamic models mostly rely on traditional methods, such as finite elements and finite differences (i.e.,&#x20;quantitative and numerical methods), making the algorithms computationally expensive for real-time applications. In other words, to obtain sufficiently accurate solutions, methods need to deal with fine meshes, which increase memory use and computation time. Another limitation is that their solutions are discrete or not sufficiently differentiable. It is worth noting that in model-based controllers or observers, having a differentiable solution (i.e.,&#x20;a solution that can be evaluated continuously on the workspace) is crucial in the design process. Furthermore, when softer materials are employed for manipulator construction with more complex geometries or large deformations, modeling their behavior analytically becomes challenging. Therefore, there is a need for appropriate data-driven approaches without compromising computational bandwidths and the prediction quality.</p>
<p>Dynamics of soft continuum manipulators have highly nonlinear behavior and are expressed as Partial Differential Equations (PDEs). An effective approach to represent and model PDEs solutions is to use Neural Networks (NN). NN-based solutions of PDEs are infinitely differentiable by eliminating the need for interpolation. Furthermore, compared to finite elements or difference methods, solutions are represented by fewer parameters, which reduces the memory use. There are studies that use machine learning algorithms to find a solution for special types of PDEs such as (<xref ref-type="bibr" rid="B14">Lagaris et&#x20;al., 1998</xref>; <xref ref-type="bibr" rid="B15">Lee and Kang, 1990</xref>; <xref ref-type="bibr" rid="B33">Weinan et&#x20;al., 2017</xref>; <xref ref-type="bibr" rid="B22">Raissi et&#x20;al., 2019</xref>). However, to the authors&#x2019; best knowledge, there is no study that investigates possible NN-based solutions for partial differential equations that describe the full dynamics of continuum manipulators. In this work, inspired by a time-space integration scheme and by using the Lie group variational integration method (<xref ref-type="bibr" rid="B4">Demoures et&#x20;al., 2015</xref>), the dynamic equations for translation and rotation for each node of a soft continuum manipulator are decoupled, providing an appropriate structure aimed at developing a real-time modeling algorithm. Afterward, Recurrent Neural Networks (RNNs)-based models are employed to approximate the high-dimensional discretized equations. Additionally, external torques and forces (e.g., control inputs, friction, and gravity) are incorporated into the model in a real-time manner for control applications.</p>
<p>The ability of RNNs to learn and approximate large classes of nonlinear functions over sequences of inputs accurately makes them prime candidates for use in dynamic modeling of complex nonlinear systems. RNNs with Long Short-Term Memory (LSTM) layers process sequences by iterating through the sequence elements. Using an internal feedback, the network is capable of preserving long-term dependencies. Essentially, LSTM layers prevent older information from gradually vanishing. These networks also have been used for several applications in soft robotics. To name a few, Thuruthel in <xref ref-type="bibr" rid="B30">Thuruthel et&#x20;al. (2019)</xref> proposes a model-free, real-time sensing method for soft robots perception. The authors in <xref ref-type="bibr" rid="B29">Thuruthel et&#x20;al. (2017)</xref> uses RNNs to model and control soft robotic manipulators. Also, force and motion estimation using RNNs has been investigated in <xref ref-type="bibr" rid="B17">Marban et&#x20;al. (2019)</xref> and <xref ref-type="bibr" rid="B32">Turan et&#x20;al. (2018)</xref>, respectively.</p>
<p>This paper aims to develop a real-time dynamic model for analyzing the dynamics of soft manipulators. Investigation of previous work on the modeling of the continuum manipulators suggests that existing literature focuses primarily on static or quasi-static approaches, or does not provide a real-time model. The contribution of this article is to present a scalable, parallel and real-time modeling algorithm for soft manipulators dynamics. The contributions of this paper are as follows.<list list-type="simple">
<list-item>
<p>&#x2022; Existing approaches primarily deal with kinematic modeling methods. Nevertheless, in this study, real-time prediction of soft manipulators full spatial dynamics is considered in the proposed RNN-based algorithm by proposing multiple light-weight RNN-based models.</p>
</list-item>
<list-item>
<p>&#x2022; In traditional modeling approaches, there are no systematic methods to obtain knowledge about dissipation forces, in particular friction, in the modeling procedure. The presented algorithm intrinsically takes the dissipation forces into account and incorporates their effects into the&#x20;model.</p>
</list-item>
<list-item>
<p>&#x2022; Through an experiment, results of the proposed RNN-based model and Cosserat rod theory method are compared, revealing the practical effectiveness of the proposed methodology.</p>
</list-item>
</list>
</p>
<p>The remainder of this paper is organized as follows: the problem statement is given in <xref ref-type="sec" rid="s2">Section 2</xref>. <xref ref-type="sec" rid="s3">Section 3</xref> describes the proposed RNN-based algorithm in details. In <xref ref-type="sec" rid="s4">Section 4 and </xref>
<xref ref-type="sec" rid="s5">Section 5</xref>, different simulations and experimental validation are presented to demonstrate the efficacy of the proposed RNN-based method, in terms of the model performances and accurately predicting poses of manipulators. Finally, the main conclusions are stated in <xref ref-type="sec" rid="s8">Section&#x20;7</xref>.</p>
</sec>
<sec id="s2">
<label>2</label>
<title>Problem Statement</title>
<p>Consider a continuum manipulator with large deflections described by dynamic equations of motion [as presented in <xref ref-type="bibr" rid="B28">Tariverdi et&#x20;al. (2020)</xref> and <xref ref-type="bibr" rid="B4">Demoures et&#x20;al. (2015)</xref>] in the PDEs form as<disp-formula id="e1">
<mml:math id="me1">
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:mi>H</mml:mi>
<mml:msub>
<mml:mi>&#x3c9;</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>&#x3c9;</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>H</mml:mi>
<mml:mi>&#x3c9;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>n</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:msup>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>&#x3d5;</mml:mi>
<mml:mi>x</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>&#x39b;</mml:mi>
<mml:mi>x</mml:mi>
</mml:msub>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>m</mml:mi>
<mml:mi>x</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mi>&#x3c4;</mml:mi>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mi>M</mml:mi>
<mml:msub>
<mml:mi>&#x3d5;</mml:mi>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>&#x39b;</mml:mi>
<mml:mi>x</mml:mi>
</mml:msub>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>n</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x39b;</mml:mi>
<mml:msub>
<mml:mi>n</mml:mi>
<mml:mi>x</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mi>f</mml:mi>
<mml:mi>c</mml:mi>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>f</mml:mi>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
<label>(1)</label>
</disp-formula>where <inline-formula id="inf1">
<mml:math id="minf1">
<mml:mrow>
<mml:mi>M</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>&#x3c1;</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>A</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> (<italic>&#x3c1;</italic> and <italic>A</italic> are the manipulator constant mass density and its cross-section area), <inline-formula id="inf2">
<mml:math id="minf2">
<mml:mrow>
<mml:mi>&#x3c9;</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> is the manipulator&#x2019;s angular velocity, <inline-formula id="inf3">
<mml:math id="minf3">
<mml:mrow>
<mml:mi>H</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> is the manipulator&#x2019;s inertia matrix, <inline-formula id="inf4">
<mml:math id="minf4">
<mml:mrow>
<mml:mi>&#x3d5;</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> is the position of the manipulator&#x2019;s line of centroids in its workspace, <inline-formula id="inf5">
<mml:math id="minf5">
<mml:mrow>
<mml:mi>&#x39b;</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>S</mml:mi>
<mml:mi>O</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mn>3</mml:mn>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> denotes the orientation of moving cross-sections at point &#x3d5;. Also, <inline-formula id="inf6">
<mml:math id="minf6">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf7">
<mml:math id="minf7">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> are the stresses and momenta along the manipulator, <inline-formula id="inf8">
<mml:math id="minf8">
<mml:mrow>
<mml:msup>
<mml:mi>f</mml:mi>
<mml:mi>c</mml:mi>
</mml:msup>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> represents conservative forces (e.g. gravity). Furthermore, <inline-formula id="inf9">
<mml:math id="minf9">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mo>&#x22c5;</mml:mo>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>x</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf10">
<mml:math id="minf10">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mo>&#x22c5;</mml:mo>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>t</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf11">
<mml:math id="minf11">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mo>&#x22c5;</mml:mo>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> denote partial derivatives with respect to position, time, and the second partial derivative with respect to time, respectively. Finally, <inline-formula id="inf12">
<mml:math id="minf12">
<mml:mrow>
<mml:mi>f</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf13">
<mml:math id="minf13">
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> are non-conservative forces and torques (e.g., frictions and control inputs)<xref ref-type="fn" rid="fn1">
<sup>1</sup>
</xref>.</p>
<p>Although high fidelity models given in the references can describe continuum manipulators dynamics efficiently, they suffer from limitations that are discussed in <xref ref-type="sec" rid="s1">Section 1</xref>. Inspired by the structure and formulation of the dynamics based on the Lie group variational integration scheme, the aim is to propose distributed deep recurrent neural networks to capture and simulate soft manipulators dynamics in real-time to be able control them more accurately than existing models.</p>
</sec>
<sec id="s3">
<label>3</label>
<title>Proposed RNN-Based Model</title>
<p>This section is devoted to develop a model based on the time series prediction using RNNs. To solve PDEs numerically using NNs, one approach is to utilize discrete solutions of finite element or difference methods to train an NN. A Lie group variational time integration model is employed to discretize the continuous dynamics of a soft manipulator<xref ref-type="fn" rid="fn2">
<sup>2</sup>
</xref>. The whole manipulator is discretized into an arbitrary number of nodes where the position and orientation equations of each node are decoupled. In our study, we discretize the manipulator with equidistant nodes, but this can be changed depending on the application.</p>
<p>
<xref ref-type="fig" rid="F1">Figure&#x20;1</xref> demonstrates a soft continuum manipulator at time <italic>t</italic> where <inline-formula id="inf14">
<mml:math id="minf14">
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mtext>&#x2a;</mml:mtext>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> is the undeformed length of Node <inline-formula id="inf15">
<mml:math id="minf15">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>. The force <inline-formula id="inf16">
<mml:math id="minf16">
<mml:mrow>
<mml:mi>F</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mo>&#x2217;</mml:mo>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, torque <inline-formula id="inf17">
<mml:math id="minf17">
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mo>&#x2217;</mml:mo>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> are applied to Node <inline-formula id="inf18">
<mml:math id="minf18">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> at the position <inline-formula id="inf19">
<mml:math id="minf19">
<mml:mrow>
<mml:mi>&#x3d5;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mo>&#x2217;</mml:mo>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. Also, <inline-formula id="inf20">
<mml:math id="minf20">
<mml:mrow>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mo>&#x2217;</mml:mo>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> is the orientation matrix from the frame <inline-formula id="inf21">
<mml:math id="minf21">
<mml:mrow>
<mml:mrow>
<mml:mo>{</mml:mo>
<mml:mi>O</mml:mi>
<mml:mo>}</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> to the frame <inline-formula id="inf22">
<mml:math id="minf22">
<mml:mrow>
<mml:mrow>
<mml:mo>{</mml:mo>
<mml:mrow>
<mml:msubsup>
<mml:mi>O</mml:mi>
<mml:mi>t</mml:mi>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
<mml:mo>}</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> attached to the cross-section of Node <inline-formula id="inf23">
<mml:math id="minf23">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>.</p>
<fig id="F1" position="float">
<label>FIGURE 1</label>
<caption>
<p>A soft manipulator at time <italic>t</italic> with discretization nodes <italic>n</italic> and <inline-formula id="inf24">
<mml:math id="minf24">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> are shown. <inline-formula id="inf25">
<mml:math id="minf25">
<mml:mrow>
<mml:mi>&#x3d5;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mtext>&#x2a;</mml:mtext>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf26">
<mml:math id="minf26">
<mml:mrow>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mo>&#x2217;</mml:mo>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> denote the position and the orientation of cross-section of Node <inline-formula id="inf27">
<mml:math id="minf27">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>, respectively. In addition, the force <inline-formula id="inf28">
<mml:math id="minf28">
<mml:mrow>
<mml:mi>F</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mtext>&#x2a;</mml:mtext>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, torque <inline-formula id="inf29">
<mml:math id="minf29">
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mtext>&#x2a;</mml:mtext>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, and the conservative force <inline-formula id="inf30">
<mml:math id="minf30">
<mml:mrow>
<mml:msup>
<mml:mi>f</mml:mi>
<mml:mi>c</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> (e.g., gravity) are applied to Node <inline-formula id="inf31">
<mml:math id="minf31">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> at the position <inline-formula id="inf32">
<mml:math id="minf32">
<mml:mrow>
<mml:mi>&#x3d5;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>x</mml:mi>
<mml:mtext>&#x2a;</mml:mtext>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g001.tif"/>
</fig>
<p>The discrete equations suggest an appropriate structure for the RNNs-based model. Given time-sequence inputs (as a first input layer), i.e.,&#x20;poses (positions and orientations) of nodes, and also forces and torques (as a second input layer) applied to each node, the RNN-based model of Node <italic>n</italic> is depicted in <xref ref-type="fig" rid="F2">Figure&#x20;2A,B</xref>. For Node <italic>n</italic>, the first input layer is a time-sequence series of poses <inline-formula id="inf33">
<mml:math id="minf33">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf34">
<mml:math id="minf34">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>n</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf35">
<mml:math id="minf35">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> (i.e.,&#x20;poses of Node <italic>n</italic> and its adjacent nodes <inline-formula id="inf36">
<mml:math id="minf36">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf37">
<mml:math id="minf37">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>) and the second input layer includes forces and torques of node <italic>n</italic> at time <italic>t</italic>, i.e.,&#x20;<inline-formula id="inf38">
<mml:math id="minf38">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msubsup>
<mml:mi>F</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>n</mml:mi>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mi>&#x3c4;</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>n</mml:mi>
</mml:msubsup>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> which are incorporated into the model through dense layers.</p>
<fig id="F2" position="float">
<label>FIGURE 2</label>
<caption>
<p>Recurrent Neural Network-based model, length of the time history horizon is determined by <italic>&#x3b7;</italic> and features composed of adjacent nodes pose: <bold>(A)</bold>: Poses of Nodes <inline-formula id="inf39">
<mml:math id="minf39">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>, <italic>n</italic>, and <inline-formula id="inf40">
<mml:math id="minf40">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> are the input layer and no forces or torques are applied to the node. <bold>(B)</bold>: The first input layer is composed of poses <inline-formula id="inf41">
<mml:math id="minf41">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf42">
<mml:math id="minf42">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>n</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf43">
<mml:math id="minf43">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> at time history horizon <inline-formula id="inf44">
<mml:math id="minf44">
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x3b7;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x3b7;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and the second input layer includes forces and torques <inline-formula id="inf45">
<mml:math id="minf45">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msubsup>
<mml:mi>F</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>n</mml:mi>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mi>&#x3c4;</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>n</mml:mi>
</mml:msubsup>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> which are incorporated into the model through the Hidden Layers II (dense and flatten layers). <bold>(C)</bold>: Proposed RNN-based models of the continuum manipulator with <italic>N</italic> nodes including Input, Hidden, and Output Layers. A history of each node output is used as an input for adjacent nodes. Nodes poses (Input Layer I) and forces and torques (Input Layer II) through the Hidden layers I and II are proceed and concatenated together.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g002.tif"/>
</fig>
<p>The network takes specific size vectors as inputs, which are called input layers. The inputs are transformed through a series of hidden layers (LSTM, dense, or fully connected layers) to produce an output. The output vectors are called an output layer. Dense or fully connected layers perform linear operations (i.e.,&#x20;multiplication and summation) on their inputs. Furthermore, LSTM layers consist of LSTM units, which can process sequences of data of any length, for example, poses of nodes. An LSTM unit controls contributions of each element of the input layer in the output and keeps track of the dependencies between the elements (<xref ref-type="bibr" rid="B8">Hochreiter and Schmidhuber, 1997</xref>).</p>
<p>For the training process, data-sets contain time-sequence inputs and forces and torques applied to each node. Also, for each node, the poses of the node and its neighbors are considered features, as shown in <xref ref-type="fig" rid="F2">Figure&#x20;2A,B</xref>. The first and second input layers proceed through LSTM layers and dense layers as hidden layers, respectively. Finally, output layers have resulted from fully connected layers.</p>
<p>By augmenting the given models for all nodes (see <xref ref-type="fig" rid="F2">Figure&#x20;2B</xref>) as a series, the proposed RNN-based models of the whole continuum manipulator with <italic>N</italic> nodes with non-conservative forces and torques are depicted in <xref ref-type="fig" rid="F2">Figure&#x20;2C</xref>. Output of every node is updated at each time step by using a history (at least two previous time steps) of neighboring node outputs. Therefore, the proposed architecture suggests a suitable framework to construct a parallel modeling algorithm.</p>
</sec>
<sec id="s4">
<label>4</label>
<title>Simulations Results</title>
<p>In this section, we consider different examples and evaluate the performance of the proposed RNN-based model in <xref ref-type="fig" rid="F2">Figure&#x20;2C</xref>. It is worth mentioning that data-sets play a crucial role in efficiency and accuracy in machine learning-based algorithms. The data acquisition process from a robot in real-world environments is both time and cost-consuming (implementation of multiple sensors, data filtering, and fusion, etc.). As an alternative approach, the required data can be acquired through simulations of high fidelity models. The obtained data can thus be transferred to train the algorithms to be implemented in real-world scenarios. In this section and for the presented examples, required data for the training of the proposed RNN-based model are acquired through simulations of the algorithm presented in <xref ref-type="bibr" rid="B28">Tariverdi et&#x20;al. (2020)</xref>, Sec. 2). For clarity, this model is henceforth referred to as the analytical dynamic model. In addition, since thin rods are considered in the examples, orientations of cross-sections are not of any concern. Also, it should be noted that orientations, except the twisting angle, can be reconstructed from manipulators&#x2019; configuration. Therefore, to obtain a computationally light model, the focus of attention is only on the prediction of positions.</p>
<sec id="s4-1">
<label>4.1</label>
<title>First Simulation: An Ellipse Without External Wrenches</title>
<p>As a first case, a cylindrical rod is bent into a circle and its ends are attached to one another. The rod is then deformed into an elliptical shape and released. Due to potential energies in the ellipse, it starts to move without any external disturbances. The goal is to model the behavior of the ellipse resultant from its internal elastic energy.</p>
<p>The ellipse is formed in the <inline-formula id="inf46">
<mml:math id="minf46">
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mi>y</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>-plane with the width 0.2&#xa0;m and height 0.6&#xa0;m. As boundary conditions, the first and last nodes are fixed to the origin and their orientations are set to <inline-formula id="inf47">
<mml:math id="minf47">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>y</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>18.07</mml:mn>
<mml:mo>&#xb0;</mml:mo>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf48">
<mml:math id="minf48">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>y</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>341.92</mml:mn>
<mml:mo>&#xb0;</mml:mo>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, respectively, where <inline-formula id="inf49">
<mml:math id="minf49">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>y</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>&#x3b8;</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> denotes a rotation matrix describing a rotation around the <italic>y</italic>-axis by <italic>&#x3b8;</italic> degrees. The rod properties, simulation parameters, and the structure of the proposed RNN-based model are given in <xref ref-type="fig" rid="F3">Figure&#x20;3A,B</xref>. Furthermore, the initial and a few time-evolved configurations are shown in <xref ref-type="fig" rid="F3">Figure&#x20;3C</xref>. As seen, the ellipse oscillates back and forth due to its internal elastic energy. Since orientations except the twisting angle can be reconstructed from the configuration of the manipulator, to have a light model and for brevity, positions of the node located at <inline-formula id="inf50">
<mml:math id="minf50">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>0.01</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>0.59</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>&#x2014;Node 30th&#x2014;are predicted. The chosen node is the furthest from the origin and would, compared to other nodes, most likely have the largest errors.</p>
<fig id="F3" position="float">
<label>FIGURE 3</label>
<caption>
<p>First simulation example: <bold>(A)</bold>: The model architecture used for the first simulation example. The first stage is the Input layer, the intermediate stages are the Hidden layers, and the last stage is the Output layer. The first dimension of inputs and outputs in each layer are unspecified and can vary with the size of batches. <bold>(B)</bold>: Rod properties and simulation parameters used in the first example. <bold>(C)</bold>: Initial and time-evolved configurations. Positions of node specified by a red rectangle are measured and predicted. <bold>(D)</bold>: Measured position calculated from analytical dynamic model and predicted by the proposed RNN-based model in the <inline-formula id="inf51">
<mml:math id="minf51">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf52">
<mml:math id="minf52">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf53">
<mml:math id="minf53">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes are given. <bold>(E)</bold>: RMS error considering all the&#x20;axes.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g003.tif"/>
</fig>
<p>50,001 position samples are generated from the analytical model for each node. We augment 1-by-3 position vectors of Node 30th and its adjacent nodes (Nodes 29th and 31st) at each time step. Therefore, the augmentation results in a 1-by-9 vector. Furthermore, the size of history horizons is chosen to be 2. In other words, <inline-formula id="inf54">
<mml:math id="minf54">
<mml:mrow>
<mml:mi>&#x3b7;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> in <xref ref-type="fig" rid="F2">Figure&#x20;2A,B</xref>. Finally, augmented 2-by-9 tensors are obtained for each time step. The prepared data-set is called Data-set I and 60 percent of it is used for training process. The architecture in <xref ref-type="fig" rid="F3">Figure&#x20;3A</xref> shows the input layer consists of tensors of size 2&#x20;&#xd7; 9. The first dimension of all layers are reserved for batch sizes and for the training, the batch size 1 was chosen. In the architecture of the model in <xref ref-type="fig" rid="F3">Figure&#x20;3A</xref>, the Input, Hidden and Output Layers I together with the number of nodes and type of layers are demonstrated according to <xref ref-type="fig" rid="F2">Figure&#x20;2A</xref>.</p>
<p>First, we evaluate the model by using unseen data samples in Data-set I and the results are shown in <xref ref-type="fig" rid="F3">Figure&#x20;3D</xref>. The maximum and mean absolute error are <inline-formula id="inf55">
<mml:math id="minf55">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>1.57</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>0.27</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf56">
<mml:math id="minf56">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>2.27</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>0.46</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf57">
<mml:math id="minf57">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>0.23</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>0.06</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, or in other words, the percentage of the maximum errors with respect to the length of the manipulator are 0.11, 0.17, and 0.02 in the <inline-formula id="inf58">
<mml:math id="minf58">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf59">
<mml:math id="minf59">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf60">
<mml:math id="minf60">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes, respectively. It is worth mentioning that it is prior knowledge that the manipulator does not have any motion in the <inline-formula id="inf61">
<mml:math id="minf61">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axis and therefore, components of the <inline-formula id="inf62">
<mml:math id="minf62">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axis in position vectors can be ignored. Furthermore, the evaluation Root-Mean-Square (RMS) errors of the considered node in all axes at every time step is calculated by<disp-formula id="e2">
<mml:math>
<mml:mrow>
<mml:mi>R</mml:mi>
<mml:mi>M</mml:mi>
<mml:mi>S</mml:mi>
<mml:mi>E</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msqrt>
<mml:mrow>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mn>3</mml:mn>
</mml:mfrac>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mn>2</mml:mn>
</mml:msup>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mn>2</mml:mn>
</mml:msup>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>z</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>z</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mn>2</mml:mn>
</mml:msup>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:msqrt>
</mml:mrow>
</mml:math>
<label>(2)</label>
</disp-formula>where predicted positions <inline-formula id="inf63">
<mml:math id="minf63">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>z</mml:mi>
<mml:mi>p</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> obtained from the proposed RNN-based model and measurement positions <inline-formula id="inf64">
<mml:math id="minf64">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>z</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>t</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> in Data-set I and the results are shown in <xref ref-type="fig" rid="F3">Figure&#x20;3E</xref>.</p>
<p>To demonstrate that the model can be extended to different boundary and initial conditions, the cylindrical rod is employed to form a horizontal ellipse with the width 0.6&#xa0;m and height 0.2&#xa0;m. The rod properties and the simulation parameters given in <xref ref-type="fig" rid="F3">Figure&#x20;3B</xref> are used. As boundary conditions, the first and last nodes are attached to the origin and their orientations are set to the identity. The manipulator with the new boundary and initial conditions is only used for the evaluation of the trained model by predicting positions of the node located at <inline-formula id="inf65">
<mml:math id="minf65">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>0.01</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>0.19</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. Based on the prediction, the maximum and mean absolute errors are <inline-formula id="inf66">
<mml:math id="minf66">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>26.33</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>3.37</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf67">
<mml:math id="minf67">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>21.71</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>3.70</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf68">
<mml:math id="minf68">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>4.92</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>4.22</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> in the <inline-formula id="inf69">
<mml:math id="minf69">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf70">
<mml:math id="minf70">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf71">
<mml:math id="minf71">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes, respectively. Furthermore, the maximum/worst-case errors with respect to the length of the manipulator are <inline-formula id="inf72">
<mml:math id="minf72">
<mml:mrow>
<mml:mn>1.97</mml:mn>
<mml:mo>%</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf73">
<mml:math id="minf73">
<mml:mrow>
<mml:mn>1.62</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf74">
<mml:math id="minf74">
<mml:mrow>
<mml:mn>0.37</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula> in each axis, respectively.</p>
<p>Let us assume that the analytical dynamic model is implemented in a parallel scheme, i.e.,&#x20;each node of 59 nodes is handled with a CPU core or different hardware such that there is no latency in communications. Then, the dynamics of each node can be solved in <inline-formula id="inf75">
<mml:math id="minf75">
<mml:mrow>
<mml:mn>1.62</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>4</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> s on average. In addition, to preserve the convergence of the solver of the analytical dynamic model, the maximum constant time step for this simulation is <inline-formula id="inf76">
<mml:math id="minf76">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> s. A minimum criterion to have a real-time performance is that the time required to solve each node dynamics must be less than the constant step simulation. To be more specific, to have a real-time model, the CPU time, i.e.,&#x20;the amount of time spent in a user code must be less than Wall-clock time that measures the time elapsed to run a user code. According to this minimal criterion, as long as the computation-time for simulation of a method/model is less than a user-defined time for the simulation, the model is called a real-time model. It can be shown that in this example and based on the given assumption, the maximum bandwidth for a real-time performance is 3.93&#xa0;Hz on average (calculation is done on a 16&#xa0;GB, 1.99&#xa0;GHz Intel i7 machine running windows 10). It should be pointed out that we use the same machine for calculations in this paper. It will be discussed that even achieving this bandwidth limit is not feasible. On the other hand, for the proposed RNN-based model, the bandwidth of a real-time performance is 65.70&#xa0;Hz, which can be further improved by optimizing the number of layers and trainable parameters.</p>
<p>It is worth mentioning that the considered assumption is very strict, which cannot be satisfied in reality. First of all, conventional algorithms need a relatively high number of nodes to have numerical stability and an acceptable convergence rate. Furthermore, due to limitations in computation resources, more than one node will be assigned to each core of CPU, and there is always latency in communications between threads in parallel programmings. Therefore, reaching the mentioned bandwidth through the analytical dynamic model is infeasible. However, the real-time performance of the proposed RNN-based model can be applicable in closed-loop control applications.</p>
</sec>
<sec id="s4-2">
<label>4.2</label>
<title>Second Simulation: A Cylindrical Rod With External Wrenches</title>
<p>In the second example, we simulate a rod with a circular cross section, which is actuated by external forces such that its tip tracks a square in space. In this example, the goal is to model the behavior of the rod which results from applied external forces on its end-effector. For boundary conditions, the first node is fixed to the origin and its orientation is set to the identity for all time steps. The rod properties and simulation parameters, and the structure of the proposed model are given in <xref ref-type="fig" rid="F4">Figure&#x20;4</xref>. The trajectory of the end-effector and the applied forces onto it are shown in <xref ref-type="fig" rid="F5">Figure&#x20;5A</xref>.</p>
<fig id="F4" position="float">
<label>FIGURE 4</label>
<caption>
<p>
<bold>(A)</bold>: The model architecture used for the second simulation example. There are two Input layers, the first one is the poses of the node and the second input is the applied forces on the node. The first dimension of inputs and outputs in each layer are unspecified and can vary with the size of batches. <bold>(B)</bold>: Rod properties and simulation parameters used in the second example.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g004.tif"/>
</fig>
<fig id="F5" position="float">
<label>FIGURE 5</label>
<caption>
<p>Second simulation example: <bold>(A)</bold>: Initial, Time-evolved configurations and forces on the last node. <bold>(B)</bold>: Tip positions: calculated from the analytical dynamic model and predicted by the proposed RNN-based model. <bold>(C)</bold> RMS error considering all the axes. <bold>(D)</bold> Predicted and measured trajectories.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g005.tif"/>
</fig>
<p>160,001 position and force samples are generated from the analytical model for each node. We augment 1-by-3 position vectors of the last node (end-effector) and its adjacent node at each time step. Therefore, the augmentation results in a 1-by-6 vector. Furthermore, the size of history horizons is chosen to be 2 (<inline-formula id="inf77">
<mml:math id="minf77">
<mml:mrow>
<mml:mi>&#x3b7;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>). Finally, augmented 2-by-6 tensors are obtained for each time steps which are fed to the model as the Input Layer I. The same preparation process are applied for the force data samples which are used as the Input Layer II. The prepared data-set is called Data-set II and 60% of it is used for training process. The architecture in <xref ref-type="fig" rid="F4">Figure&#x20;4A</xref> shows the Input layers I and II consist of tensors of size <inline-formula id="inf78">
<mml:math id="minf78">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>B</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>c</mml:mi>
<mml:mi>h</mml:mi>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>S</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>z</mml:mi>
<mml:mi>e</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>6</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf79">
<mml:math id="minf79">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>B</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>c</mml:mi>
<mml:mi>h</mml:mi>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>S</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>z</mml:mi>
<mml:mi>e</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, respectively. The first dimension of all layers are reserved for batch sizes and for the training, the batch size 1 was chosen. In the architecture of the model in <xref ref-type="fig" rid="F4">Figure&#x20;4A</xref>, the Input, Hidden and Output Layers I and II together with the number of nodes and type of layers are demonstrated according to <xref ref-type="fig" rid="F2">Figure&#x20;2B</xref>.</p>
<p>First, unseen data samples in Data-set II are employed to evaluate the model, and tip positions are calculated and the results are shown in <xref ref-type="fig" rid="F5">Figure&#x20;5B</xref>. The maximum and mean absolute error are <inline-formula id="inf80">
<mml:math id="minf80">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>3.58</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>1.70</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf81">
<mml:math id="minf81">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>1.80</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>0.69</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf82">
<mml:math id="minf82">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>2.73</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>1.41</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, or in other words, the maximum errors with respect to the length of the manipulator are <inline-formula id="inf83">
<mml:math id="minf83">
<mml:mrow>
<mml:mn>0.71</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf84">
<mml:math id="minf84">
<mml:mrow>
<mml:mn>0.36</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf85">
<mml:math id="minf85">
<mml:mrow>
<mml:mn>0.54</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula> in <inline-formula id="inf86">
<mml:math id="minf86">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf87">
<mml:math id="minf87">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf88">
<mml:math id="minf88">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes, respectively. The RMS errors of the end-effector through <xref ref-type="disp-formula" rid="e2">Eq. 2</xref> are shown in <xref ref-type="fig" rid="F5">Figure&#x20;5C</xref>.</p>
<p>To evaluate the generalizability of the trained model, different profiles of forces are applied to the model aiming at obtaining different position trajectories for the end-effector as depicted in <xref ref-type="fig" rid="F6">Figure&#x20;6A,D</xref>. To fulfill the goal of the second example, the new forces are only used for the evaluation of the trained model by predicting the positions of the end-effector. Results of the prediction are plotted in <xref ref-type="fig" rid="F6">Figure&#x20;6B</xref> and are as follows: The maximum and mean absolute errors are <inline-formula id="inf89">
<mml:math id="minf89">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>10.49</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>2.61</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf90">
<mml:math id="minf90">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>5.54</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>1.05</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf91">
<mml:math id="minf91">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>5.97</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>2.83</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, furthermore, the percentage of the maximum/worst-case errors with respect to the&#x20;length of the manipulator are 1.90, 1, and 1.08 in the <inline-formula id="inf92">
<mml:math id="minf92">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf93">
<mml:math id="minf93">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf94">
<mml:math id="minf94">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes, respectively. The RMS errors of the end-effector through <xref ref-type="disp-formula" rid="e2">Eq. 2</xref> are shown in <xref ref-type="fig" rid="F6">Figure&#x20;6C</xref>.</p>
<fig id="F6" position="float">
<label>FIGURE 6</label>
<caption>
<p>Evaluation Example of Second simulation: <bold>(A)</bold>: Initial, Time-evolved configurations and forces on the end-effector <bold>(B)</bold>: Tip positions: calculated from the analytical dynamic model and predicted by the proposed RNN-based model. <bold>(C)</bold> RMS error considering all the axes <bold>(D)</bold> Predicted and measured trajectories.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g006.tif"/>
</fig>
<p>In this example, the maximum constant time step for this simulation is <inline-formula id="inf95">
<mml:math id="minf95">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>4</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>&#xa0;s, to have a convergent numerical solver for the analytical dynamic model. In addition, on average, the time <inline-formula id="inf96">
<mml:math id="minf96">
<mml:mrow>
<mml:mn>1.89</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>4</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> s is required for solving the dynamics of each node. In other words, the analytical dynamic model can not achieve any real-time performance for this example. However, the proposed model achieves a real-time performance of the bandwidth of 60.30&#xa0;Hz on average.</p>
</sec>
<sec id="s4-3">
<label>4.3</label>
<title>Third Simulation: A Cylindrical Rod With and Without External Wrenches</title>
<p>In the last example, we form a semi-circular shape with a cylindrical rod. A force is applied to the middle node&#x2014;Node 51th&#x2014;in the -<italic>y</italic>-axis direction for 0.5&#xa0;s and then the force is removed. Furthermore, the boundary conditions are as follows: the first and last nodes are fixed to the origin and their orientations are set to the identity and <inline-formula id="inf97">
<mml:math id="minf97">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>z</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>181.81</mml:mn>
<mml:mo>&#xb0;</mml:mo>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, respectively, where <inline-formula id="inf98">
<mml:math id="minf98">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>z</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>&#x3b8;</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> describes rotation around the <italic>z</italic>-axis by <italic>&#x3b8;</italic> degrees. In this example, the idea is to model the behavior of the rod resulted from applied external forces and internal elastic energy. The structure of the proposed model is given in <xref ref-type="fig" rid="F7">Figure&#x20;7A</xref> and the rod properties and simulation parameters are given in <xref ref-type="fig" rid="F7">Figure&#x20;7B</xref>. The initial and a few time-evolved configurations together with the applied forces are given in <xref ref-type="fig" rid="F8">Figure&#x20;8A</xref>.</p>
<fig id="F7" position="float">
<label>FIGURE 7</label>
<caption>
<p>
<bold>(A)</bold>: The model architecture used for the third simulation example. There are two Input layers, the first one is the poses of the node and the second input is the applied forces on the node. The first dimension of inputs and outputs in each layer are unspecified, and can vary with the size of batches <bold>(B)</bold>: Rod properties and simulation parameters used in the third example.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g007.tif"/>
</fig>
<fig id="F8" position="float">
<label>FIGURE 8</label>
<caption>
<p>Third simulation example: <bold>(A)</bold>: Initial, Time-evolved configurations and forces applied on the rod. Positions of the middle node, where the force is applied, are measured and predicted. <bold>(B)</bold>: Measured position calculated from analytical dynamic model and predicted by the proposed RNN-based model in the <inline-formula id="inf99">
<mml:math id="minf99">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf100">
<mml:math id="minf100">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf101">
<mml:math id="minf101">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes are given. <bold>(C)</bold> RMS error considering all the&#x20;axes.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g008.tif"/>
</fig>
<p>20,001 position and force samples are generated from the analytical model for each node. We augment 1-by-3 position vectors of Node 15th and its adjacent nodes at each time step. Therefore, the augmentation results in a 1-by-9 vector. Furthermore, the size of history horizons is chosen to be 2 (<inline-formula id="inf102">
<mml:math id="minf102">
<mml:mrow>
<mml:mi>&#x3b7;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>). Finally, augmented 2-by-9 tensors are obtained for each time steps which are fed to the model as the Input Layer I. The same preparation process are applied for the force data samples which are used as the Input Layer II. The prepared data-set is called Data-set III and 60% of the data is used for training process. The architecture in <xref ref-type="fig" rid="F7">Figure&#x20;7A</xref> shows the Input layers I and II consist of tensors of size <inline-formula id="inf103">
<mml:math id="minf103">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>B</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>c</mml:mi>
<mml:mi>h</mml:mi>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>S</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>z</mml:mi>
<mml:mi>e</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>9</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf104">
<mml:math id="minf104">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>B</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>c</mml:mi>
<mml:mi>h</mml:mi>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>S</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>z</mml:mi>
<mml:mi>e</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, respectively. The first dimension of all layers are reserved for batch sizes and for the training, the batch size 1 was chosen. In the architecture of the model in <xref ref-type="fig" rid="F7">Figure&#x20;7A</xref>, the Input, Hidden and Output Layers I and II together with the number of nodes and type of layers are demonstrated according to <xref ref-type="fig" rid="F2">Figure&#x20;2B</xref>.</p>
<p>The positions of Node 51th are predicted using seen and unseen data samples in Data-set III and the results are shown in <xref ref-type="fig" rid="F8">Figure&#x20;8B,C</xref>. The maximum and mean absolute error are <inline-formula id="inf105">
<mml:math id="minf105">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>1.36</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>0.78</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf106">
<mml:math id="minf106">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>0.23</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>0.13</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf107">
<mml:math id="minf107">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>2.22</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>0.81</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. Furthermore, the maximum/worst-case errors with respect to the length of the manipulator are <inline-formula id="inf108">
<mml:math id="minf108">
<mml:mrow>
<mml:mn>0.22</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf109">
<mml:math id="minf109">
<mml:mrow>
<mml:mn>0.04</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf110">
<mml:math id="minf110">
<mml:mrow>
<mml:mn>0.37</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula> in the <inline-formula id="inf111">
<mml:math id="minf111">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf112">
<mml:math id="minf112">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf113">
<mml:math id="minf113">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes, respectively.</p>
<p>For the evaluation of the trained model and to fulfill the goal of&#x20;this example, force vector <inline-formula id="inf114">
<mml:math id="minf114">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mn>0,0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>100</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>cos</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>&#x3c0;</mml:mi>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mN</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula> mN is applied to Node 51th for <inline-formula id="inf115">
<mml:math id="minf115">
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mn>1,2</mml:mn>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>s</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>. Results of the prediction are&#x20;as follows: The maximum and mean absolute errors are&#x20;<inline-formula id="inf116">
<mml:math id="minf116">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>3.73</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>1.25</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf117">
<mml:math id="minf117">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>0.2</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf118">
<mml:math id="minf118">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>8.1</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
<mml:mo>,</mml:mo>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mn>1.2</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>mm</mml:mtext>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, furthermore, the maximum/worst-case errors with respect to the length of the manipulator are <inline-formula id="inf119">
<mml:math id="minf119">
<mml:mrow>
<mml:mn>0.62</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf120">
<mml:math id="minf120">
<mml:mrow>
<mml:mn>0.33</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf121">
<mml:math id="minf121">
<mml:mrow>
<mml:mn>1.35</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula> in the <inline-formula id="inf122">
<mml:math id="minf122">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf123">
<mml:math id="minf123">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf124">
<mml:math id="minf124">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes, respectively.</p>
<p>In this example, the maximum constant time step for this simulation is <inline-formula id="inf125">
<mml:math id="minf125">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>4</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>s</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula> using the analytical model. In other words, the analytical model does not show a real-time performance since, on average, the time <inline-formula id="inf126">
<mml:math id="minf126">
<mml:mrow>
<mml:mn>2.22</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mn>10</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>4</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>s</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula> is required for solving the dynamics of each node. On the other hand, the proposed model can achieve a real-time performance of the bandwidth 58.13&#xa0;Hz on average.</p>
</sec>
</sec>
<sec id="s5">
<label>5</label>
<title>Experimental Results</title>
<p>This section is devoted to the experimental validation of the presented model. To that end, we fabricated a soft manipulator on which magnetic fields are used to produce necessary forces and torques. Compared to the simulations in which positions are predicted, time-sequence input is composed of orientations of nodes in the experiment. Furthermore, to show the performance of the algorithm, results from the presented method and a Cosserat rod-based theoretical model are compared to show the efficiency of the proposed RNN-based model. The Cosserat rod model of the soft manipulator is detailed in <xref ref-type="app" rid="app1">Appendix</xref>.</p>
<sec id="s5-1">
<label>5.1</label>
<title>Soft Continuum Manipulator</title>
<p>A soft continuum manipulator is fabricated from a urethane rubber Polymer Matrix Composite 770 (PMC-770, Smooth-On Inc., Macungie, United&#x20;States) and neodymium (NdFeB) block magnets whose dimensions are given in <xref ref-type="fig" rid="F9">Figure&#x20;9A</xref>. When the manipulator is subjected to an external magnetic field, the embedded magnets experience forces and torques. This causes the flexible portions of the manipulator comprised of the PMC to undergo elastic deformation.</p>
<fig id="F9" position="float">
<label>FIGURE 9</label>
<caption>
<p>
<bold>(A)</bold>: Polymer matrix composite 770 (PMC-770) beam continuum manipulator with embedded neodymium (NdFeb) magnets located at tip and intermediate positions. Dimensions are given in millimeter. <bold>(B)</bold>: Experimental setup consists of six stationary electromagnets and contains a segmented photograph of the final shape manipulator. The flexible PMC-770 and rigid NdFeb sections of the manipulator are blue and red, respectively. Six electromagnets generate a magnetic field (<inline-formula id="inf127">
<mml:math id="minf127">
<mml:mi mathvariant="bold-italic">B</mml:mi>
</mml:math>
</inline-formula>) in the workspace, exerting torques and forces (<inline-formula id="inf128">
<mml:math id="minf128">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3c4;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf129">
<mml:math id="minf129">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1,2</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>) on the magnets, which deforms the continuum manipulator to its final shape at the time <inline-formula id="inf130">
<mml:math id="minf130">
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>340</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>&#xa0;s. <bold>C</bold>: Representation of the shape reconstruction algorithm used for shape feedback. The manipulator is recorded with a stereo vision setup. The manipulator body is represented by a 3D spatial point cloud. The manipulator centerline, characterized by parameter <inline-formula id="inf131">
<mml:math id="minf131">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>L</mml:mi>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, is approximated by <inline-formula id="inf132">
<mml:math id="minf132">
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> points <inline-formula id="inf133">
<mml:math id="minf133">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mrow>
<mml:mo>{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mn>0</mml:mn>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>N</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. A 3D polynomial fit <inline-formula id="inf134">
<mml:math id="minf134">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> is made through the points, and the magnet orientation at an assumed constant centerline position <inline-formula id="inf135">
<mml:math id="minf135">
<mml:mrow>
<mml:msub>
<mml:mi>s</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> derived from the local gradient of the polynomial&#x20;fit.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g009.tif"/>
</fig>
<p>The PMC-770 has a density <inline-formula id="inf136">
<mml:math id="minf136">
<mml:mrow>
<mml:mi>&#x3c1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1000</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mtext>kg/m</mml:mtext>
</mml:mrow>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>, Young modulus <inline-formula id="inf137">
<mml:math id="minf137">
<mml:mrow>
<mml:mi>E</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>2.5</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>MPa</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, and Poisson ratio <inline-formula id="inf138">
<mml:math id="minf138">
<mml:mrow>
<mml:mi>&#x3bd;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0.5</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>. The distal and proximal NdFeb magnets have grades N45 and N42, respectively. In addition, they have density <inline-formula id="inf139">
<mml:math id="minf139">
<mml:mrow>
<mml:mi>&#x3c1;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>7000</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> kg/m<sup>3</sup>, Young modulus <inline-formula id="inf140">
<mml:math id="minf140">
<mml:mrow>
<mml:mi>E</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>41.4</mml:mn>
<mml:mtext>&#x2002;</mml:mtext>
<mml:mtext>GPa</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>, and Poisson ratio <inline-formula id="inf141">
<mml:math id="minf141">
<mml:mrow>
<mml:mi>&#x3bd;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0.3</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>. It should be pointed out that Young&#x2019;s modulus and densities of the soft manipulator constituent materials were determined using a combination of supplier data and experiments until theoretical results (predicted by the Cosserat rod model) would resemble the experiment results. The magnitude of the magnetic dipoles carried by the manipulator was calculated from the magnets volume and manufacturer-supplied residual flux density.</p>
</sec>
<sec id="s5-2">
<label>5.2</label>
<title>Experimental Setup</title>
<p>The experimental setup consists of 6 stationary electromagnets surrounding a spherical workspace of 100&#xa0;mm diameter <xref ref-type="bibr" rid="B25">Sikorski et&#x20;al. (2017)</xref>. <xref ref-type="fig" rid="F9">Figure&#x20;9B</xref> shows the setup of the experiment. In addition, the final shape of manipulator has been segmented and is shown in the workspace. The continuum manipulator is suspended horizontally (along <inline-formula id="inf142">
<mml:math id="minf142">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>) in the workspace and actuated to move in a plane, steering the magnets by manipulating the magnetic field generated by the electromagnets. Orientations are represented using the axis-angle notation. Let <inline-formula id="inf143">
<mml:math id="minf143">
<mml:mrow>
<mml:msub>
<mml:mi>k</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf144">
<mml:math id="minf144">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3d5;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>&#x211d;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> denote the axis- and angle-of-rotation, respectively, where <inline-formula id="inf145">
<mml:math id="minf145">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1,2</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> denotes the magnet index counting from the manipulator base. In the 2D experiment, <inline-formula id="inf146">
<mml:math id="minf146">
<mml:mrow>
<mml:msub>
<mml:mi>k</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>y</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf147">
<mml:math id="minf147">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3d5;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> is defined relative to&#x20;<inline-formula id="inf148">
<mml:math id="minf148">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>.</p>
<p>
<xref ref-type="fig" rid="F9">Figure&#x20;9C</xref> represents the shape reconstruction of the soft manipulator through images coming from two Dalsa Genie Nano C1940 Red-Green-Blue (RGB) cameras (TeledyneDalsa, Waterloo, ON, Canada). The flexible PMC-770 and rigid NdFeb magnets were colored blue and red, respectively. The RGB cameras (horizontal and vertical) that formed a stereo vision setup recorded the workspace during experiments. First, we discretize the actuation workspace into voxels. The silhouette of the continuum manipulator is segmented as binary masks and the manipulator body represented as a 3D spatial point cloud. The manipulator centerline is approximated by <inline-formula id="inf149">
<mml:math id="minf149">
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>&#x2115;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> discrete segments. A simple iterative shape reconstruction algorithm <xref ref-type="bibr" rid="B26">Sikorski et&#x20;al. (2019)</xref> moves through the voxels to represent the manipulator centerline with <italic>N</italic> discrete points <inline-formula id="inf150">
<mml:math id="minf150">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mrow>
<mml:mo>{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mn>0</mml:mn>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>N</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> as a function of centerline parameter <inline-formula id="inf151">
<mml:math id="minf151">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>L</mml:mi>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. To be specific, with knowledge of the RGB-camera frames, the points are projected onto each camera image. If a point is projected onto both binary masks, the point falls within the manipulator. This process is repeated for all voxels. Subsequently a 3D polynomial fit <inline-formula id="inf152">
<mml:math id="minf152">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> is made through the points. We assume that magnetically exerted forces and torques are insufficient for the manipulator extension along the centerline, and therefore assume constant positions of the magnets along the centerline, <inline-formula id="inf153">
<mml:math id="minf153">
<mml:mrow>
<mml:msub>
<mml:mi>s</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>L</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. The measured magnet position is thereafter obtained from the polynomial fit <inline-formula id="inf154">
<mml:math id="minf154">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>s</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, and its orientation from the local gradient of the polynomial fit <inline-formula id="inf155">
<mml:math id="minf155">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mo>&#x2202;</mml:mo>
<mml:mi>s</mml:mi>
</mml:msub>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>s</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> relative to a reference <inline-formula id="inf156">
<mml:math id="minf156">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula> axis,<disp-formula id="equ1">
<mml:math id="mequ1">
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:msub>
<mml:mi>&#x3d5;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mi>cos</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>z</mml:mi>
<mml:mo>&#x22c5;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mo>&#x2202;</mml:mo>
<mml:mi>s</mml:mi>
</mml:msub>
<mml:mi mathvariant="bold-italic">P</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>s</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>&#x2227;</mml:mo>
</mml:msup>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:msub>
<mml:mi>k</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mi>z</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:msub>
<mml:mo>&#x2202;</mml:mo>
<mml:mi>s</mml:mi>
</mml:msub>
<mml:mi mathvariant="bold-italic">P</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>s</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:mo>&#x2227;</mml:mo>
</mml:msup>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</disp-formula>where <inline-formula id="inf157">
<mml:math id="minf157">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mo>&#x22c5;</mml:mo>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>&#x2227;</mml:mo>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> represents a normalization. Furthermore, in the experiments performed for this study, camera occlusions did not&#x20;occur.</p>
<p>The magnetic torques and forces were computed from the magnets position <inline-formula id="inf158">
<mml:math id="minf158">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, magnets dipole moments <inline-formula id="inf159">
<mml:math id="minf159">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>, and electromagnet currents <inline-formula id="inf160">
<mml:math id="minf160">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mi>C</mml:mi>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>6</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>. The magnets position and orientations were obtained from the stereo vision setup. Afterwards, the orientations are used to compute magnets dipoles. To compute the magnetic field, each electromagnet is associated with a unit-current field and field gradient map (<inline-formula id="inf161">
<mml:math id="minf161">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>p</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf162">
<mml:math id="minf162">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mrow>
<mml:mo>&#x2207;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>p</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf163">
<mml:math id="minf163">
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mn>6</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>), which computes the unit-current contribution of the electromagnet to the field at field point <inline-formula id="inf164">
<mml:math id="minf164">
<mml:mi>p</mml:mi>
</mml:math>
</inline-formula>. We define a map <inline-formula id="inf165">
<mml:math id="minf165">
<mml:mrow>
<mml:mi mathvariant="script">G</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mrow>
<mml:mo>&#x2207;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>:</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2192;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>5</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> which takes the five independent gradient terms of the field (<xref ref-type="bibr" rid="B20">Petruska and Nelson, 2015</xref>). The field (gradient) at magnet position <inline-formula id="inf166">
<mml:math id="minf166">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold-italic">p</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> is then given by the superposition principle<disp-formula id="equ2">
<mml:math id="mequ2">
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:msub>
<mml:mi mathvariant="bold-italic">B</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mn>6</mml:mn>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold-italic">I</mml:mi>
<mml:mi>C</mml:mi>
</mml:msub>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mi mathvariant="script">G</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold-italic">B</mml:mi>
<mml:mrow>
<mml:mo>&#x2207;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mi mathvariant="script">G</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mrow>
<mml:mo>&#x2207;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="script">G</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mrow>
<mml:mo>&#x2207;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mn>6</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold-italic">I</mml:mi>
<mml:mi>C</mml:mi>
</mml:msub>
<mml:mo>.</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</disp-formula>
</p>
<p>The torques and forces exerted on the magnets due to the field is given by<disp-formula id="equ3">
<mml:math id="mequ3">
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3c4;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#xd7;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold-italic">B</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2207;</mml:mo>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x22c5;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold-italic">B</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
<mml:mo>&#x21d2;</mml:mo>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3c4;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:mo>&#xd7;</mml:mo>
</mml:msub>
<mml:msub>
<mml:mi mathvariant="bold-italic">B</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mi mathvariant="script">M</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mi mathvariant="script">G</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold-italic">B</mml:mi>
<mml:mrow>
<mml:mo>&#x2207;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>m</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:math>
</disp-formula>where <inline-formula id="inf167">
<mml:math id="minf167">
<mml:mrow>
<mml:mi mathvariant="script">M</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>:</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
<mml:mo>&#xd7;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>5</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> represents a map of the field independent spatial gradients to forces on the dipole <inline-formula id="inf168">
<mml:math id="minf168">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> (<xref ref-type="bibr" rid="B20">Petruska and Nelson, 2015</xref>). The applied magnetic forces and torques together with the initial and a few time-evolved configurations are shown in <xref ref-type="fig" rid="F10">Figure&#x20;10</xref>.</p>
<fig id="F10" position="float">
<label>FIGURE 10</label>
<caption>
<p>
<bold>(A)</bold>: Initial and time-evolved configurations. <bold>(B)</bold>: Applied torques and forces on the distal and proximal magnets.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g010.tif"/>
</fig>
<p>For modeling, we consider three nodes located at the locations of the proximal and distal magnets, and the clamped end of the rod. It should be pointed out that the performance of the proposed RNN-based model, unlike conventional algorithms, is independent of the number of nodes considered for the whole manipulator. Therefore, it is sufficient to model points of interest. The idea is to independently manipulate each magnet (actuation point). However, the setup provides us with 8 degrees of freedom, meaning that positions and orientations (12 degrees of freedom) cannot be manipulated at the same time. Therefore, we carried out the experiment to achieve only orientation control.</p>
<p>669 1-by-3 position samples and 1-by-6 augmented wrench samples (i.e.,&#x20;<inline-formula id="inf169">
<mml:math id="minf169">
<mml:mrow>
<mml:msup>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mi>&#x3c4;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>f</mml:mi>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>) for the both magnets are obtained. By choosing the size of history horizon 2 (<inline-formula id="inf170">
<mml:math id="minf170">
<mml:mrow>
<mml:mi>&#x3b7;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>), the augmented 2-by-6 position tensors are reshaped for each time step and fed to the model as the Input Layer I. The same preparation process is applied for the force data samples which are used as the Input Layer II. The prepared data-set is called Data-set IV and 60% of the data is used for training process. We suggest the same model for both moving nodes and the architecture of the model is depicted in <xref ref-type="fig" rid="F11">Figure&#x20;11</xref> which is the same for the proximal and distal nodes. The architecture shows the Input layers I and II consist of tensors of size <inline-formula id="inf171">
<mml:math id="minf171">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>B</mml:mi>
<mml:mi>a</mml:mi>
<mml:mi>t</mml:mi>
<mml:mi>c</mml:mi>
<mml:mi>h</mml:mi>
<mml:mo>&#xa0;</mml:mo>
<mml:mi>S</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>z</mml:mi>
<mml:mi>e</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>2</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>6</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. The first dimension of all layers are reserved for batch sizes and for the training, the batch size 1 was chosen. In the architecture of the model in <xref ref-type="fig" rid="F11">Figure&#x20;11</xref>, the Input, Hidden and Output Layers I and II together with the number of nodes and type of layers are demonstrated according to <xref ref-type="fig" rid="F2">Figure&#x20;2B</xref>.</p>
<fig id="F11" position="float">
<label>FIGURE 11</label>
<caption>
<p>The model architecture used for the experiment. There are two Input layers, the first one is the poses of the node and the second input is the applied forces on the proximal node. The first dimension of inputs and outputs in each layer are unspecified, and can vary with the size of batches.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g011.tif"/>
</fig>
</sec>
</sec>
<sec sec-type="results" id="s6">
<label>5.3</label>
<title>Results</title>
<p>The distal and proximal node rotations are predicted both by Cosserat rod model and the proposed model, and the results are shown in <xref ref-type="fig" rid="F12">Figure&#x20;12</xref>. Also, the maximum and mean absolute errors are stated in an ordered pair in <xref ref-type="table" rid="T1">Table&#x20;1</xref>.</p>
<fig id="F12" position="float">
<label>FIGURE 12</label>
<caption>
<p>
<bold>(A)</bold>: Measured and predicted orientations of tip/distal magnet by Cosserat rod model and proposed RNN-based model. <bold>(B)</bold>: RMS error for distal/tip magnet resulted from Cosserat rod model and proposed RNN-based model. <bold>(C)</bold>: Measured and predicted orientations of middle/proximal magnet by Cosserat rod model and proposed RNN-based model. <bold>(D)</bold>: RMS error for middle/proximal magnet resulted from Cosserat rod model and proposed RNN-based&#x20;model.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g012.tif"/>
</fig>
<table-wrap id="T1" position="float">
<label>TABLE 1</label>
<caption>
<p>The maximum and mean absolute errors around the <inline-formula id="inf172">
<mml:math id="minf172">
<mml:mi>x</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf173">
<mml:math id="minf173">
<mml:mi>y</mml:mi>
</mml:math>
</inline-formula>, and <inline-formula id="inf174">
<mml:math id="minf174">
<mml:mi>z</mml:mi>
</mml:math>
</inline-formula>-axes in ordered pairs for the distal and proximal&#x20;nodes.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left"/>
<th align="center">
<italic>x</italic>-axis</th>
<th align="center">
<italic>y</italic>-axis</th>
<th align="center">
<italic>z</italic>-axis</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td colspan="4" align="left">
<bold>Results for distal node</bold>
</td>
</tr>
<tr>
<td align="left">&#x2003;Proposed RNN-based model</td>
<td align="left">
<inline-formula id="inf175">
<mml:math id="minf175">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>1.27</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>0.23</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf176">
<mml:math id="minf176">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>4.69</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>1.27</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf177">
<mml:math id="minf177">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>0.60</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>0.10</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#x2003;Cosserat rod model</td>
<td align="left">
<inline-formula id="inf178">
<mml:math id="minf178">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>3.56</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>0.82</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf179">
<mml:math id="minf179">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>10.55</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>5.03</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf180">
<mml:math id="minf180">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>4.02</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>2.22</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td colspan="4" align="left">
<bold>Results for proximal node</bold>
</td>
</tr>
<tr>
<td align="left">&#x2003;Proposed RNN-based model</td>
<td align="left">
<inline-formula id="inf181">
<mml:math id="minf181">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>1.13</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>0.31</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf182">
<mml:math id="minf182">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>3.30</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>0.89</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf183">
<mml:math id="minf183">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>3.93</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>0.31</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">&#x2003;Cosserat rod model</td>
<td align="left">
<inline-formula id="inf184">
<mml:math id="minf184">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>1.55</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>0.36</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf185">
<mml:math id="minf185">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>7.22</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>3.51</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf186">
<mml:math id="minf186">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>3.29</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
<mml:mo>,</mml:mo>
<mml:mn>1.99</mml:mn>
<mml:mi mathvariant="normal">&#xb0;</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The computation time required to find a solution of the manipulator statics from a Boundary Value Problem (BVP) with Cosserat rod theory depends on the quality of the initial solution guess, i.e.,&#x20;<inline-formula id="inf187">
<mml:math id="minf187">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf188">
<mml:math id="minf188">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> at <inline-formula id="inf189">
<mml:math id="minf189">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>, the tolerable error (<inline-formula id="inf190">
<mml:math id="minf190">
<mml:mrow>
<mml:mi>E</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>&#x211d;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>), and the number of nodes (<inline-formula id="inf191">
<mml:math id="minf191">
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="normal">&#x2115;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>) used to discretize the manipulator.</p>
<p>A tolerable error describes the error between the distal internal forces and moments obtained from forward integration which are called <inline-formula id="inf192">
<mml:math id="minf192">
<mml:mrow>
<mml:msubsup>
<mml:mi>n</mml:mi>
<mml:mi>f</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf193">
<mml:math id="minf193">
<mml:mrow>
<mml:msubsup>
<mml:mi>m</mml:mi>
<mml:mi>f</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:math>
</inline-formula>, and distal boundary condition, i.e.,&#x20;<inline-formula id="inf194">
<mml:math id="minf194">
<mml:mrow>
<mml:msubsup>
<mml:mi>n</mml:mi>
<mml:mi>b</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf195">
<mml:math id="minf195">
<mml:mrow>
<mml:msubsup>
<mml:mi>m</mml:mi>
<mml:mi>b</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:math>
</inline-formula>. The tolerable error can be written as <inline-formula id="inf196">
<mml:math id="minf196">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msubsup>
<mml:mi>n</mml:mi>
<mml:mi>f</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mi>n</mml:mi>
<mml:mi>b</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
<mml:mo>,</mml:mo>
</mml:mrow>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:msubsup>
<mml:mi>m</mml:mi>
<mml:mi>f</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mi>m</mml:mi>
<mml:mi>b</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mo>&#x2264;</mml:mo>
<mml:mi>E</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>.</p>
<p>Decreasing the tolerable error increases the solution accuracy, but potentially requires more time to solve convex optimizations for the BVP. Increasing the number of nodes is necessary to describe complex manipulator geometries, but should be chosen to minimize the required steps during forward integration.</p>
<p>To visualize how the required computation time changes with the number of nodes and the tolerable error, multiple simulations were performed by assigning known torques <inline-formula id="inf197">
<mml:math id="minf197">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3c4;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> and forces <inline-formula id="inf198">
<mml:math id="minf198">
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> for <inline-formula id="inf199">
<mml:math id="minf199">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1,2</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula>, to the manipulator, and finding a valid solution from solving the BVP. Changes to tolerable errors (<italic>E</italic>) and number of nodes (<italic>N</italic>) were made manually. For example, an error of <inline-formula id="inf200">
<mml:math id="minf200">
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula> in the initial solution guess was obtained by multiplying the valid solution with 0.98. After each change the BVP was solved again fifty times. The obtained mean and standard deviation of the computation times are shown in <xref ref-type="fig" rid="F13">Figure&#x20;13</xref>. By taking into account all the aforementioned variables, i.e.,&#x20;number of nodes and the tolerable error, the Cosserat rod model is capable of achieving real-time performances of the bandwidths between 8.33 and 50&#xa0;Hz.</p>
<fig id="F13" position="float">
<label>FIGURE 13</label>
<caption>
<p>
<bold>(A)</bold>: Computation time required for solving a solution to the BVP changes with decreasing tolerable error <bold>(<italic>E</italic>)</bold> for a constant number of nodes. <bold>(B)</bold>: Computation time required for solving a solution to the BVP changes with an increasing number of nodes (<italic>N</italic>) and increasing percentage errors from a valid solution, for a constant tolerable&#x20;error.</p>
</caption>
<graphic xlink:href="frobt-08-631303-g013.tif"/>
</fig>
<p>
<xref ref-type="fig" rid="F13">Figure&#x20;13A</xref> shows how the computation time required for solving a solution to the BVP changes with decreasing tolerable error (<italic>E</italic>) and increasing percentage errors from a valid solution (at <inline-formula id="inf201">
<mml:math id="minf201">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mtext>%</mml:mtext>
</mml:mrow>
</mml:math>
</inline-formula>), for a constant number of nodes. Also, <xref ref-type="fig" rid="F13">Figure&#x20;13B</xref> shows how the computation time required for solving a solution to the BVP changes with an increasing number of nodes (<italic>N</italic>) and increasing percentage errors from a valid solution, for a constant tolerable error. However, It should be mentioned that the proposed RNN-based model shows a real-time performance with a bandwidth of 60.75&#xa0;Hz on average for the given architecture in <xref ref-type="fig" rid="F7">Figure&#x20;7</xref>, number of epochs &#x3d; 25, and batch size &#x3d; 1. In addition, <xref ref-type="fig" rid="F14">Figure&#x20;14A</xref> demonstrates the computation bandwidth required for the prediction of the next step using the trained model with a different number of LSTM units and a different size of time history horizons in Data-set IV. The figure suggests that computation bandwidths are fairly unchanged with the number of LSTM units; however, increasing the length of time history reduces bandwidth. The optimal region maximizing the bandwidth is approximately with time history size in <inline-formula id="inf202">
<mml:math id="minf202">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>2,20</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and LSTM unit size in <inline-formula id="inf203">
<mml:math id="minf203">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>5,15</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. <xref ref-type="fig" rid="F14">Figure&#x20;14B</xref> suggests that RMS error of the prediction decreases by increasing the number of LSTM units and the optimal area minimizing RMS errors is approximately with time history size in <inline-formula id="inf204">
<mml:math id="minf204">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>2,20</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and LSTM unit size in <inline-formula id="inf205">
<mml:math id="minf205">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>20,25</mml:mn>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>.</p>
<fig id="F14" position="float">
<label>FIGURE 14</label>
<caption>
<p>
<bold>(A)</bold>: Computation bandwidth (Hz) obtained with respect to different number of LSTM units and size of time history horizon (for number of epochs &#x3d; 25 and batch size &#x3d; 1). <bold>(B)</bold>: RMS Error (mm) of the prediction on Data-set IV using trained models with different number of LSTM units and size of time history horizons (for number of epochs &#x3d; 25 and batch size &#x3d; 1).</p>
</caption>
<graphic xlink:href="frobt-08-631303-g014.tif"/>
</fig>
<p>To sum up, this experiment demonstrates that not only can the presented RNN-based model outperform classical modeling approaches such as the Cosserat rod model, but also it shows possibilities to use the model in practice for closed-loop control applications.</p>
</sec>
<sec sec-type="discussion" id="s7">
<label>6</label>
<title>Discussion</title>
<p>This work suggests a distributed architecture for modeling complex dynamical systems by using multiple light-weight RNN-based models. As a result, the architecture would be easier to design and debug, and also benefits from faster convergence compared to one large network. Furthermore, large networks may take longer times to be trained, and they may not show an acceptable performance and readjusting (hyper-)parameters and restarting the training process might be necessary.</p>
<p>Increasing the size of history horizons in training stages may reduce the error to some extent, but on the other hand, it makes the model slower. Based on conventional dynamical models, the length of the history size should be at least 2. To reach a state-of-the-art performance, i.e.,&#x20;having less error and faster model simultaneously, one may prefer varied batch sizes in the training and run-time phases. As a suggestion, we can use different batch sizes for training and run-time stages. A model can be trained with appropriate batch sizes such that the model performance suits the given criteria. Afterward, one can create a new network with the pre-trained weights compiled with a batch size of&#x20;1.</p>
<p>The performance, i.e.,&#x20;the convergence and stability, of the presented algorithm in this paper, unlike conventional algorithms, is independent of the number of nodes considered for the whole manipulator. To be specific, in the analytical model, there might be a need for several discretization nodes to achieve a convergent solution with a specific tolerable error; however, in the RNN-based model, only specific points/points of interests (e.g., two actuation points in the experiment) are considered. In other words, in the experiment, 13 nodes (4 for each flexible subsection and two for each magnet, and 1 for the base) were chosen for solving the Cosserat rod model, but two nodes were selected for the RNN-based model. However, the complexity of dynamical systems (i.e.,&#x20;PDEs) affects the complexity of the architecture used in the RNN-based model, i.e.,&#x20;the number of layers and LSTM units and generally how deep the model is. Nevertheless, the suggested model suits parallel implementation and can benefit from a high bandwidth for closed-loop control applications. Furthermore, the architectures of the proposed RNN-based model can be optimized by reducing the number of layers and trainable parameters to maximize the achievable bandwidths.</p>
<p>The evaluations showed that incorporating poses of adjacent nodes and also wrenches as a separated input might help to have, to some extent, a generalizable model rather than just purely learning the structure of data. However, supervised learning methods likely tend to preserve structure of data, and these models might not entirely respect underlying physics (conservation laws). In other words, these methods might not be wholly physics-aware and applicable for untrained/unprecedented dynamics or geometries without any adjustment, re-training, or using techniques such as transfer learning, etc. One possible and interesting solution (<xref ref-type="bibr" rid="B21">Psichogios and Ungar, 1992</xref>; <xref ref-type="bibr" rid="B14">Lagaris et&#x20;al., 1998</xref>; <xref ref-type="bibr" rid="B22">Raissi et&#x20;al., 2019</xref>) to overcome this problem and move toward fully physics-aware neural networks is revisiting lost functions for the training process. To be specific, it is mentioned in Problem Statement Section that the idea is finding solutions for PDEs given in <xref ref-type="disp-formula" rid="e1">Eq. 1</xref>, i.e.,&#x20;<inline-formula id="inf206">
<mml:math id="minf206">
<mml:mrow>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf207">
<mml:math id="minf207">
<mml:mrow>
<mml:mi>&#x3d5;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> for sufficiently large number (e.g., <inline-formula id="inf208">
<mml:math id="minf208">
<mml:mrow>
<mml:msub>
<mml:mi>N</mml:mi>
<mml:mi>f</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>) of pair <inline-formula id="inf209">
<mml:math id="minf209">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>L</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#xd7;</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>T</mml:mi>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> in which <italic>L</italic> is the unreformed length of the manipulator and parameter <italic>T</italic> is a user-defined time. Considering <xref ref-type="disp-formula" rid="e1">Eq. 1</xref>, a neural network can be learned by minimizing the mean squared error loss<disp-formula id="equ4">
<mml:math>
<mml:mrow>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:msub>
<mml:mi>N</mml:mi>
<mml:mi>f</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfrac>
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:munderover>
<mml:mstyle displaystyle="true">
<mml:mo>&#x2211;</mml:mo>
</mml:mstyle>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>N</mml:mi>
<mml:mi>f</mml:mi>
</mml:msub>
</mml:mrow>
</mml:munderover>
<mml:msubsup>
<mml:mrow>
<mml:mrow>
<mml:mo>&#x2016;</mml:mo>
<mml:mrow>
<mml:mi>J</mml:mi>
<mml:msub>
<mml:mi>&#x3c9;</mml:mi>
<mml:mrow>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>&#x3c9;</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>J</mml:mi>
<mml:mi>&#x3c9;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>n</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:msup>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>&#x3d5;</mml:mi>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>m</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>m</mml:mi>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msup>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:mi>&#x3c4;</mml:mi>
</mml:mrow>
<mml:mo>&#x2016;</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo>{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mn>2</mml:mn>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:munderover>
<mml:mstyle displaystyle="true">
<mml:mo>&#x2211;</mml:mo>
</mml:mstyle>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>N</mml:mi>
<mml:mi>f</mml:mi>
</mml:msub>
</mml:mrow>
</mml:munderover>
<mml:msubsup>
<mml:mrow>
<mml:mrow>
<mml:mo>&#x2016;</mml:mo>
<mml:mrow>
<mml:mi>M</mml:mi>
<mml:msub>
<mml:mi>&#x3d5;</mml:mi>
<mml:mrow>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:msup>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msup>
<mml:msub>
<mml:mi>&#x39b;</mml:mi>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>n</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x39b;</mml:mi>
<mml:msub>
<mml:mi>n</mml:mi>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msup>
<mml:mi>f</mml:mi>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msup>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>f</mml:mi>
</mml:mrow>
<mml:mo>&#x2016;</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mrow>
<mml:mo>{</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>}</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mn>2</mml:mn>
</mml:msubsup>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:math>
</disp-formula>
</p>
<p>This modified loss function enforces the structure imposed by <xref ref-type="disp-formula" rid="e1">Eq. 1</xref> for large number (e.g., <inline-formula id="inf210">
<mml:math id="minf210">
<mml:mrow>
<mml:msub>
<mml:mi>N</mml:mi>
<mml:mi>f</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>) of pair <inline-formula id="inf211">
<mml:math id="minf211">
<mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>t</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>L</mml:mi>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#xd7;</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>T</mml:mi>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and the trained neural network will be aware of governing&#x20;PDEs.</p>
</sec>
<sec sec-type="conclusion" id="s8">
<label>7</label>
<title>Conclusion</title>
<p>This paper describes an approach for the real-time prediction of dynamics for general continuum soft manipulators, based on machine learning techniques and Lie group variational integration methods. Poses of a soft, polymer-based manipulator, in the presence of conservative and non-conservative wrenches, are predicted and validated experimentally. The comparison results of the proposed model and a well-known model for continuum manipulators, i.e.,&#x20;Cosserat rod theory, are also provided, revealing the practical effectiveness of the proposed model. The presented method can be extended to different soft robots with different shapes and materials. In addition, training of physics-aware neural networks for solving PDEs and the procedure of a model-based controller design are topics of research to be studied as future&#x20;work.</p>
</sec>
</body>
<back>
<sec id="s9">
<title>Data Availability Statement</title>
<p>The original contributions presented in the study are included in the article/Supplementary Material, further inquiries can be directed to the corresponding author.</p>
</sec>
<sec id="s10">
<title>Author Contributions</title>
<p>AT: Formal analysis, Visualization, Writing original draft, VV: Review and Editing, MR: Writing, Analysis, OE: Review and Editing, JT: Review and Editing, KM: Review and Editing, SM: Review, Editing, and Resources for experiment, &#xd8;M: Review and Editing.</p>
</sec>
<sec id="s11">
<title>Funding</title>
<p>This research has received funding from the European Research Council (ERC) under the European Union&#x2019;s Horizon 2020 Research and Innovation programme (Grant Agreement &#x23;866494 - project MAESTRO).</p>
</sec>
<sec sec-type="COI-statement" id="s12">
<title>Conflict of Interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<fn-group>
<fn id="fn1">
<label>1</label>
<p>For the details see <xref ref-type="bibr" rid="B4">Demoures et&#x20;al. (2015)</xref>.</p>
</fn>
<fn id="fn2">
<label>2</label>
<p>Dynamic equations are given in <xref ref-type="bibr" rid="B28">Tariverdi et&#x20;al. (2020)</xref>, Sec.&#x20;2.</p>
</fn>
</fn-group>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ansari</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Manti</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Falotico</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Mollard</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Cianchetti</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Laschi</surname>
<given-names>C.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Towards the development of a soft manipulator as an assistive robot for personal care of elderly people</article-title>. <source>Int. J.&#x20;Adv. Robot. Syst.</source> <volume>14</volume>, <fpage>172</fpage>. <pub-id pub-id-type="doi">10.1177/1729881416687132</pub-id> </citation>
</ref>
<ref id="B2">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Antman</surname>
<given-names>S. S.</given-names>
</name>
</person-group> (<year>1995</year>). &#x201c;<article-title>Nonlinear problems of elasticity</article-title>,&#x201d; in <source>Applied mathematical sciences</source>. Editors <person-group person-group-type="editor">
<name>
<surname>Marsden</surname>
<given-names>J.&#x20;E.</given-names>
</name>
<name>
<surname>Sirovich</surname>
<given-names>L.</given-names>
</name>
</person-group> (<publisher-loc>New York, United&#x20;States</publisher-loc>: <publisher-name>Springer</publisher-name>), <volume>Vol. 107</volume>. </citation>
</ref>
<ref id="B3">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Burgner</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Swaney</surname>
<given-names>P. J.</given-names>
</name>
<name>
<surname>Lathrop</surname>
<given-names>R. A.</given-names>
</name>
<name>
<surname>Weaver</surname>
<given-names>K. D.</given-names>
</name>
<name>
<surname>Webster</surname>
<given-names>R. J.</given-names>
</name>
</person-group> (<year>2013</year>). <article-title>Debulking from within: a robotic steerable cannula for intracerebral hemorrhage evacuation</article-title>. <source>IEEE Trans. Biomed. Eng.</source> <volume>60</volume>, <fpage>2567</fpage>&#x2013;<lpage>2575</lpage>. <pub-id pub-id-type="doi">10.1109/TBME.2013.2260860</pub-id> </citation>
</ref>
<ref id="B4">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Demoures</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Gay-Balmaz</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Leyendecker</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Ober-Bl&#xf6;baum</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Ratiu</surname>
<given-names>T. S.</given-names>
</name>
<name>
<surname>Weinand</surname>
<given-names>Y.</given-names>
</name>
</person-group> (<year>2015</year>). <article-title>Discrete variational Lie group formulation of geometrically exact beam dynamics</article-title>. <source>Numer. Math.</source> <volume>130</volume>, <fpage>73</fpage>&#x2013;<lpage>123</lpage>. <pub-id pub-id-type="doi">10.1007/s00211-014-0659-4</pub-id> </citation>
</ref>
<ref id="B5">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Edelmann</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Petruska</surname>
<given-names>A. J.</given-names>
</name>
<name>
<surname>Nelson</surname>
<given-names>B. J.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Magnetic control of continuum devices</article-title>. <source>Int. J.&#x20;Robot. Res.</source> <volume>36</volume>, <fpage>68</fpage>&#x2013;<lpage>85</lpage>. <pub-id pub-id-type="doi">10.1177/0278364916683443</pub-id> </citation>
</ref>
<ref id="B6">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Grady</surname>
<given-names>M. S.</given-names>
</name>
<name>
<surname>Howard</surname>
<given-names>M. A.</given-names>
</name>
<name>
<surname>Dacey</surname>
<given-names>R. G.</given-names>
</name>
<name>
<surname>Blume</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Lawson</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Werp</surname>
<given-names>P.</given-names>
</name>
<etal/>
</person-group> (<year>2000</year>). <article-title>Experimental study of the magnetic stereotaxis system for catheter manipulation within the brain</article-title>. <source>J.&#x20;Neurosurg.</source> <volume>93</volume>, <fpage>282</fpage>&#x2013;<lpage>288</lpage>. <pub-id pub-id-type="doi">10.3171/jns.2000.93.2.0282</pub-id> </citation>
</ref>
<ref id="B7">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Grazioso</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Di Gironimo</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Siciliano</surname>
<given-names>B.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>A geometrically exact model for soft continuum robots: the finite element deformation space formulation</article-title>. <source>Soft Robot.</source> <volume>6</volume>, <fpage>790</fpage>&#x2013;<lpage>811</lpage>. <pub-id pub-id-type="doi">10.1089/soro.2018.0047</pub-id> </citation>
</ref>
<ref id="B8">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hochreiter</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Schmidhuber</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>1997</year>). <article-title>Long short-term memory</article-title>. <source>Neural Comput.</source> <volume>9</volume>, <fpage>1735</fpage>&#x2013;<lpage>1780</lpage>. <pub-id pub-id-type="doi">10.1162/neco.1997.9.8.1735</pub-id> </citation>
</ref>
<ref id="B9">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hyatt</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Wingate</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Killpack</surname>
<given-names>M. D.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Model-based control of soft actuators using learned non-linear discrete-time models</article-title>. <source>Front. Robot. AI</source> <volume>6</volume>. <pub-id pub-id-type="doi">10.3389/frobt.2019.00022</pub-id> </citation>
</ref>
<ref id="B10">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Jones</surname>
<given-names>B. A.</given-names>
</name>
<name>
<surname>Gray</surname>
<given-names>R. L.</given-names>
</name>
<name>
<surname>Turlapati</surname>
<given-names>K.</given-names>
</name>
</person-group> (<year>2009</year>). &#x201c;<article-title>Three dimensional statics for continuum robotics</article-title>,&#x201d; in <conf-name>IEEE/RSJ International Conference on Intelligent Robots and Systems</conf-name>, <conf-loc>St Louis, United&#x20;States</conf-loc>, <conf-date>October 11&#x2013;15 2009</conf-date>.(<publisher-loc>New York, United&#x20;States</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>2659</fpage>&#x2013;<lpage>2664</lpage>. <pub-id pub-id-type="doi">10.1109/IROS.2009.5354199</pub-id> </citation>
</ref>
<ref id="B11">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Jung</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Penning</surname>
<given-names>R. S.</given-names>
</name>
<name>
<surname>Zinn</surname>
<given-names>M. R.</given-names>
</name>
</person-group> (<year>2014</year>). <article-title>A modeling approach for robotic catheters: effects of nonlinear internal device friction</article-title>. <source>Adv. Robot.</source> <volume>28</volume>, <fpage>557</fpage>&#x2013;<lpage>572</lpage>. <pub-id pub-id-type="doi">10.1080/01691864.2013.879371</pub-id> </citation>
</ref>
<ref id="B12">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Katzschmann</surname>
<given-names>R. K.</given-names>
</name>
<name>
<surname>Marchese</surname>
<given-names>A. D.</given-names>
</name>
<name>
<surname>Rus</surname>
<given-names>D.</given-names>
</name>
</person-group> (<year>2015</year>). <article-title>Autonomous object manipulation using a soft planar grasping manipulator</article-title>. <source>Soft Robot.</source> <volume>2</volume>, <fpage>155</fpage>&#x2013;<lpage>164</lpage>. <pub-id pub-id-type="doi">10.1089/soro.2015.0013</pub-id> </citation>
</ref>
<ref id="B13">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Kesner</surname>
<given-names>S. B.</given-names>
</name>
<name>
<surname>Howe</surname>
<given-names>R. D.</given-names>
</name>
</person-group> (<year>2011</year>). <article-title>Position control of motion compensation cardiac catheters</article-title>. <source>IEEE Trans. Robot.</source> <volume>27</volume>, <fpage>1045</fpage>&#x2013;<lpage>1055</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2011.2160467</pub-id> </citation>
</ref>
<ref id="B14">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lagaris</surname>
<given-names>I. E.</given-names>
</name>
<name>
<surname>Likas</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Fotiadis</surname>
<given-names>D. I.</given-names>
</name>
</person-group> (<year>1998</year>). <article-title>Artificial neural networks for solving ordinary and partial differential equations</article-title>. <source>IEEE Trans. Neural Netw.</source> <volume>9</volume>, <fpage>987</fpage>&#x2013;<lpage>1000</lpage>. <pub-id pub-id-type="doi">10.1109/72.712178</pub-id> </citation>
</ref>
<ref id="B15">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lee</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Kang</surname>
<given-names>I. S.</given-names>
</name>
</person-group> (<year>1990</year>). <article-title>Neural algorithm for solving differential equations</article-title>. <source>J.&#x20;Comput. Phys.</source> <volume>91</volume>, <fpage>110</fpage>&#x2013;<lpage>131</lpage>. <pub-id pub-id-type="doi">10.1016/0021-9991(90)90007-N</pub-id> </citation>
</ref>
<ref id="B16">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Mahvash</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Dupont</surname>
<given-names>P. E.</given-names>
</name>
</person-group> (<year>2011</year>). <article-title>Stiffness control of surgical continuum manipulators</article-title>. <source>IEEE Trans. Robot.</source> <volume>27</volume>, <fpage>334</fpage>&#x2013;<lpage>345</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2011.2105410</pub-id> </citation>
</ref>
<ref id="B17">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Marban</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Srinivasan</surname>
<given-names>V.</given-names>
</name>
<name>
<surname>Samek</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Fern&#xe1;ndez</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Casals</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>A recurrent convolutional neural network approach for sensorless force estimation in robotic surgery</article-title>. <source>Biomed. Signal Process. Control.</source> <volume>50</volume>, <fpage>134</fpage>&#x2013;<lpage>150</lpage>. <pub-id pub-id-type="doi">10.1016/j.bspc.2019.01.011</pub-id> </citation>
</ref>
<ref id="B18">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>McMahan</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Chitrakaran</surname>
<given-names>V.</given-names>
</name>
<name>
<surname>Csencsits</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Dawson</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Walker</surname>
<given-names>I. D.</given-names>
</name>
<name>
<surname>Jones</surname>
<given-names>B. A.</given-names>
</name>
<etal/>
</person-group> (<year>2006</year>). &#x201c;<article-title>Field trials and testing of the OctArm continuum manipulator</article-title>,&#x201d; in <conf-name>Proceedings 2006 IEEE International Conference on Robotics and Automation</conf-name>, <conf-loc>Orlando, United&#x20;States</conf-loc>, <conf-date>May 15&#x2013;19 2006</conf-date> (<publisher-loc>New York, United&#x20;States</publisher-loc>: <publisher-name>IEEE)</publisher-name>, <fpage>2336</fpage>&#x2013;<lpage>2341</lpage>. <pub-id pub-id-type="doi">10.1109/ROBOT.2006.1642051</pub-id> </citation>
</ref>
<ref id="B19">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Pai</surname>
<given-names>D. K.</given-names>
</name>
</person-group> (<year>2002</year>). <article-title>Strands: interactive simulation of thin solids using cosserat models</article-title>. <source>Comput. Graph. Forum</source> <volume>21</volume>, <fpage>347</fpage>&#x2013;<lpage>352</lpage>. <pub-id pub-id-type="doi">10.1111/1467-8659.00594</pub-id> </citation>
</ref>
<ref id="B20">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Petruska</surname>
<given-names>A. J.</given-names>
</name>
<name>
<surname>Nelson</surname>
<given-names>B. J.</given-names>
</name>
</person-group> (<year>2015</year>). <article-title>Minimum bounds on the number of electromagnets required for remote magnetic manipulation</article-title>. <source>IEEE Trans. Robot.</source> <volume>31</volume>, <fpage>714</fpage>&#x2013;<lpage>722</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2015.2424051</pub-id> </citation>
</ref>
<ref id="B21">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Psichogios</surname>
<given-names>D. C.</given-names>
</name>
<name>
<surname>Ungar</surname>
<given-names>L. H.</given-names>
</name>
</person-group> (<year>1992</year>). <article-title>A hybrid neural network-first principles approach to process modeling</article-title>. <source>AIChE J.</source> <volume>38</volume>, <fpage>1499</fpage>&#x2013;<lpage>1511</lpage>. <pub-id pub-id-type="doi">10.1002/aic.690381003</pub-id> </citation>
</ref>
<ref id="B22">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Raissi</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Perdikaris</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Karniadakis</surname>
<given-names>G. E.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Physics-informed neural networks: a deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations</article-title>. <source>J.&#x20;Comput. Phys.</source> <volume>378</volume>, <fpage>686</fpage>&#x2013;<lpage>707</lpage>. <pub-id pub-id-type="doi">10.1016/j.jcp.2018.10.045</pub-id> </citation>
</ref>
<ref id="B23">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Rucker</surname>
<given-names>D. C.</given-names>
</name>
<name>
<surname>Webster III</surname>
<given-names>R. J.</given-names>
</name>
</person-group> (<year>2011</year>). <article-title>Statics and dynamics of continuum robots with general tendon routing and external loading</article-title>. <source>IEEE Trans. Robot.</source> <volume>27</volume>, <fpage>1033</fpage>&#x2013;<lpage>1044</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2011.2160469</pub-id> </citation>
</ref>
<ref id="B24">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Sadati</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Shiva</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Elnaz Naghibi</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Rucker</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Renson</surname>
<given-names>L.</given-names>
</name>
<name>
<surname>Bergeles</surname>
<given-names>C.</given-names>
</name>
<etal/>
</person-group> (<year>2019</year>). &#x201c;<article-title>Reduced order vs. Discretized lumped system models with absolute and relative states for continuum manipulators</article-title>,&#x201d; in <conf-name>Robotics: Science and Systems XV (Robotics: Science and Systems Foundation)</conf-name>, <conf-loc>Freiburg im Breisgau, Germany</conf-loc>, <conf-date>June 22&#x2013;26 2019</conf-date>. <pub-id pub-id-type="doi">10.15607/RSS.2019.XV.076</pub-id> </citation>
</ref>
<ref id="B25">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Sikorski</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Dawson</surname>
<given-names>I.</given-names>
</name>
<name>
<surname>Denasi</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Hekman</surname>
<given-names>E. E. G.</given-names>
</name>
<name>
<surname>Misra</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2017</year>). &#x201c;<article-title>Introducing BigMag&#x2014;a novel system for 3D magnetic actuation of flexible surgical manipulators</article-title>,&#x201d; in <conf-name>IEEE International Conference on Robotics and Automation (ICRA)</conf-name>, <comment>Marina Bay Sands Singapore</comment>, <conf-date>May 29, 2017</conf-date> <publisher-loc>(Singapore</publisher-loc>: <publisher-name>IEEE</publisher-name>), <fpage>3594</fpage>&#x2013;<lpage>3599</lpage>. <pub-id pub-id-type="doi">10.1109/ICRA.2017.7989413</pub-id> </citation>
</ref>
<ref id="B26">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Sikorski</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Denasi</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Bucchi</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Scheggi</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Misra</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Vision-based 3-D control of magnetically actuated catheter using BigMag-an array of mobile electromagnetic coils</article-title>. <source>IEEE/ASME Trans. Mechatron.</source> <volume>24</volume>, <fpage>505</fpage>&#x2013;<lpage>516</lpage>. <pub-id pub-id-type="doi">10.1109/tmech.2019.2893166</pub-id> </citation>
</ref>
<ref id="B27">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Simaan</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Taylor</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Flint</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2004</year>). &#x201c;<article-title>A dexterous system for laryngeal surgery</article-title>,&#x201d; in <conf-name>IEEE International Conference on Robotics and Automation, 2004. Proceedings. ICRA &#x2019;04</conf-name>, <conf-loc>New Orleans, LA, USA</conf-loc>, <conf-date>April 26&#x2013;May 1, 2004</conf-date>. <fpage>351</fpage>&#x2013;<lpage>357</lpage>. <pub-id pub-id-type="doi">10.1109/ROBOT.2004.1307175</pub-id> </citation>
</ref>
<ref id="B28">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Tariverdi</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Venkiteswaran</surname>
<given-names>V. K.</given-names>
</name>
<name>
<surname>Martinsen</surname>
<given-names>&#xd8;. G.</given-names>
</name>
<name>
<surname>Elle</surname>
<given-names>O. J.</given-names>
</name>
<name>
<surname>T&#xf8;rresen</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Misra</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Dynamic modeling of soft continuum manipulators using lie group variational integration</article-title>. <source>Plos One</source> <volume>15</volume>, <fpage>e0236121</fpage>. <pub-id pub-id-type="doi">10.1371/journal.pone.0236121</pub-id> </citation>
</ref>
<ref id="B29">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Thuruthel</surname>
<given-names>T. G.</given-names>
</name>
<name>
<surname>Falotico</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Renda</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Laschi</surname>
<given-names>C.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Learning dynamic models for open loop predictive control of soft robotic manipulators</article-title>. <source>Bioinspir. Biomim.</source> <volume>12</volume>, <fpage>066003</fpage>. <pub-id pub-id-type="doi">10.1088/1748-3190/aa839f</pub-id> </citation>
</ref>
<ref id="B30">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Thuruthel</surname>
<given-names>T. G.</given-names>
</name>
<name>
<surname>Shih</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Laschi</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Tolley</surname>
<given-names>M. T.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Soft robot perception using embedded soft sensors and recurrent neural networks</article-title>. <source>Sci. Robot.</source> <volume>4</volume>, <fpage>eaav1488</fpage>. <pub-id pub-id-type="doi">10.1126/scirobotics.aav1488</pub-id> </citation>
</ref>
<ref id="B31">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Till</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Aloi</surname>
<given-names>V.</given-names>
</name>
<name>
<surname>Rucker</surname>
<given-names>C.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Real-time dynamics of soft and continuum robots based on Cosserat rod models</article-title>. <source>Int. J.&#x20;Robot. Res.</source> <volume>38</volume>, <fpage>723</fpage>&#x2013;<lpage>746</lpage>. <pub-id pub-id-type="doi">10.1177/0278364919842269</pub-id> </citation>
</ref>
<ref id="B32">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Turan</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Almalioglu</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Araujo</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Konukoglu</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Sitti</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2018</year>). <article-title>Deep EndoVO: a recurrent convolutional neural network (RCNN) based visual odometry approach for endoscopic capsule robots</article-title>. <source>Neurocomputing</source> <volume>275</volume>, <fpage>1861</fpage>&#x2013;<lpage>1870</lpage>. <pub-id pub-id-type="doi">10.1016/j.neucom.2017.10.014</pub-id> </citation>
</ref>
<ref id="B33">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Weinan</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Han</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Jentzen</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Deep learning-based numerical methods for high-dimensional parabolic partial differential equations and backward stochastic differential equations</article-title>. <source>Commun. Math. Stat.</source> <volume>5</volume>, <fpage>349</fpage>. <pub-id pub-id-type="doi">10.1007/s40304-017-0117-6</pub-id> </citation>
</ref>
<ref id="B34">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Wen</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Wan</surname>
<given-names>T. R.</given-names>
</name>
<name>
<surname>Gould</surname>
<given-names>D. A.</given-names>
</name>
<name>
<surname>John</surname>
<given-names>N. W.</given-names>
</name>
</person-group> (<year>2012</year>). <article-title>Thien HowA stable and real-time nonlinear elastic approach to simulating guidewire and catheter insertions based on cosserat rod</article-title>. <source>IEEE Trans. Biomed. Eng.</source> <volume>59</volume>, <fpage>2211</fpage>&#x2013;<lpage>2218</lpage>. <pub-id pub-id-type="doi">10.1109/TBME.2012.2199319</pub-id> </citation>
</ref>
<ref id="B35">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Xu</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Simaan</surname>
<given-names>N.</given-names>
</name>
</person-group> (<year>2010</year>). <article-title>Intrinsic wrench estimation and its performance index for multisegment continuum robots</article-title>. <source>IEEE Trans. Robot.</source> <volume>26</volume>, <fpage>555</fpage>&#x2013;<lpage>561</lpage>. <pub-id pub-id-type="doi">10.1109/TRO.2010.2046924</pub-id> </citation>
</ref>
</ref-list>
<app-group>
<app id="app1">
<title>Appendix: Cosserat Rod Theory</title>
<p>The Cosserat rod model of the manipulator assigns a position <inline-formula id="inf212">
<mml:math id="minf212">
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>, orientation quaternion <inline-formula id="inf213">
<mml:math id="minf213">
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>q</mml:mi>
<mml:mi>r</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>q</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>4</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>, internal force <inline-formula id="inf214">
<mml:math id="minf214">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>, and internal moment <inline-formula id="inf215">
<mml:math id="minf215">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> to a material cross-section at centerline position <inline-formula id="inf216">
<mml:math id="minf216">
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mi>L</mml:mi>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>, where <inline-formula id="inf217">
<mml:math id="minf217">
<mml:mrow>
<mml:mi>L</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi mathvariant="normal">&#x211d;</mml:mi>
<mml:mo>&#x2b;</mml:mo>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> is the length of the manipulator, giving a material state vector <inline-formula id="inf218">
<mml:math id="minf218">
<mml:mrow>
<mml:mi>y</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msup>
<mml:mi>p</mml:mi>
<mml:mi>T</mml:mi>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mi>q</mml:mi>
<mml:mi>T</mml:mi>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mi>n</mml:mi>
<mml:mi>T</mml:mi>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:msup>
<mml:mi>m</mml:mi>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>. A set of thirteen ordinary differential equations describe how the state vector evolves between centerline positions (<xref ref-type="bibr" rid="B5">Edelmann et&#x20;al., 2017</xref>)<disp-formula id="equ5">
<mml:math id="mequ5">
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:mi>p</mml:mi>
<mml:mo>&#x27;</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mi>R</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>q</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mi>v</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mi>q</mml:mi>
<mml:mo>&#x27;</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mn>2</mml:mn>
</mml:mfrac>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mtable>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mi>q</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>T</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msub>
<mml:mi>q</mml:mi>
<mml:mi>r</mml:mi>
</mml:msub>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mn>3</mml:mn>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:msub>
<mml:mi>q</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:mo>&#xd7;</mml:mo>
</mml:msub>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:mi>R</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>q</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mi>u</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mi>n</mml:mi>
<mml:mo>&#x27;</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>f</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mi>m</mml:mi>
<mml:mo>&#x27;</mml:mo>
<mml:mo>&#x3d;</mml:mo>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>p</mml:mi>
<mml:mo>&#x27;</mml:mo>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>n</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x3c4;</mml:mi>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mi>v</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mi>K</mml:mi>
<mml:mi>s</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mi>R</mml:mi>
<mml:msup>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>q</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
<mml:mi>n</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mrow>
<mml:mover accent="true">
<mml:mi>v</mml:mi>
<mml:mo>&#x5e;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mi>u</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mi>K</mml:mi>
<mml:mi>b</mml:mi>
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mi>R</mml:mi>
<mml:msup>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>q</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
<mml:mi>m</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mrow>
<mml:mover accent="true">
<mml:mi>u</mml:mi>
<mml:mo>&#x5e;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mo>,</mml:mo>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:math>
</disp-formula>where <inline-formula id="inf219">
<mml:math id="minf219">
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mo>&#x27;</mml:mo>
<mml:mo>&#x2261;</mml:mo>
<mml:msub>
<mml:mo>&#x2202;</mml:mo>
<mml:mi>s</mml:mi>
</mml:msub>
<mml:mi>p</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>, <inline-formula id="inf220">
<mml:math id="minf220">
<mml:mrow>
<mml:msub>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mo>&#x22c5;</mml:mo>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mo>&#xd7;</mml:mo>
</mml:msub>
<mml:mo>:</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
<mml:mo>&#x2192;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> a mapping to a skew-symmetric matrix, <inline-formula id="inf221">
<mml:math id="minf221">
<mml:mrow>
<mml:mi>R</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>q</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:mi>S</mml:mi>
<mml:mi>O</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mn>3</mml:mn>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> the rotation matrix associated with orientation quaternion <inline-formula id="inf222">
<mml:math id="minf222">
<mml:mi>q</mml:mi>
</mml:math>
</inline-formula>, <inline-formula id="inf223">
<mml:math id="minf223">
<mml:mrow>
<mml:msub>
<mml:mi>K</mml:mi>
<mml:mi>s</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>K</mml:mi>
<mml:mi>b</mml:mi>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> diagonal shear and bending stiffness matrices, <inline-formula id="inf224">
<mml:math id="minf224">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mn>3</mml:mn>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mrow>
<mml:mn>3</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>3</mml:mn>
</mml:mrow>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> a unit matrix, <inline-formula id="inf225">
<mml:math id="minf225">
<mml:mrow>
<mml:mi>v</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf226">
<mml:math id="minf226">
<mml:mrow>
<mml:mi>u</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> the material strain and bending, and <inline-formula id="inf227">
<mml:math id="minf227">
<mml:mrow>
<mml:mrow>
<mml:mover accent="true">
<mml:mi>v</mml:mi>
<mml:mo>&#x5e;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mn>0,0,1</mml:mn>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf228">
<mml:math id="minf228">
<mml:mrow>
<mml:mrow>
<mml:mover accent="true">
<mml:mi>u</mml:mi>
<mml:mo>&#x5e;</mml:mo>
</mml:mover>
</mml:mrow>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:mn>0,0,0</mml:mn>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> the intrinsic material strain and curvature. External forces <inline-formula id="inf229">
<mml:math id="minf229">
<mml:mrow>
<mml:mi>f</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> and torques <inline-formula id="inf230">
<mml:math id="minf230">
<mml:mrow>
<mml:mi>&#x3c4;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mi>s</mml:mi>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi>&#x211d;</mml:mi>
<mml:mn>3</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> determine the shape of the manipulator (<xref ref-type="bibr" rid="B2">Antman, 1995</xref>; <xref ref-type="bibr" rid="B23">Rucker and Webster, 2011</xref>). The manipulator is subject to a distributed gravity force (not shown in <xref ref-type="fig" rid="F9">Figure&#x20;9</xref>) and magnetically exerted distributed forces <inline-formula id="inf231">
<mml:math id="minf231">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold-italic">f</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> and torques <inline-formula id="inf232">
<mml:math id="minf232">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3c4;</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> due to interaction of the magnets with the magnetic field <inline-formula id="inf233">
<mml:math id="minf233">
<mml:mrow>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>m</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, where <inline-formula id="inf234">
<mml:math id="minf234">
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1,2</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> denotes the magnet index from the base of manipulator. Given the exerted torques and forces, the shape of the manipulator is solved as a Boundary Value Problem (BVP). The base of the manipulator is fixed to a rigid base with constant position <inline-formula id="inf235">
<mml:math id="minf235">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mn>0</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> and orientation <inline-formula id="inf236">
<mml:math id="minf236">
<mml:mrow>
<mml:msub>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, and its distal tip is free with constant internal force <inline-formula id="inf237">
<mml:math id="minf237">
<mml:mrow>
<mml:msubsup>
<mml:mi>n</mml:mi>
<mml:mi>L</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:math>
</inline-formula> and moment <inline-formula id="inf238">
<mml:math id="minf238">
<mml:mrow>
<mml:msubsup>
<mml:mi>m</mml:mi>
<mml:mi>L</mml:mi>
<mml:mi>d</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:math>
</inline-formula>. The proximal and distal boundary conditions are then formulated as follows, assuming no tip wrench, we have <inline-formula id="inf239">
<mml:math id="minf239">
<mml:mrow>
<mml:mi mathvariant="normal">&#x2119;</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mn>0</mml:mn>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msubsup>
<mml:mi>p</mml:mi>
<mml:mn>0</mml:mn>
<mml:mi>T</mml:mi>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mi>q</mml:mi>
<mml:mn>0</mml:mn>
<mml:mi>T</mml:mi>
</mml:msubsup>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf240">
<mml:math id="minf240">
<mml:mrow>
<mml:mi mathvariant="script">D</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>L</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:mrow>
<mml:msubsup>
<mml:mi>n</mml:mi>
<mml:mi>L</mml:mi>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>T</mml:mi>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mi>m</mml:mi>
<mml:mi>L</mml:mi>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>T</mml:mi>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
<mml:mo>]</mml:mo>
</mml:mrow>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>0.</mml:mn>
</mml:mrow>
</mml:math>
</inline-formula> The BVP is solved with a forward integration using an explicit Runge&#x2013;Kutta fourth order method, and convex optimization using Levenberg&#x2013;Marquardt (<xref ref-type="bibr" rid="B31">Till et&#x20;al., 2019</xref>). The unknown proximal state parameters <inline-formula id="inf241">
<mml:math id="minf241">
<mml:mrow>
<mml:mi>&#x3be;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msup>
<mml:mrow>
<mml:mo>[</mml:mo>
<mml:msubsup>
<mml:mi>n</mml:mi>
<mml:mn>0</mml:mn>
<mml:mi>T</mml:mi>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>m</mml:mi>
<mml:mn>0</mml:mn>
</mml:msub>
<mml:mo>]</mml:mo>
</mml:mrow>
<mml:mi>T</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula> are guessed and subject to the optimization where <inline-formula id="inf242">
<mml:math id="minf242">
<mml:mrow>
<mml:mi>N</mml:mi>
<mml:mo>&#x2208;</mml:mo>
<mml:mi mathvariant="normal">&#x2115;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> is the number of discrete steps along <italic>s</italic>. Then <inline-formula id="inf243">
<mml:math id="minf243">
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>N</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> are the manipulator distal state parameters obtained from the forward integration using an explicit Runge&#x2013;Kutta fourth order method. The error between desired distal boundary condition <inline-formula id="inf244">
<mml:math id="minf244">
<mml:mrow>
<mml:mi mathvariant="script">D</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>L</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf245">
<mml:math id="minf245">
<mml:mrow>
<mml:mi mathvariant="script">D</mml:mi>
<mml:mrow>
<mml:mo>(</mml:mo>
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>N</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mo>)</mml:mo>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> determines if the solution (<inline-formula id="inf246">
<mml:math id="minf246">
<mml:mi>&#x3be;</mml:mi>
</mml:math>
</inline-formula>) is accepted.</p>
</app>
</app-group>
</back>
</article>