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!