MATLAB MATLAB: alternative to CSAPE function?

  • Thread starter Thread starter PhysMaster
  • Start date Start date
  • Tags Tags
    Function Matlab
AI Thread Summary
The discussion centers on finding an alternative to the CSAPE function in MATLAB for spline fitting, specifically for airfoil applications that require maintaining end conditions at the trailing edge. The original poster seeks a solution due to not having access to the Spline Toolbox. Suggestions include exploring user-created functions on MATLAB Central, although one mentioned function lacks information on end conditions. A recommendation is made to consider purchasing the Toolbox, as MATLAB does not provide source code for its functions, making it difficult to replicate them. Additionally, it is noted that spline fitting functions are available in the Curve Fitting Toolbox. A user suggests that creating a custom spline routine is feasible, emphasizing the importance of defining a linear system and using MATLAB's built-in solver. They also recommend normalizing variables for simplicity and numerical stability in the implementation.
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.
 

Similar threads

Replies
1
Views
8K
Back
Top