Skip to Main Content
Introduction to Computational Modeling Using C and Open-Source Tools
book

Introduction to Computational Modeling Using C and Open-Source Tools

by Jose M. Garrido
November 2013
Intermediate to advanced content levelIntermediate to advanced
461 pages
12h 1m
English
CRC Press
Content preview from Introduction to Computational Modeling Using C and Open-Source Tools
208 Introduction to Computational Modeling
The C program in file csinterpf.c is shown in Listing 16.2. Line 32 calls func-
tion csinterp to compute the interpolation using the cubic spline technique. This pro-
gram is very similar to the previous program that performed linear interpolation. The
first argument used in calling the library function gsl interp alloc is the gsl constant
gsl interp cspline, which specifies the type of interpolation to apply.
FIGURE 16.4: Graph of given data points.
Listing 16.2: Script to compute cubic spline interpolation of data.
1 /
*
Program: csinterpf.c
2 Interpolation of Discrete Points
3 Using Cubic Spline interpolation
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Fundamentals and Programming in C (RMK)

Computer Fundamentals and Programming in C (RMK)

Anita Goel, Ajay Mittal

Publisher Resources

ISBN: 9781482216783