ArticleslgStudy

computer science

QUADPACK

QUADPACK is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand QUADPACK rather than just read about it. In short: QUADPACK is a FORTRAN 77 library for numerical integration (quadrature) of one-dimensional functions. It was included in the SLATEC Common Mathematical Library and is therefore in the public domain.

Key takeaways

  • QUADPACK belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect QUADPACK to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of QUADPACK from memory before moving on to harder problems.

Reference excerpt

QUADPACK is a FORTRAN 77 library for numerical integration (quadrature) of one-dimensional functions. It was included in the SLATEC Common Mathematical Library and is therefore in the public domain. The individual subprograms are also available on netlib. The GNU Scientific Library reimplemented the QUADPACK routines in C. SciPy provides a Python interface to part of QUADPACK.

Routines The main focus of QUADPACK is on automatic integration routines in which the user inputs the problem and an absolute or relative error tolerance and the routine attempts to perform the integration with an error no larger than that requested. There are nine such automatic routines in QUADPACK, in addition to a number of non-automatic routines. All but one of the automatic routines use adaptive quadrature.

General-purpose routines The two general-purpose routines most suitable for use without further analysis of the integrand are QAGS for integration over a finite interval and QAGI for integration over an infinite interval. These two routines are used in GNU Octave (the quad command) and R (the integrate function).

QAGS uses global adaptive quadrature based on 21-point Gauss–Kronrod quadrature within each subinterval, with acceleration by Peter Wynn's epsilon algorithm. QAGI is the only general-purpose routine for infinite intervals, and maps the infinite interval onto the semi-open interval (0,1] using a transformation then uses the same approach as QAGS, except with 15-point rather than 21-point Gauss–Kronrod quadrature. For an integral over the whole real line, the transformation used is x = ( 1 − t ) / t {\displaystyle x=(1-t)/t} : ∫ − ∞ + ∞ f ( x ) d x = ∫ 0 1 d t t 2 ( f ( 1 − t t ) + f ( − 1 − t t ) ) . {\displaystyle \int _{-\infty }^{+\infty }f(x)dx=\int _{0}^{1}{dt \over t^{2}}\left(f\left({\frac {1-t}{t}}\right)+f\left(-{\frac {1-t}{t}}\right)\right)\;.} This is not the best approach for all integrands: another transformation may be appropriate, or one might prefer to break up the original interval and use QAGI only on the infinite part.

Brief overview of the other automatic routines QNG simple non-adaptive integrator QAG simple adaptive integrator QAGP similar to QAGS but allows user to specify locations of internal singularities, discontinuities etc. QAWO integral of cos(ωx) f(x) or sin(ωx) f(x) over a finite interval QAWF Fourier transform QAWS integral of w(x) f(x) from a to b, where f is smooth and w(x) = (x–a)α (b–x)β logk(x–a) logl(b–x), with k, l = 0 or 1 and α, β > –1 QAWC Cauchy principal value of the integral of f(x)/(x–c) for user-specified c and f

See also List of numerical libraries List of open-source mathematical libraries

References

Further reading Favati, P.; Lotti, G.; Romani, F. (1991). "Algorithm 691; Improving QUADPACK automatic integration routines". ACM Transactions on Mathematical Software. 17 (2): 218–232. doi:10.1145/108556.108580. S2CID 19675880. Cools, R.; Haegemans, A. (2003). "Algorithm 824: CUBPACK: a package for automatic cubature; framework description". ACM Transactions on Mathematical Software. 29 (3): 287–296. doi:10.1145/838250.838253. S2CID 6855610.

Worked examples

Example 1 — a first encounter with QUADPACK

Start with the simplest possible case. Write down what QUADPACK claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to QUADPACK before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about QUADPACK ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of QUADPACK

In research
QUADPACK appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses QUADPACK in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
QUADPACK is common in secondary-school and first-year university syllabi. It links to neighbouring topics Fortran libraries, Numerical integration, Numerical software, so understanding it makes those chapters shorter.
In everyday life
Look for QUADPACK outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study QUADPACK in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what QUADPACK means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain QUADPACK out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is QUADPACK in simple terms?

QUADPACK is a FORTRAN 77 library for numerical integration (quadrature) of one-dimensional functions. It was included in the SLATEC Common Mathematical Library and is therefore in the public domain.

Why does QUADPACK matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study QUADPACK?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on QUADPACK.

Tags

  • Fortran libraries
  • Numerical integration
  • Numerical software
  • Public-domain software with source code

Keep exploring