Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Convex" curve or "convex" surface in Matlab 1

Status
Not open for further replies.

trecon

Mechanical
Oct 26, 2010
4
Hi everybody,

I have a mesured surface (which is represented by a set of mesured points (black) in the attached figure).

The problem is that I've try to find the way to create the "convex" curve (in red) in Matlab. Anyone have an idea about this ?

This problem will be extended that he case of 3D. Then the "convex" curve becomes the "convex" surface.

I'm waiting your helps.
Thanks in advance.
 
Replies continue below

Recommended for you

Isn't it basically a regression problem? Depends on what type of curve you want to fit, but they're all basically the same approach; the curve has to be complex enough to have the degrees of freedom necessary to fit the selected points.

TTFN

FAQ731-376
 
Thanks IRstuff but it's not exactly a regression problem.

I've searched in the Curve Fitting Toolbox of Matlab (or the functions of interpolation), but it's not that I need.

According to the attached image and as I know about the Curve Fitting Toolbox, Matlab can only create the curves like in a) and b).

The one that I need is described in c) : a "convex" line.

I've thought to programme with Matlab, but I haven't any ideas for detecting the points of the "convex" line. Anyone have an idea or a keyword for me to search ?

Best regards,
 
 http://files.engineering.com/getfile.aspx?folder=3ab96596-e5b9-4743-997a-4949dcb05e73&file=2.bmp
If you'll recall, I mentioned that the selected curve must have sufficient degrees of freedom, but not overly so. In your examples, assuming they're actual fits, the curve has WAY to many degrees of freedom. In your specific case, you need to be looking for something like a 2nd or 3rd degree polynomial, and no more than that.

TTFN

FAQ731-376
 
You know what could beautifully approximate that.
A trained F Neural Network.

[peace]
Fe
 
I may be simplifying, but how about:

Solve {Ak, Bk, Ck} to Minimize Sumk(yk-yhatk)^2
where
yhatk is kth estimate of yk, in the form yhatk = A0k + A1k*xk + A2k*xk^2

subject to constraints:
1: yk>=yhatk for all k (ensures the curve stays on one side of the data)
2: A2k > 0 for all k (ensures curve is convex up if that is desired)

=====================================
(2B)+(2B)' ?
 
Let me try again:

Two versions:

First version gives simple single quadratic:
Solve {A1, A2, A0} to Minimize Sumk(yk-yhatk)^2
where
yhatk is kth estimate of yk, in the form yhatk = A0 + A1*xk + A2*xk^2

subject to constraints:
1: yk>=yhatk for all k (ensures the curve stays on one side of the data)
2: A2 > 0 (ensures curve is convex up if that is desired)

A more advanced version would be a quadratic spline, with same coefficients A0,A1, A2 on each interval, and with some kind of constraint on slopes of adjacent intervals to help ensure convex. Note it is not a true spline since it won't match in each interval, but with right constraints could be found by minimization problem.

=====================================
(2B)+(2B)' ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor