Condition of continuity of the first derivative

5 views (last 30 days)
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!!

Answers (1)

Matt J
Matt J on 2 May 2013
Just interpolate between the two curves using a first order smooth interpolator, e.g.,
spline([x1,x2],[y1,y2],desiredpoints);
  2 Comments
Caro
Caro on 2 May 2013
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 on 2 May 2013
Edited: Matt J on 2 May 2013
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!