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
286 Introduction to Computational Modeling
FIGURE 19.8: Vertical velocity of free-falling object.
double
*
lparams = (double
*
) params_ptr;
double m = lparams[0]; /
*
mass of object
*
/
double c = lparams[1]; /
*
drag constant
*
/
/
*
evaluate the right-hand-side functions at t
*
/
f[0] = y[1];
f[1] = (c/m)
*
y[1]
*
y[1] - G;
return GSL_SUCCESS; /
*
GSL_SUCCESS defined in gsl/errno.h as 0
*
/
}
Figure 19.7 shows the graph of the vertical displacement with time generated
by Gnuplot. Observe that after about 10 seconds, the displacement changes linearly.
Figure 19.8 shows the graph of vertical velocity of the object with time. Observe that
the velocity of the object increases
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