Incorrect extreme values of numerical derivative
2 ビュー (過去 30 日間)
古いコメントを表示
Hi!
I get different plots from Matlab and SolidWorks. Can anyone check mye code/help with ideas? :)
Disclaimer: I can not guarantee my work in SolidWorks is correct.
Background:
This is part of a kinematic analasys of a mechanism. I am to do a numerical analasys of a point of interest and also simulate the mechanism (in my case in SolidWorks). My pont of interest has one-dimentional movement. I use Matlab to calculate the velocity of my point.
Problem:
The velocity (in regards to time) is very similar for SolidWorks and Matlab.
The acceleration plot however is what i am struggelig with. The graph has the same shape, but Matlab gives the same extreme values in positive and negative. SolidWorks does not. I expect different values (but i may be incorrect).
This is is the "original" matlab plot (array from kinematic calculations). It is an array of numerical values (from a for-loop). These look very similar,

Then I try to find the acceleration by taking the derivative of the speed-plot (or more accurate: the array).
Code:
dydx = gradient(array(:)) ./ gradient(t_span(:));
plot(t_span,dydx,'--')
Result:

As you can see, they look very similar, but the extreme values are different.
EDIT: the matlab plots have extreme values: -1202.42418329735, +1202.42418329735.
I use Matlab R2019b
I am a beginner user of Matlab.
In advance, thanks!
(my first post here. Please let me know if I need to change anything)
0 件のコメント
回答 (1 件)
Juan Sagarduy
2020 年 11 月 25 日
Hi Jörgen It looks like the kinematic motion in MATLAB is somehow idealized. The one from SolidWorks is asymmetric and thus shows a different acceleration. Is the result for MATLAB obtained with an imported CAD model with Simscape Multibody? Br Juan
参考
カテゴリ
Help Center および File Exchange で Time and Frequency Domain Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!