Simscape: The derivative of position in a direction not equal to the velocity

6 views (last 30 days)
I am using simmechanics 2g to simulate a robot. On one of the points on the robot, the velocity (plotted using scope) in the horizontal-x direction does not match the time-derivative of the position. This seems to defy my understanding of Newtonian Mechanics. Has somebody faced similar situations or know why this problem arises?
Note: There are no external forces provided in the horizontal direction although there is one provided in the vertical direction.
  2 Comments
Rebecca Krosnick
Rebecca Krosnick on 23 Dec 2015
What equations and blocks are you using to generate the time-derivative of the position and the velocity? Can you also provide screenshots of the scope plots?
Sarvesh Srinivasan
Sarvesh Srinivasan on 24 Dec 2015
Here's how the model looks (the three-port subsystems have been set to zero, thus having no external force in the x-direction). The gravity's in the y direction. The scope on the left (scope3) calculates the difference between v_x and the time derivative of x.
The scope graphs this out. Despite it being less 1, it's still a significant difference.
I would be thankful for any explanations given for this observation.

Sign in to comment.

Answers (1)

Sebastian Castro
Sebastian Castro on 25 Dec 2015
In general, I wouldn't trust the Derivative block's results very much. This block only does an approximate derivative of a signal, which is highly dependent on the simulation step-size taken, and has no continuous states or error control.
Some useful links:
Try doing it the opposite way: Use an Integrator block on the velocity signal and compare it to the position. This will likely look a lot better.
- Sebastian
  4 Comments
Sarvesh Srinivasan
Sarvesh Srinivasan on 27 Dec 2015
Thanks for the suggestion, but the results are the same regardless of the ode solver I use, and this includes even fixed-step solvers. Any other suggestions to proceed?
Also, thanks for helping through this even in the holiday season. Really appreciate it :)
Sebastian Castro
Sebastian Castro on 28 Dec 2015
Hmm... It could also be the Max step size parameter in the same solver settings. You could try reducing it and seeing what happens.
- Sebastian

Sign in to comment.

Categories

Find more on Simulation and Analysis 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!