Condition of continuity of the first derivative

Hi,
i'm not very expert in Matlab and i don't know if i can explain exactly my problem. I try! I have two vectors(x1,x2 and y1,y2) that contain coordinates that describe two branches of curve. I would like to plot a single curve obtained from the union of the two branches.
The issue is that I want to join the two branches so that the overall curve has continuous first derivative at the point of intersection of the two branches (i have found the intersection point by extrapolating outside of the range of definition of the two branches). I need to impose the condition of the derivative in order to avoid the danger that the two branches form a cusp at the point of intersection.
Someone may suggest how to impose the passage for some points and at the same time the continuity of the derivative at a point?
Thanks!!

답변 (1개)

Matt J
Matt J 2013년 5월 2일

0 개 추천

Just interpolate between the two curves using a first order smooth interpolator, e.g.,
spline([x1,x2],[y1,y2],desiredpoints);

댓글 수: 2

Caro
Caro 2013년 5월 2일
Thanks for your answer but i've already tried this solution and the two curves form a cusp. So I was suggested to find a way to impose the continuity of the derivative.
Thanks
Matt J
Matt J 2013년 5월 2일
편집: Matt J 2013년 5월 2일
It's impossible that they form a cusp. Cubic splines are twice differentiable. Smoothness is the very reason people use them.
More likely, you are just not plotting the spline fit at enough points for the plot to "look" smooth.

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

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

2013년 5월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by