MATLAB: alternative to CSAPE function?

  • Context: MATLAB 
  • Thread starter Thread starter PhysMaster
  • Start date Start date
  • Tags Tags
    Function Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 6K views
PhysMaster
Messages
32
Reaction score
0
MATLAB: alternative to CSAPE function? (Aerospace application)

Hi,
I need it to spline fit an airfoil. This function is special because it has "end conditions". So the trailing edge will remain intact. I am looking for an alternative because I don't have Spline Toolbox and this is the only function I need.

MathWorks Original Function Link: http://www.mathworks.com/access/helpdesk/help/toolbox/splines/index.html?/access/helpdesk/help/toolbox/splines/csape.html&http://www.mathworks.com/cgi-bin/texis/webinator/search/?db=MSS&prox=page&rorder=750&rprox=750&rdfreq=500&rwfreq=500&rlead=250&sufs=0&order=r&is_summary_on=1&ResultCount=10&query=csape&submitButtonName=Search"

I found this: http://www.mathworks.com/matlabcentral/fileexchange/17610 but it doesn't say anything about end conditions.

Please let me know of any other (maybe user created) function that can do this. Just a tool, it can be for excel anything else.

Thank you.
 
Last edited by a moderator:
Physics news on Phys.org
I believe no one would waste time creating another function that has been already created. I don't know about other softwares, but surely excel doesn't have something like that.

To the reader: if you have come looking for an alternative, like the OP, I'll advise you to buy the Toolbox. Matlab doesn't publish it's source code for functions, so there is almost no way you can find an exact duplicate function.

Currently, the spline fitting functions are in the Curve Fitting Toolbox:
https://in.mathworks.com/help/curvefit/spline-fitting.html
 
PhysMaster said:
MATLAB: alternative to CSAPE function? (Aerospace application)

Hi,
I need it to spline fit an airfoil. This function is special because it has "end conditions". So the trailing edge will remain intact. I am looking for an alternative because I don't have Spline Toolbox and this is the only function I need.

What sort of end conditions? Specifying the first derivatives at the endpoints is a fairly standard constraint, I think called "clamped cubic splines".

it shouldn't be that hard to homebrew your own spline routine, as ultimately it comes down to a linear system. Read a little literature on how to set up the equations, define your linear system, and use Matlab's built-in solver. (HELP SLASH).

Implementation note: In writing my own spline routines, I've always found it convenient to work in normalized variables that go from 0 to 1 on each segment (that makes the equations incredibly simple), or relative coordinates that go from 0 to delta-x on each segment (almost as simple). This also tends to keep the coefficients small and the expressions numerically stable.