Chapter 3. Differentiation and Integration

In this chapter, we will master some classical and state-of-the-arts techniques to perform the two core operations in Calculus (and, by extension, in Physics and every engineering field): differentiation and integration of functions.

Motivation

Common to the design of railway or road building (especially for highway exits), as well as those crazy loops in many roller coasters, is the solution of differential equations in two or three dimensions that address the effect of curvature and centripetal acceleration on moving bodies. In the 1970s, Werner Stengel studied and applied several models to attack this problem and, among the many solutions he found, one struck as particularly brilliant—the employment of clothoid loops (based on sections of Cornu's spiral). The first looping coaster designed with this paradigm was constructed in 1976 in the Baja Ridge area of Six Flags Magic Mountain, in Valencia, California, USA. It was coined the Great American Revolution, and it featured the very first vertical loop (together with two corkscrews, for a total of three inversions).

Motivation

The tricky part of the design was based on a system of differential equations, whose solution depended on the integration of Fresnel-type sine and cosine integrals, and then selecting the appropriate sections of the resulting curve. Let's see the computation and plot of these interesting functions:

In [1]: import numpy as np, matplotlib.pyplot as plt; 
   ...: from scipy.special import fresnel
In [2]: np.info(fresnel)
fresnel(x[, out1, out2])
(ssa,cca)=fresnel(z) returns the Fresnel sin and cos integrals:
integral(sin(pi/2 * t**2),t=0..z) and
integral(cos(pi/2 * t**2),t=0..z)
for real or complex z.
In [3]: ssa, cca = fresnel(np.linspace(-4, 4, 1000))
In [4]: plt.plot(ssa, cca, 'b-'); 
   ...: plt.axes().set_aspect('equal'); 
   ...: plt.show()

This results in the following plot:

Motivation

The importance of Fresnel integrals granted them a permanent place in SciPy libraries. There are many other useful integrals that shared the same fate, and now lie ready for action in the module scipy.special. For a complete list of all those integrals, as well as implementation of other relevant functions and their roots or derivatives, refer to the online documentation of scipy.special at http://docs.scipy.org/doc/scipy-0.13.0/reference/special.html, or in Chapter 4, SciPy for Numerical Analysis of Francisco Blanco-Silva's Learning SciPy for Numerical and Scientific Computing.

For all the other functions that did not make it to this ample list, we still need robust solutions to the computation of their roots, derivatives, or integrals. In this chapter, we will focus on computational devices that allow the last two operations.

Tip

The calculation of (or approximation to the) roots of any given function will be covered in the next chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.175.253