# I want to simulate the behaviour of a 2-DOF robotic manipulator, which is described by the following

Sonia Gay 2022-06-23 Answered
I want to simulate the behaviour of a 2-DOF robotic manipulator, which is described by the following model:

Considering the fact that the 2x2 mass matrix M is positive definite, I could use the inverse matrix and break down the problem into the 4 first order ordinary differential equations and simulate it:
${x}_{1}={q}_{1}⇒\stackrel{˙}{{x}_{1}}={x}_{2}$
${x}_{2}=\stackrel{˙}{{q}_{1}}⇒\stackrel{˙}{{x}_{2}}=-{M}^{-1}\left(1,:\right)\cdot C\cdot {\left[\begin{array}{cc}{x}_{2}& {x}_{4}\end{array}\right]}^{T}-{M}^{-1}\left(1,:\right)\cdot G+{M}^{-1}\left(1,:\right)\cdot \tau$${x}_{3}={q}_{2}⇒\stackrel{˙}{{x}_{3}}={x}_{4}$
${x}_{4}=\stackrel{˙}{{q}_{2}}⇒\stackrel{˙}{{x}_{4}}=-{M}^{-1}\left(2,:\right)\cdot C\cdot {\left[\begin{array}{cc}{x}_{2}& {x}_{4}\end{array}\right]}^{T}-{M}^{-1}\left(2,:\right)\cdot G+{M}^{-1}\left(2,:\right)\cdot \tau$
Suppose I would like to use a solver that takes as an argument the mass matrix (a MATLAB ODE solver in particular) and don't use its inverse because this will also simplify the computation of the jacobian (I intend to simulate a 7-DOF robotic manipulator after that so providing the mass matrix would be great). How can I write the initial equation (1) as a series of first order ordinary differential equations and be able to simulate its response by using some software solvers ?
You can still ask an expert for help

• Live experts 24/7
• Questions are typically answered in as fast as 30 minutes
• Personalized clear answers

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

britspears523jp
Let us choose $\eta ={\left[\begin{array}{cc}q& \stackrel{˙}{q}\end{array}\right]}^{\mathrm{\top }}$ . Then
$\left[\begin{array}{cc}I& 0\\ 0& M\left(q\right)\end{array}\right]\stackrel{˙}{\eta }=\left[\begin{array}{cc}0& I\\ 0& -C\left(q,\stackrel{˙}{q}\right)\end{array}\right]\eta +\left[\begin{array}{c}0\\ -G\left(q\right)+\tau \end{array}\right].$