Interpolation of matrices with data points having changing derivative

1 view (last 30 days)
Dear all,
I am trying to define a spline for a set of data whose derivative goes to zero after a certain set of time. Then I have to use this spline for interpolation in a for loop using ppval. But the problem is that in reality the derivative of the spline approaches to zero but the defined spline goes on increasing. At the start both values are matching, the actual and the spline but at larger values the deviation is greater.
In actual scenario, at approximately 20 value at the x axis, the y axis value keeps on increasing, but after that the y value remain approximately constant, even if x-axis value goes to infinity.
Thank you for your response in advance.
Regards
  13 Comments
Star Strider
Star Strider on 2 May 2024
@Muhammad Hassaan Bin Tariq — If you have a mathematical description of the process that created your data, convert that to a function that can be used as the objective function in one of the appropriate optimisation functions, for example lsqcurvefit (although there are several to choose from, depending on what you want). Once you get good estimates for the parameters, you can evaluate the function for other values of the independent variable.
You can also use the Symbolic Math Toolbox to calculate the derivative of the function, and convert that to an anonymous function that can then evaluate the derivative with the estimated parameters at given values of the independent variable.

Sign in to comment.

Answers (0)

Categories

Find more on Spline Postprocessing in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!