Pedro Vilas-Boas on 23 Apr 2016
-
-
Link
Direct link to this question
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve
Commented: Pedro Vilas-Boas on 24 Apr 2016
Accepted Answer: Image Analyst
Hello you all,
so i have this project im working on where i have several angles measured with a robot's head.
I did the polyfit function to find a curve and see how this measurements behave with distance.
Now i want to compare this last curve with the expected curve i am suppose to get:
Of course the practical curve doesn't exactly fit the theoretical one because the measurement process has too much error but especially in the beginning of the practical curve it s possible to see some oscillations which i think are the equivalent of the steps in the theoretical one.
So i want to find some way of knowing where exactly in the practical curve those small oscillations peak.
I tried checking the first derivative but i couldn't get the points because the first derivative is almost always negative.
Another approach i tried to make is to see the variation of the first derivative, but also couldn't get anywhere.
Anyone has any idea how to solve this?
8 Comments Show 6 older commentsHide 6 older comments
Show 6 older commentsHide 6 older comments
Star Strider on 23 Apr 2016
Direct link to this comment
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve#comment_361132
It’s obvious that you need more data, or a definitive mathematical model of the robot head movement that you can fit to the data you have.
If you were to take only the values of a parabola described by ‘f(x)=x^2’ on the ‘x’ interval (-4,-3), you would assume it goes to -Inf even though you know it has a minimum at ‘x=0’. With more data, or a mathematical description of the function to which you can fit your data, you could determine the minimum (assuming one exists).
Pedro Vilas-Boas on 23 Apr 2016
Direct link to this comment
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve#comment_361140
Edited: Pedro Vilas-Boas on 23 Apr 2016
The mathematical model of the robot head is pretty simple. The robot head are 8 photodiodes aligned in 8 different angles, from around 18º to 90º. The robot's head will receive light in max 2 photodiodes and will calculate the angle with which the light is received with a weighted average: sum(angle_of_photodiode*power)/sum(power) Thats why the theoretical curve is a step curve.
Star Strider on 23 Apr 2016
Direct link to this comment
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve#comment_361146
That really isn’t the sort of model I was hoping for.
You need a model that incorporates the motion of the robot head on any trajectory it could possibly take, and then use that information. Even if had three degrees-of-freedom on the interval (0,2*pi) in each (and I would guess that it does not), it would have some sort of limits that you would incorporate in your model.
Pedro Vilas-Boas on 23 Apr 2016
Direct link to this comment
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve#comment_361149
You can assume that the head of the robot is always perfectly aligned with the receiving light. The raw data is the result of several static measurements. So i don't understand why it is needed to incorporate the motion in the model.
Star Strider on 23 Apr 2016
Direct link to this comment
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve#comment_361152
I really can’t assume anything, because I don’t know anything about your experiment.
You imply that the light is then on the interval (0,2*pi) in all three dimensions, and that the robot head isn’t really attached to anything. That doesn’t seem realistic to me.
However, if you managed to perfect levitation of the robot head, then forget about the robot and use levitation for your thesis!
Pedro Vilas-Boas on 23 Apr 2016
Direct link to this comment
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve#comment_361155
This is the robot's head:
Right now im only using the head so i move it and rotate it myself. And for initial measuremnts basically i point the photodidodes to the light source and leave the head on the ground. Then it calculates the angle with which receives the light. After doing for several positions on the floor i got the raw data represented by the red crosses above. My goal is to show using the red practical data the levels which are expected in the theoretical green data.
Star Strider on 23 Apr 2016
Direct link to this comment
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve#comment_361161
It seems to me then that you need to regress the theoretical and experimental data with a linear model. Then show that the two are not significantly different. The F statistic is likely best for this. See the regress and related functions (Statistics and Machine Learning Toolbox) for details.
Pedro Vilas-Boas on 23 Apr 2016
Direct link to this comment
https://matlabcentral.mathworks.com/matlabcentral/answers/280617-how-do-i-find-the-extremes-of-an-always-decreasing-curve#comment_361172
I think i can't use a linear model, otherwise i will never see the levels i am looking for.
Sign in to comment.