continuous piecewise linear approximation of data set

조회 수: 11 (최근 30일)
alessio morabito
alessio morabito 2021년 4월 10일
댓글: Bruno Luong 2021년 4월 10일
I'll try to explain my problem: i'm studying the vertical profile of a railway. in a nutshell it's composed by a succession of straights and circles (tangents to the straights between which they are included). my data set is composed by survey points, measured along the railway with an uncertainty; my goal is to approximate this data set with a succession of straights and tangent circles (with the center on the bisector of the two straights in which it's included), such that certain constraints are respected (the most important concerns deviations, so i have to set lower and upper bounds).
I'm developing an algorithm that recognize (or try to) if the survey points belong to a straight or a circle (simply, computing of the change rate of gradient). after having cataloged all the points in the single lines and circles (i have the point group that belongs to the first straight, the point group that belongs to the second straights and the point group that belongs to the first circle, tangent to the first two straights.... and so on...). So, i need to approximate all the points groups that belongs to tangents with a continuous piecewise linear function, respecting lower and upper bounds constraints.
I've tried to write an algorithm using lsqlin for every single straight group points, but obviously the result is a discontinuous linear function whose vertices are not where I would like, i.e. included between the two groups of points belonging to the lines (so that i can then find the bisector and determine the center of the circle tangent to the two lines and that best approximates the survey points belonging to the circle). I hope someone has a good idea to join with mine to solve the problem in an elegant and general way.
Best Regards

답변 (1개)

Bruno Luong
Bruno Luong 2021년 4월 10일
편집: Bruno Luong 2021년 4월 10일
  댓글 수: 2
alessio morabito
alessio morabito 2021년 4월 10일
Hi Bruno. Thanks for your answer. I've tried your function, but the result (in image, where blue points are the groups of points i have to approximate, each one individually) is not perfect... i think the problem is that i have to force the optimization in the x-values of the straights points groups, but i don't know how to do it
Bruno Luong
Bruno Luong 2021년 4월 10일
"i think the problem is that i have to force the optimization in the x-values of the straights points groups"
I don't understand what you mean by that.
If I do I can help.
The fit is poor IMO, you should much better than this. If you provide the data I might better help.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Least Squares에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by