Numerical solution to coupled non linear differential equations
3 views (last 30 days)
Show older comments
Consider coupled robot dynamic equations for robots with joint stiffness:
M(q)q_pd + V(q,q_p) + G(q) = K(theta-q)
J*theta_pd = Tm - K(theta-q);
describing a 3DOF robot, Im intrested in determing the angular positions,velocities and accelarations of the links and the motors given the Tm or torque to motors. How can ODEs be used for the same.
2 Comments
Steven Lord
on 25 Feb 2025
What difficulties are you having solving these differential equations? If you're not sure how to use the ODE solvers or how to set up the functions necessary to use the ODE solvers, I suggest trying out the Solve ODE live editor task. This allows you to select the equation that looks like the system of ODEs that you're trying to solve (in this case, since your mass matrix only depends on the "time" variable q, that would be the third button.) Then you can ask MATLAB to create template local functions that you can fill in to define the mass matrix function and the ODE function.
James Tursa
on 25 Feb 2025
@Atharv Instead of the text version of the differential equations you posted, it would be easier for the readers if you simply posted an image of the differential equations.
Answers (1)
Sam Chak
on 25 Feb 2025
Edited: Sam Chak
on 25 Feb 2025
Hi @Atharv
Although I don't understand your robotic dynamics, but based on your ODEs, I see that
is present in the highest order derivative. Therefore, you need to specify the mass matrix in the odeset() function and declare it as a state-dependent mass matrix using the Name=Value structure, such as MStateDependence='strong' or MStateDependence='weak', as part of the options structure for the ode45() solver.

0 Comments
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!