curve fitting form pic with multiple similar curves?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen

hi! how can i get the equation from this? since there are many curves, and get something semiautomatic as i get many of this images to process, i mean just like pointing the diferent curves when they start and end. to get and equation fitted. thanks
2 Kommentare
Star Strider
am 10 Dez. 2016
Find out who built the jet, then ask the manufacturer how they calculated the performance envelope.
Antworten (2)
John D'Errico
am 10 Dez. 2016
MATLAB does not do magic. This will not be so trivial as you hope. You need to
0. Choose some model form for those curves. You cannot simply take a list of points and then magically infer what equation would have produced them. Start with a model that is appropriate for the process.
1. Extract points off those curves. It might need to be by you (or a student or other helper) clicking on the plot with a mouse, using ginput.
2. Then fit the parameters of that model to the curve. This will require you to learn about curve fitting of course. You will need some toolboxes. best for you might be the curvefitting TB, since it solves this problem, but the stats or optimization TBs also do it. Or, you could use fminsearch, but then you need to learn yet more about optimization, and how to write the proper objective.
Assuming the chosen model family is adequate to represent for every curve, do the above steps for EVERY curve, repeating steps 1 and 2.
There are lots of lines in that figure. It will be most easily done by using your brain to find and extract those points from the curves of interest. Yes, I know that you want something automatic and easy. Not gonna happen. So find some low paid person who is willing to do the work. Or do it yourself. Hey, your time is free! Well, not quite free.
2 Kommentare
John D'Errico
am 10 Dez. 2016
The hard work will be getting the data in using ginput, because it tends to be boring as hell.
I would suggest that you need TWO points to get the corners of the axes. Once to get the lower left point that is known to be the origin (0,0).
A second time, to get the upper right corner.
Next, you need to input the x and y axis scale values. That is, what are the limits in x and y? Here, that would be the numbers [50,400].
You now have pixel coordinates for those two points, and you also know the coordinates of those points in real space. This gives you a linear transformation between the two coordinate systems.
If you are worried that the images are not perfectly aligned, so the x axis is perfectly horizontal, then you need three points, three corners of those axes. A 4th corner will allow you to obtain the mapping using least squares, to allow for some noise to be removed. (I need to know what you are willing to assume here, before I'll spend the effort to go into those details, as otherwise, I might spend a lot of time showing you how to do something you had no need to do.)
Once you have that linear transformation between pixel coordinates and "real" world coordinates then any pixel coordinates generated by ginput can be mapped through this mapping.
Given the real coordiantes from a given curve, it sounds like you want to use a polynomial model. Since the curve passes through zero, it will have no constant term. (Actually, the constant term will be zero.) Fitting a polynomial is easy. The real problem is how to determine the order. Given a pair of column vectors X and Y, and a polynomial degree n, where n is the degree of the highest order term in the model:
coefs = [(X.^(n:-1:1))\Y ; 0]';
The above will return a row vector of polynomial coefficients, in a form that polyval can use. It presumes that you have MATLAB release R2016b.
Do NOT use a high order polynomial. Use as low order as possible such that you can get a viable fit. The road to modeling hell is paved with the souls of those polynomial modelers who used too high an order, or too low an order. :)
Choose a polynomial order that gives you a reasonable RMSE for the fit, recognizing that much of the noise in those measurements comes from your ability to click on the curve with a mouse.
Image Analyst
am 10 Dez. 2016
Perhaps you'd like to use this: http://www.mathworks.com/matlabcentral/fileexchange/36904-matlab-script-for-digitizing-a-published-graph
If you can get a list of the x,y points, by ginput or whatever, and can decide on the order of a polynomial, then you can use polyfit
coefficients = polyfit(x, y, 3);
Or for more complicated models you can use fitlm(), fitlme(), or fitglm() in the Statistics and Machine Learning Toolbox.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Vehicle Scenarios finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!