Python Source


  1. allen_cahn_ode, a Python code which sets up and solves the 1D Allen-Cahn reaction-diffusion ordinary differential equation (ODE).
  2. alpert_rule, a Python code which can set up an Alpert quadrature rule to approximate the integrals of functions which are regular, log(x) singular, or 1/sqrt(x) singular.
  3. analemma, a Python code which evaluates the equation of time, a formula for the difference between the uniform 24 hour day and the actual position of the sun, based on a C program by Brian Tung.
  4. animation_test, a Python code which computes a sequence of solutions to a partial differential equation, using matplotlib, displaying each solution to the screen WITHOUT requiring the user to hit RETURN to see the next image.
  5. annulus_monte_carlo, a Python code which uses the Monte Carlo method to estimate the integral of a function over the interior of a circular annulus in 2D.
  6. annulus_rule, a Python code which computes a quadrature rule for estimating integrals of a function over the interior of a circular annulus in 2D.
  7. args, a Python code which reports the command line arguments with which it was invoked;
  8. asa047, a Python code which minimizes a scalar function of several variables using the Nelder-Mead algorithm, by R ONeill. This is a version of Applied Statistics Algorithm 47;
  9. asa053, a Python code which produces sample matrices from the Wishart distribution, by William Smith and Ronald Hocking. This is a version of Applied Statistics Algorithm 53.
  10. asa063, a Python code which evaluates the incomplete Beta function, by KL Majumder and G Bhattacharjee. This is a version of Applied Statistics Algorithm 63;
  11. asa082, a Python code which computes the determinant of an orthogonal matrix; this is Applied Statistics Algorithm 82, by J C Gower.
  12. asa103, a Python code which evaluates the digamma or psi function, by Jose Bernardo; this is a version of Applied Statistics Algorithm 103;
  13. asa183, a Python code which implements a random number generator (RNG), by Wichman and Hill; this is a version of Applied Statistics Algorithm 183;
  14. asa241, a Python code which computes the inverse of the normal cumulative density function (CDF), by Michael Wichura; this is a version of Applied Statistics Algorithm 241;
  15. atbash, a Python code which applies the Atbash substitution cipher to a string of text.
  16. backtrack_binary_rc, a Python code which carries out a backtrack search for a set of binary decisions, using reverse communication (RC).
  17. ball_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected from the interior of the unit ball in 3D.
  18. ball_grid, a Python code which computes grid points inside a 3D ball.
  19. ball_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit ball in 3D.
  20. ball_monte_carlo, a Python code which applies a Monte Carlo method to estimate integrals of a function over the interior of the unit ball in 3D;
  21. bank, a Python code which computes the check digit associated with a US Bank Routing Number check digit, or reports whether a 9-digit code is actually valid.
  22. barycentric_interp_1d, a Python code which defines and evaluates the barycentric Lagrange polynomial p(x) which interpolates a set of data, so that p(x(i)) = y(i). The barycentric approach means that very high degree polynomials can safely be used.
  23. bellman_ford, a Python code which implements the Bellman-Ford algorithm for finding the shortest distance from a given node to all other nodes in a directed graph whose edges have been assigned real-valued lengths.
  24. bernstein_polynomial, a Python code which evaluates the Bernstein polynomials;
  25. besselj, a Python code which evaluates Bessel J functions of noninteger order;
  26. bicycle_lock, a Python code which simulates the process of determining the secret combination of a bicycle lock, an integer between 000 and 999.
  27. bisect, a Python code which seeks a solution to the equation F(X)=0 using bisection within a user-supplied change of sign interval [A,B]. The procedure is written using classes.
  28. bisection_rc, a Python code which seeks a solution to the nonlinear equation F(X)=0 using bisection within a user-supplied change of sign interval [A,B]. The procedure is written using reverse communication (RC).
  29. black_scholes, a Python code which implements some simple approaches to the Black-Scholes option valuation theory, by Desmond Higham.
  30. blas1_d, a Python code which constitutes the Level 1 Basic Linear Algebra Subprograms (BLAS), for vector-vector operations using double precision real arithmetic, by Charles Lawson, Richard Hanson, David Kincaid, Fred Krogh.
  31. boundary_word, a Python code which works with a polyomino that is described by its boundary word, a sequence of U/D/L/R symbols that indicate how to trace out its boundary.
  32. brownian_motion_simulation, a Python code which simulates Brownian motion in an M dimensional region.
  33. burgers_solution, a Python code which evaluates exact solutions of the time-dependent 1D viscous Burgers equation.
  34. bvec, a Python code which demonstrates how signed integers can be stored as binary vectors, and arithmetic can be performed on them.
  35. c4lib, a Python code which implements certain elementary functions for single precision complex (C4) variables;
  36. c8lib, a Python code which implements certain elementary functions for double precision complex (C8) variables;
  37. caesar, a Python code which applies a Caesar Shift Cipher to a string of text.
  38. calpak, a Python code which makes various calendar calculations;
  39. cauchy_principal_value, a Python code which uses Gauss-Legendre quadrature to estimate the Cauchy Principal Value (CPV) of certain singular integrals.
  40. cfd_barba, a Python code which contains some of the iPython workbooks associated with the "12 Steps to Navier-Stokes" presentation by Lorena Barba.
  41. cg, a Python code which implements a simple version of the conjugate gradient (CG) method for solving a system of linear equations of the form A*x=b, suitable for situations in which the matrix A is positive definite (only real, positive eigenvalues) and symmetric.
  42. cg_rc, a Python code which implements the conjugate gradient (CG) method for solving a positive definite sparse linear system A*x=b, using reverse communication (RC).
  43. change_making, a Python code which considers the change making problem, in which a given sum is to be formed using coins of various denominations.
  44. chebyshev_interp_1d, a Python code which determines the combination of Chebyshev polynomials which interpolates a set of data, so that p(x(i)) = y(i).
  45. chebyshev_polynomial, a Python code which considers the Chebyshev polynomials T(i,x), U(i,x), V(i,x) and W(i,x). Functions are provided to evaluate the polynomials, determine their zeros, produce their polynomial coefficients, produce related quadrature rules, project other functions onto these polynomial bases, and integrate double and triple products of the polynomials.
  46. chrpak, a Python code which manipulates characters and strings;
  47. chuckaluck_simulation, a Python code which simulates the Chuck-a-Luck gambling game.
  48. circle_arc_grid, a Python code which computes grid points along a circular arc.
  49. circle_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected on the circumference of the unit circle.
  50. circle_integrals, a Python code which returns the exact value of the integral of any monomial over the circumference of the unit circle in 2D.
  51. circle_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function along the circumference of the unit circle in 2D;
  52. clausen, a Python code which evaluates a Chebyshev interpolant to the Clausen function Cl2(x).
  53. cobweb_plot, a Python library which displays a cobweb plot illustrating the process of function iteration, by John D Cook.
  54. collatz_recursive, a Python code which demonstrates recursive programming by considering the simple Collatz 3n+1 problem.
  55. combination_lock, a Python code which simulates the process of determining the secret combination of a lock.
  56. combo, a Python code which includes routines for ranking, unranking, enumerating and randomly selecting balanced sequences, cycles, graphs, Gray codes, subsets, partitions, permutations, restricted growth functions, Pruefer codes and trees.
  57. compass_search, a Python code which seeks the minimizer of a scalar function of several variables using compass search, a direct search algorithm that does not use derivatives.
  58. complex_numbers_test
  59. condition, a Python code which implements methods of computing or estimating the condition number of a matrix.
  60. continued_fraction a Python code which implements some simple algorithms for dealing with simple and generalized continued fractions.
  61. cordic, a Python code which computes a few special functions using the CORDIC algorithm.
  62. cosine_transform, a Python code which demonstrates some simple properties of the discrete cosine transform (DCT).
  63. counterfeit_detection, a Python code which considers problems in which one or more counterfeit coins are to be identified by the fact that they do not have the standard weight.
  64. csv_test, a Python code which tests the csv() library for reading and writing Comma Separated Value (CSV) data files.
  65. cube_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected in the interior of the unit cube in 3D.
  66. cube_grid, a Python code which computes a grid of points over the interior of a cube in 3D.
  67. cube_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit cube in 3D.
  68. cube_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function over the interior of the unit cube in 3D.
  69. cuda_loop, a Python code which shows how, in a CUDA program, the choice of block and thread factors determines the allocation of tasks to processors.
  70. cvt_1d_lloyd, a Python code which computes an N-point Centroidal Voronoi Tessellation (CVT) within the interval [0,1], under a uniform density, using the Lloyd iteration to compute the Voronoi regions exactly.
  71. cvt_2d_sampling, a Python code which computes an N-point Centroidal Voronoi Tessellation (CVT) within the unit square [0,1]x[0,1], under a uniform density, using sampling to estimate the Voronoi regions.
  72. cvxopt_svm, a Python code which solves a support vector machine (SVM) problem by formulating it as a quadratic programming problem to be solved by cvxopt().
  73. cvxopt_test
  74. cycle_brent, a Python code which carries out an iterated function evaluation, and seeks to determine the nearest element of a cycle, and the cycle length, using the Brent method.
  75. cycle_floyd, a Python code which carries out an iterated function evaluation, and seeks to determine the nearest element of a cycle, and the cycle length, using the Floyd method.
  76. delaunay_test, a Python code which demonstrates the use of the scipy.spatial function Delaunay(), to compute a Voronoi diagram, and matplotlib.pyplot.triplot(), to display it.
  77. dg1d_poisson, a Python code which applies the discontinuous Galerkin method (DG) to a 1D version of the Poisson equation, based on a MATLAB code by Beatrice Riviere.
  78. dijkstra, a Python code which implements a simple version of the Dijkstra minimum distance algorithm for graphs.
  79. diophantine_nd, a Python code which is given a Diophantine equation in N variables, and returns all nonnegative solutions, or all strictly positive solutions.
  80. disk_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected inside the unit disk.
  81. disk_grid, a Python code which computes grid points within the interior of a disk of user specified radius and center in 2D, using matplotlib to create an image of the grid.
  82. disk_monte_carlo, a Python code which applies a Monte Carlo (MC) method to estimate integrals of a function over the interior of the general disk in 2D;
  83. disk_rule, a Python code which computes a quadrature rule over the interior of the general disk in 2D.
  84. disk01_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit disk in 2D.
  85. disk01_monte_carlo, a Python code which applies a Monte Carlo method to estimate integrals of a function over the interior of the unit disk in 2D;
  86. disk01_quarter_monte_carlo, a Python code which applies a Monte Carlo method to estimate integrals of a function over the interior of the unit quarter disk in 2D;
  87. disk01_rule, a Python code which computes a quadrature rule to approximate the integral of a function over the interior of the unit disk in 2D, with radius 1 and center (0,0).
  88. dolfin-convert, a Python code which can convert mesh file from Gmsh, MEDIT, METIS or SCOTCH format to an XML format suitable for use by DOLFIN or FENICS, by Anders Logg.
  89. doomsday, a Python code which is given the year, month and day of a date, and uses John Conway's doomsday algorithm to determine the corresponding day of the week.
  90. drug_dosage, a Python code which simulates the variation in the blood levels of a medicinal drug being administered at specific dosages and times over a course of treatment. The level should rise about a given medicinal level for some time, but stay below the toxic level.
  91. duel_simulation, a Python code which simulates N repetitions of a duel between two players, each of whom has a known firing accuracy.
  92. ellipse_grid, a Python code which computes grid points over the interior of an ellipse in 2D.
  93. ellipse_monte_carlo, a Python code which uses the Monte Carlo method to estimate the value of integrals over the interior of an ellipse in 2D.
  94. ellipsoid_grid, a Python code which computes a grid of points over the interior of an ellipsoid in 3D.
  95. ellipsoid_monte_carlo, a Python code which uses the Monte Carlo method to estimate the value of integrals over the interior of an ellipsoid in M dimensions.
  96. elliptic_integral, a Python code which evaluates complete elliptic integrals of first, second and third kind, using the Carlson elliptic integral functions.
  97. euler, a Python code which solves one or more ordinary differential equations (ODE) using the forward Euler method.
  98. exactness, a Python code which investigates the exactness of quadrature rules that estimate the integral of a function with a density, such as 1, exp(-x) or exp(-x^2), over an interval such as [-1,+1], [0,+oo) or (-oo,+oo).
  99. fastgl, a Python code which carries out the rapid computation of the Kth value and weight of an N point Gauss-Legendre quadrature rule for approximating the integral of a function over the interval [-1,+1], by Ignace Bogaert.
  100. fd_predator_prey, a Python code which solves a time-dependent predator prey system using the finite difference method (FDM).
  101. fd1d_advection_lax_wendroff, a Python code which applies the finite difference method (FDM) to solve the time-dependent advection equation ut = - c * ux in one spatial dimension, with a constant velocity, using the Lax-Wendroff method to approximate the time derivative, creating a graphics file with matplotlib.
  102. fd1d_bvp, a Python code which applies the finite difference method (FDM) to a two point boundary value problem (BVP) in one spatial dimension.
  103. fd1d_heat_explicit, a Python code which implements a finite difference method (FDM), explicit in time, to solve the time dependent 1D heat equation;
  104. fd1d_heat_implicit, a Python code which implements a finite difference method (FDM), implicit in time, to solve the time dependent 1D heat equation;
  105. fd2d_heat_steady, a Python code which implements a finite difference method (FDM) for the steady (time independent) 2D heat equation;
  106. fem_basis, a Python code which can define and evaluate finite element method (FEM) basis functions for any degree in an M dimensional simplex (1D interval, 2D triangle, 3D tetrahedron, and higher dimensional generalizations.)
  107. fem_to_xml, a Python code which reads a pair of FEM files defining node coordinates and elements, of a 1D, 2D or 3D mesh, namely a file of node coordinates and a file of elements defined by node indices, and creates a corresponding XML file for input to DOLFIN or FENICS.
  108. fem1d, a Python code which applies the finite element method (FEM) to a boundary value problem (BVP) in one spatial dimension, using a procedural approach.
  109. fem1d_bvp_linear, a Python code which applies the finite element method (FEM), with piecewise linear elements, to a two point boundary value problem (BVP) in one spatial dimension, and compares the computed and exact solutions with the L2 and seminorm errors.
  110. fem1d_bvp_quadratic, a Python code which applies the finite element method (FEM), with piecewise quadratic elements, to a two point boundary value problem (BVP) in one spatial dimension, and compares the computed and exact solutions with the L2 and seminorm errors.
  111. fem1d_classes, a Python code which defines classes useful for solving a boundary value problem (BVP) of the form u''+2u'+u=f in 1 spatial dimension, using the finite element method (FEM), by Mike Sussman.
  112. fem1d_heat_explicit, a Python code which uses the finite element method (FEM) and explicit time stepping to solve the time dependent heat equation in 1D.
  113. fem1d_model, a Python code which applies the finite element method (FEM) to a boundary value problem (BVP) in one spatial dimension, using a procedural approach.
  114. fem2d_bvp_linear, a Python code which applies the finite element method (FEM), with piecewise bilinear elements, to a 2D boundary value problem (BVP) in a rectangle.
  115. file_name_sequence, a Python code which demonstrates ways to generate a sequence of filenames, which can be useful when generating a sequence of still snapshots to be animated later.
  116. filum, a Python code which performs various operations on files;
  117. fire_simulation, a Python code which simulates a forest fire over a rectangular array of trees, starting at a single random location. It is intended as a starting point for the development of a parallel version.
  118. florida_cvt_geo, Python codes which explore the creation of a centroidal Voronoi Tessellation (CVT) of the state of Florida, based solely on geometric considerations.
  119. florida_cvt_pop, Python codes which explore the creation of a centroidal Voronoi Tessellation (CVT) of the state of Florida, based on population considerations.
  120. fn, a Python code which evaluates elementary and special functions using Chebyshev polynomials; functions include Airy, Bessel I, J, K and Y, beta, confluent hypergeometric, error, gamma, log gamma, Pochhammer, Spence; integrals include hyperbolic cosine, cosine, Dawson, exponential, logarithmic, hyperbolic sine, sine; by Wayne Fullerton.
  121. four_fifths, a Python code which searches for a solution to the problem of finding four fifth powers that sum to a fifth power, that is, integers a, b, c, d and e such that a^5+b^5+c^5+d^5=e^5. Euler conjectured that no solution was possible. The code is by Brian Hayes.
  122. freefem++_msh_io, a Python code which can read and write files used by the FreeFem++ finite element program to store mesh information.
  123. gegenbauer_cc, a Python code which computes the Gegenbauer weighted integral of a function f(x) using a Clenshaw-Curtis approach.
  124. gegenbauer_polynomial, a Python code which evaluates the Gegenbauer polynomial and associated functions.
  125. geometry, a Python code which performs geometric calculations in 2, 3 and M dimensional space, including the computation of angles, areas, containment, distances, intersections, lengths, and volumes.
  126. gmgsolve, a Python code which applies one step of the V-cycle of the geometric multigrid method, by Mike Sussman.
  127. graphics_test, Python codes which illustrate how various kinds of data can be displayed and analyzed graphically, using the matplotlib() graphics package.
  128. graphviz_test
  129. haar, a Python code which computes the Haar transform of data.
  130. halton, a Python code which computes elements of a Halton Quasi Monte Carlo (QMC) sequence, using a simple interface.
  131. hammersley, a Python code which computes elements of a Hammersley Quasi Monte Carlo (QMC) sequence, using a simple interface.
  132. hankel_cholesky, a Python code which computes the upper Cholesky factor R of a nonnegative definite symmetric H matrix so that H = R' * R.
  133. hankel_cholesky, a Python code which computes the upper Cholesky factor R of a nonnegative definite symmetric Hankel matrix so that H = R' * R.
  134. hankel_spd, a Python code which computes a lower triangular matrix L which is the Cholesky factor of a symmetric positive definite (SPD) Hankel matrix H, that is, H = L * L'.
  135. hdf5_test, a Python code which demonstrates the use of the HDF5 library and file format.
  136. hello, a Python code which prints "Hello, world!".
  137. hello_mpi, a Python code which prints out "Hello, world!", carried out in parallel using MPI and MPI4PY.
  138. hilbert_curve, a Python code which computes the sequence of discrete Hilbert curves whose limit is a space-filling curve.
  139. humps_ode, a Python code which solves an ordinary differential equation (ODE) whose solution is a double hump curve.
  140. hyperball_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected from the interior of the unit hyperball in M dimensions.
  141. hyperball_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit hyperball in M dimensions.
  142. hyperball_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function over the interior of the unit ball in M dimensions;
  143. hypercube_grid, a Python code which computes a grid of points over the interior of a hypercube in M dimensions.
  144. hypercube_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit hypercube in M dimensions.
  145. hypercube_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function over the interior of the unit hypercube in M dimensions.
  146. hypersphere_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected from the surface of the unit hypersphere in M dimensions.
  147. hypersphere_integrals, a Python code which returns the exact value of the integral of any monomial over the surface of the unit hypersphere in M dimensions.
  148. hypersphere_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function on the surface of the unit sphere in M dimensions;
  149. i4lib, a Python code which contains many utility routines, using single precision integer (I4) arithmetic.
  150. i8lib, a Python code which contains many utility routines, using double precision integer (I8) arithmetic.
  151. isbn, a Python code which determines the check digit for an International Standard Book Number (ISBN), or reports whether a given ISBN is valid.
  152. jacobi, a Python code which implements the Jacobi iteration for the iterative solution of linear systems.
  153. jacobi_eigenvalue, a Python code which implements the Jacobi iteration for the iterative determination of the eigenvalues and eigenvectors of a real symmetric matrix.
  154. knapsack_01, a Python code which uses brute force to solve small versions of the 0/1 knapsack problem;
  155. kronrod, a Python code which computes a Gauss and Gauss-Kronrod pair of quadrature rules of arbitrary order for the approximation of the integral of a function over the interval [-1,+1], by Robert Piessens, Maria Branders.
  156. lagrange_interp_1d, a Python code which defines and evaluates the Lagrange polynomial p(x) which interpolates a set of data depending on a 1D argument, so that p(x(i)) = y(i).
  157. latin_random, a Python code which computes Latin Random Squares of N points in M dimensions;
  158. lebesgue, a Python code which is given a set of nodes in 1D, and plots the Lebesgue function, and estimates the Lebesgue constant, which measures the maximum magnitude of the potential error of Lagrange polynomial interpolation.
  159. legendre_polynomial, a Python code which evaluates the Legendre polynomial and associated functions.
  160. legendre_product_polynomial, a Python code which defines Legendre product polynomials, creating a multivariate polynomial as the product of univariate Legendre polynomials.
  161. legendre_shifted_polynomial, a Python code which evaluates the shifted Legendre polynomial, with the domain [0,1].
  162. levenshtein, a Python code which returns the Levenshtein distance between two strings.
  163. line_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected in the unit line segment.
  164. line_grid, a Python code which computes a grid of points over the interior of a line segment in 1D.
  165. line_integrals, a Python code which returns the exact value of the integral of any monomial over the length of the unit line in 1D.
  166. line_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function over the length of the unit line in 1D.
  167. linpack_d, a Python code which factors and solves linear systems using double precision real arithmetic, by Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart.
  168. linplus_c8, a Python code which carries out some linear algebra operations on complex matrices.
  169. llsq, a Python code which solves the simple linear least squares (LLS) problem of finding the formula of a straight line y=a*x+b which minimizes the root mean square error to a set of N data points.
  170. loadtxt_test, a Python program which calls the numpy function loadtxt() to extract numeric data from a text file.
  171. local_min_rc, a Python code which finds a local minimum of a scalar function of a scalar variable, without the use of derivative information, using reverse communication (RC), by Richard Brent.
  172. log_normal, a Python code which returns quantities related to the log normal Probability Distribution Function (PDF).
  173. log_normal_truncated_ab, a Python code which returns quantities related to the log normal Probability Distribution Function (PDF) truncated to the interval [A,B].
  174. logistic_bifurcation, a Python code which computes the bifurcation diagram for the logistic equation, by John Cook.
  175. lorenz_ode, a Python code which approximates solutions to the Lorenz system of ordinary differential equations (ODE), creating graphics files using matplotlib.
  176. lorenz_sensitivity_test, a Python code which demonstrates sensitivity to initial conditions in the Lorenz system, using an approach suggested by John D Cook.
  177. luhn, a Python code which can compute the Luhn check digit for a string, or verify a string, as used for error detection in credit card numbers.
  178. machar, a Python code which dynamically computes the values of various machine characteristic constants, by William Cody;
  179. machine, a Python code which returns tabulated values of the constants associated with computer arithmetic;
  180. mandelbrot, a Python code which generates a Portable Network Graphics (PNG) image of the Mandelbrot set;
  181. mario, a Python code which creates a sort of "needlepoint" image of Mario, as an array of colored squares.
  182. matrix_exponential, a Python code which demonstrates some simple approaches to the problem of computing the exponential of a matrix.
  183. md, a Python code which carries out a molecular dynamics (MD) simulation, intended as a starting point for implementing a parallel version.
  184. midpoint, a Python code which solves one or more ordinary differential equations (ODE) using the midpoint method.
  185. monomial, a Python code which enumerates, lists, ranks, unranks and randomizes multivariate monomials in a space of M dimensions, with total degree less than N, equal to N, or in a given range.
  186. monomial_value, a Python code which evaluates a monomial in M dimensions.
  187. movie_test, a Python code which creates a movie file from a sequence of solutions to a partial differential equation, using matplotlib.
  188. naca, a Python code which can take the parameters of certain NACA airfoils and return the coordinates of a sequence of points that outline the wing shape. The shape can be displayed with MATLAB graphics.
  189. nas, a Python code which runs the NASA kernel benchmark.
  190. navier_stokes_2d_exact, a Python code which evaluates an exact solution to the incompressible time-dependent Navier-Stokes equations (NSE) over an arbitrary domain in 2D.
  191. navier_stokes_3d_exact, a Python code which evaluates an exact solution to the incompressible time-dependent Navier-Stokes equations (NSE) over an arbitrary domain in 3D.
  192. nearest_interp_1d, a Python code which interpolates a set of data using a piecewise constant interpolant defined by the nearest neighbor criterion, creating graphics files for processing by matplotlib.
  193. newton, a Python code which applies the Newton method to solve a single nonlinear equation f(x)=0.
  194. newton_interp_1d, a Python code which finds a polynomial interpolant to data using Newton divided differences.
  195. ngrams, a Python code which can analyze a string or text against the observed frequency of "ngrams" (particular sequences of n letters) in English text.
  196. normal, a Python code which implements a random number generator (RNG) for normally distributed values;
  197. normal01_multivariate_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected from an isotropic standard normal distribution in M dimensions.
  198. ode_euler, a Python code which applies the Euler method to estimate the solution of an ordinary differential equation y'=f(x,y), over the interval [a,b], with initial condition y(a)=ya, using n steps.
  199. owen, a Python code which evaluates the Owen T function;
  200. padua, a Python code which returns the coordinates of the 2D Padua points, as well as interpolation weights or quadrature weights, and images of the points graphics files.
  201. pariomino, a Python code which considers pariominoes, which are polyominoes with a checkerboard parity.
  202. partition_problem, a Python code which seeks solutions of the partition problem, splitting a set of integers into two subsets with equal sum.
  203. pbma_io, a Python code which reads or writes ASCII Portable Bit Map (PBM) 2D graphics files;
  204. pbmb_io, a Python code which reads or writes a binary Portable Bit Map (PBM) 2D graphics file;
  205. pdflib, a Python code which evaluates Probability Density Functions (PDF) and produces random samples from them, including beta, binomial, chi, exponential, gamma, inverse chi, inverse gamma, multinomial, normal, scaled inverse chi, and uniform.
  206. perceptron, a Python code which demonstrates the calculation of a classifier of linearly separable data using the perceptron algorithm.
  207. pgma_io, a Python code which reads or writes ASCII Portable Gray Map (PGM) 2D graphics files;
  208. pgmb_io, a Python code which reads or writes a binary Portable Gray Map (PGM) 2D graphics file;
  209. pink_noise, a Python code which computes a pink noise signal obeying a 1/f power law.
  210. pip3_test
  211. polpak, a Python code which evaluates a variety of mathematical functions, including Chebyshev, Gegenbauer, Hermite, Jacobi, Laguerre, Legendre polynomials, and the Collatz sequence.
  212. polygon_grid, a Python code which generates a grid of points over the interior of a polygon in 2D.
  213. polygon_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of a polygon in 2D.
  214. polygon_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function over the interior of a polygon in 2D.
  215. polygon_properties, a Python code which computes properties of an arbitrary polygon in the plane, defined by a sequence of vertices, including interior angles, area, centroid, containment of a point, convexity, diameter, distance to a point, inradius, lattice area, nearest point in set, outradius, uniform sampling.
  216. polygon_triangulate, a Python code which triangulates a possibly nonconvex polygon in 2D, and which can use gnuplot to display the external edges and internal diagonals of the triangulation.
  217. polynomial, a Python code which adds, multiplies, differentiates, evaluates and prints multivariate polynomials in a space of M dimensions.
  218. polynomials, a Python code which defines multivariate polynomials over rectangular domains, for which certain information is to be determined, such as the maximum and minimum values.
  219. polyomino_parity, a Python code which uses parity considerations to determine whether a given set of polyominoes can tile a specified region.
  220. polyominoes, a Python code which manipulates polyominoes and tilings.
  221. ppma_io, a Python code which reads or writes an ASCII Portable Pixel Map (PPM) 2D graphics file;
  222. ppmb_io, a Python code which reads or writes a binary Portable Pixel Map (PPM) 2D graphics file;
  223. praxis, a Python code which minimizes a scalar function of several variables, without requiring derivative information, by Richard Brent.
  224. predator_prey_ode, a Python code which solves a time-dependent predator-prey system of ordinary differential equations (ODE).
  225. prime, a Python code which counts the number of primes between 1 and N, intended as a starting point for a parallel version.
  226. prime_mpi, a Python code which counts the number of primes between 1 and N, carried out in parallel using MPI and MPI4PY.
  227. prob, a Python code which evaluates, samples, inverts, and characterizes a number of Probability Density Functions (PDF) and Cumulative Density Functions (CDF), including anglit, arcsin, benford, birthday, bernoulli, beta_binomial, beta, binomial, bradford, burr, cardiod, cauchy, chi, chi squared, circular, cosine, deranged, dipole, dirichlet mixture, discrete, empirical, english sentence and word length, error, exponential, extreme values, f, fisk, folded normal, frechet, gamma, generalized logistic, geometric, gompertz, gumbel, half normal, hypergeometric, inverse gaussian, laplace, levy, logistic, log normal, log series, log uniform, lorentz, maxwell, multinomial, nakagami, negative binomial, normal, pareto, planck, poisson, power, quasigeometric, rayleigh, reciprocal, runs, sech, semicircular, student t, triangle, uniform, von mises, weibull, zipf.
  228. pwl_interp_1d, a Python code which interpolates a set of data using a piecewise linear function in 1D.
  229. pwl_interp_2d, a Python code which interpolates a set of data using a piecewise linear function in 2D.
  230. py_test, Python codes which illustrate various features of Python programming.
  231. python_intrinsics_test, a Python code which demonstrates some of the intrinsic functions in the Python language.
  232. python_mistake, Python codes which illustrate mistakes caused by Python, encouraged by Python, or made difficult to spot because of Python.
  233. pytorch_test, Python codes which illustrate certain features of pytorch.
  234. pyramid_grid, a Python code which computes a grid of points over the interior of the unit pyramid in 3D;
  235. pyramid_monte_carlo, a Python code which applies a Monte Carlo (MC) method to estimate integrals of a function over the interior of the unit pyramid in 3D;
  236. quad_mpi, a Python code which approximates an integral using a quadrature rule, carried out in parallel using MPI and MPI4PY.
  237. quad_serial, a Python code which applies a quadrature rule to estimate an integral, intended as a starting point for parallelization exercises.
  238. quadrule, a Python code which implements rules for approximate integration (quadrature) in one dimension;
  239. quasiperiodic_ode, a Python code which sets up a system of ordinary differential equations (ODE) for a problem with a quasiperiodic solution.
  240. quaternions, a Python code which carries out some simple arithmetic operations for quaternions.
  241. r4lib, a Python code which contains many utility routines, using single precision real (R4) arithmetic.
  242. r83, a Python code which contains linear algebra routines for r83 matrices (real, 64 bit, tridiagonal 3xN format).
  243. r8col, a Python code which contains utility routines for an R8COL, that is, a double precision real MxN array, considered as N column vectors, each of length M. The data may be thought of as a matrix of multiple columns, and many operations will be carried out columnwise.
  244. r8ge, a Python code which contains linear algebra routines for R8GE matrices (real, 64 bit, General format).
  245. r8lib, a Python code which contains many utility routines, using double precision real (R8) arithmetic.
  246. r8lt, a Python code which contains linear algebra routines for R8LT matrices (real, 64 bit, Lower Triangular).
  247. r8poly, a Python code which contains a number of utilities for polynomials with R8 coefficients, that is, using double precision or 64 bit real arithmetic.
  248. r8row, a Python code which contains utility routines for an R8ROW, that is, an double precision real MxN array, considered as M row vectors, each of length N. The data may be thought of as a matrix of multiple rows, and many operations will be carried out rowwise.
  249. r8st, a Python code which contains linear algebra routines for R8ST matrices (real, 64 bit, Sparse Triplet (ST)).
  250. r8ut, a Python code which contains linear algebra routines for R8UT matrices (real, 64 bit, Upper Triangular).
  251. randlc, a Python code which implements a random number generator (RNG) used by the NAS Benchmark programs.
  252. random_data, a Python code which uses a random number generator (RNG) to sample points for various probability distributions, spatial dimensions, and geometries, including the M-dimensional cube, ellipsoid, simplex and sphere.
  253. random_matrix_eigenvalues, a Python code which demonstrates how, for certain probability density functions (PDF), a symmetric matrix with entries sampled from that PDF will have eigenvalues distributed according to the Wigner semicircle distribution.
  254. random_sorted, a Python code which generates vectors of random values which are already sorted.
  255. ranlib, a Python code which produces random samples from Probability Density Functions (PDF), including Beta, Chi-square Exponential, F, Gamma, Multivariate normal, Noncentral chi-square, Noncentral F, Univariate normal, random permutations, Real uniform, Binomial, Negative Binomial, Multinomial, Poisson and Integer uniform, by Barry Brown and James Lovato.
  256. rbf_interp_1d, a Python code which defines and evaluates radial basis function (RBF) interpolants to 1D data.
  257. rbf_interp_2d, a Python code which defines radial basis function (RBF) interpolants to 2D data.
  258. rk4, a Python code which applies the fourth order Runge-Kutta (RK) algorithm to estimate the solution of an ordinary differential equation (ODE) at the next time step.
  259. rkf45, a Python code which implements the Runge-Kutta-Fehlberg (RKF) solver for the approximate solution of an ordinary differential equation (ODE) system.
  260. rnglib, a Python code which implements a random number generator (RNG) with splitting facilities, allowing multiple independent streams to be computed, by L'Ecuyer and Cote.
  261. robertson_ode, a Python code which sets up a system of three nonlinear stiff ordinary differential equations (ODE) characterizing an autocatalytic chemical reaction.
  262. roessler_ode, a Python code which defines the right hand side of the Roessler ODE system.
  263. root_rc, a Python code which seeks a solution of a scalar nonlinear equation f(x)=0, using reverse communication (RC), by Gaston Gonnet.
  264. roots_rc, a Python code which seeks solutions of a system of nonlinear equations, using reverse communication (RC), by Gaston Gonnet.
  265. rot13, a Python code which makes a copy of a file which has been encoded using the ROT13 coding and a ROT5 coding for digits.
  266. row_echelon_integer, a Python code which carries out the exact computation of the integer row echelon form (IREF) and integer reduced row echelon form (IRREF) of an integer matrix.
  267. rubber_band_ode, a Python code which defines and solves a set of ordinary differential equations (ODE) describing a mass suspended by a spring and rubber band, which can exhibit chaotic behavior.
  268. sammon_data, a Python code which generates six examples of M dimensional datasets for cluster analysis.
  269. satisfy, a Python code which demonstrates, for a particular circuit, an exhaustive search for solutions of the circuit satisfiability problem.
  270. search_mpi, a Python code which searches integers between A and B for a solution J such that F(J)=C, carried out in parallel using MPI and MPI4PY.
  271. search_serial, a Python code which searches integers between A and B for a solution J such that F(J)=C, intended as a starting point for parallelization exercises.
  272. sftpack, a Python code which implements the slow Fourier transform (SFT), intended as a teaching tool and comparison with the fast Fourier transform (FFT).
  273. shallow_water_1d, a Python code which simulates the evolution of a 1D fluid governed by the time-dependent shallow water equations.
  274. shepard_interp_1d, a Python code which defines and evaluates Shepard interpolants to 1D data, based on inverse distance weighting.
  275. simplex_coordinates, a Python code which computes the Cartesian coordinates of the vertices of a regular simplex in M dimensions.
  276. simplex_gm_rule, a Python code which defines Grundmann-Moeller quadrature rules over the interior of a triangle in 2D, a tetrahedron in 3D, or over the interior of the simplex in M dimensions.
  277. simplex_grid, a Python code which generates a regular grid of points over the interior of an arbitrary simplex in M dimensions.
  278. simplex_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit simplex in M dimensions.
  279. simplex_monte_carlo, a Python code which uses the Monte Carlo method to estimate an integral over the interior of the unit simplex in M dimensions.
  280. sine_transform, a Python code which demonstrates simple properties of the discrete sine transform (DST).
  281. snakes_and_ladders, a Python code which simulates the game of Snakes and Ladders, and estimates the average number of moves in a one-player game.
  282. sobol, a Python code which computes elements of a Sobol Quasi Monte Carlo (QMC) sequence.
  283. solve, a Python code which demonstrates how Gauss elimination can be used to solve a linear system A*x=b.
  284. sort_rc, a Python code which can sort a list of any kind of objects, using reverse communication (RC).
  285. sphere_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected from the surface of the unit sphere in 3D.
  286. sphere_fibonacci_grid, a Python code which uses a Fibonacci spiral to create a grid of points on the surface of the unit sphere in 3D.
  287. sphere_integrals, a Python code which returns the exact value of the integral of any monomial over the surface of the unit sphere in 3D.
  288. sphere_llq_grid, a Python code which uses longitudes and latitudes to create grids of points, lines, and quadrilaterals on the surface of the unit sphere in 3D.
  289. sphere_llt_grid, a Python code which uses longitudes and latitudes to create grids of points, lines, and triangles on the surface of the unit sphere in 3D.
  290. sphere_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function on the surface of the unit sphere in 3D.
  291. sphere_ode, a Python code which sets up the ordinary differential equations (ODE) which model motion on the surface of a sphere.
  292. spiral_data, a Python code which computes a velocity vector field that satisfies the continuity equation, writing the data to a file that can be plotted by gnuplot.
  293. square_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected inside the unit square.
  294. square_grid, a Python code which computes a grid of points over the interior of a square in 2D.
  295. square_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit square or symmetric unit square in 2D.
  296. square_minimal_rule, a Python code which returns "almost minimal" quadrature rules, with exactness up to total degree 55, over the interior of the symmetric square in 2D, by Mattia Festa and Alvise Sommariva.
  297. square_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function over the interior of the unit square in 2D.
  298. st_io a Python code which reads and writes sparse linear systems stored in the Sparse Triplet (ST) format.
  299. stiff_ode, a Python code which considers an ordinary differential equation (ODE) which is an example of a stiff ODE.
  300. stochastic_diffusion, a Python code which implements several versions of a stochastic diffusivity coefficient.
  301. stokes_2d_exact, a Python code which evaluates exact solutions to the incompressible steady Stokes equations over the unit square in 2D.
  302. subset, a Python code which enumerates, generates, randomizes, ranks and unranks combinatorial objects including combinations, compositions, Gray codes, index sets, partitions, permutations, polynomials, subsets, and Young tables. Backtracking routines are included to solve some combinatorial problems.
  303. subset_sum, a Python code which seeks solutions of the subset sum problem.
  304. svd_snowfall, a Python code which reads a file containing historical snowfall data and analyzes the data with the Singular Value Decomposition (SVD), displaying the results using gnuplot.
  305. svd_test, a Python code which demonstrates the calculation of the singular value decomposition (SVD) and some of its properties;
  306. table_io, a Python code which reads and writes files (not very much here yet.)
  307. test_eigen, a Python code which implements test matrices for eigenvalue analysis.
  308. test_interp, a Python code which defines test problems for interpolation, provided as a set of (x,y(x)) data.
  309. test_interp_1d, a Python code which defines test problems for interpolation of data y(x), which depends on a 1D argument.
  310. test_interp_2d, a Python code which defines test problems for interpolation of data z(x,y), which depends on a 2D argument.
  311. test_lls, a Python code which implements linear least squares test problems of the form A*x=b.
  312. test_mat, a Python code which defines test matrices for which some of the determinant, eigenvalues, inverse, null vectors, P*L*U factorization or linear system solution are already known, including the Vandermonde and Wathen matrix.
  313. test_matrix_exponential, a Python code which defines a set of test cases for computing the matrix exponential.
  314. test_min, a Python code which implements test problems for minimization of a scalar function of a scalar variable.
  315. test_optimization, a Python code which implements test problems for optimization of a scalar function of several variables, as described by Molga and Smutnicki.
  316. test_values, a Python code which returns selected values of some special functions;
  317. test_zero, a Python code which defines some functions f(x) suitable for testing software that solves f(x)=0;
  318. tester, a BASH script which runs the test codes.
  319. tetrahedron_grid, a Python code which computes a grid of points over the interior of a tetrahedron in 3D.
  320. tetrahedron_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit tetrahedron in 3D.
  321. tetrahedron_monte_carlo, a Python code which uses the Monte Carlo method to estimate an integral over the interior of the unit tetrahedron in 3D.
  322. timer, a Python code which implements various real time and CPU time tests.
  323. timestamp, a Python code which prints the current YMDHMS date as a timestamp.
  324. toeplitz_cholesky, a Python code which computes the Cholesky factorization of a nonnegative definite symmetric Toeplitz matrix.
  325. toms097, a Python code which computes the distance between all pairs of nodes in a directed graph with weighted edges, using the Floyd algorithm. This is a version of ACM TOMS algorithm 97.
  326. toms112, a Python code which determines whether a point is contained in a polygon, by Moshe Shimrat. This is a version of ACM TOMS algorithm 112.
  327. toms178, a Python code which seeks the minimizer of a function of several variables, using the Hooke-Jeeves direct search method, by Arthur Kaupe. This is a version of ACM TOMS algorithm 178.
  328. toms179, a Python code which calculates the incomplete Beta ratio, by Oliver Ludwig. This is a version of ACM TOMS algorithm 179.
  329. toms243, a Python code which evaluates the logarithm of a complex value, by David Collens. This is a version of ACM TOMS algorithm 243.
  330. toms515, a Python code which can select subsets of size K from a set of size N. This is a version of ACM TOMS Algorithm 515, by Bill Buckles, Matthew Lybanon.
  331. toms577, a Python code which evaluates the Carlson elliptic integral functions RC, RD, RF and RJ. This is a version of ACM TOMS algorithm 577.
  332. toms655, a Python code which computes the weights for interpolatory quadrature rule; this library is commonly called IQPACK, by Sylvan Elhay and Jaroslav Kautsky. This is a version of ACM TOMS algorithm 655. (Only a small portion of this library has been implemented in Python so far!)
  333. toms743, a Python code which evaluates the Lambert W function. This is a version of ACM TOMS algorithm 743, by Barry, Barry and Culligan-Hensley.
  334. toms923, a Python code which evaluates the Pfaffian for a dense or banded skew symmetric matrix, by Michael Wimmer.
  335. triangle_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected from the interior of a triangle in 2D.
  336. triangle_grid, a Python code which computes a grid of points over the interior of a triangle in 2D.
  337. triangle_integrals, a Python code which returns the exact value of the integral of any polynomial over the interior of a general triangle in 2D.
  338. triangle_interpolate, a Python code which shows how vertex data can be interpolated at any point in the interior of a triangle.
  339. triangle_monte_carlo, a Python code which uses the Monte Carlo method to estimate an integral over the interior of a general triangle in 2D.
  340. triangle_properties, a Python code which can compute properties, including angles, area, centroid, circumcircle, edge lengths, incircle, orientation, orthocenter, and quality, of a triangle in 2D.
  341. triangle_twb_rule, a Python code which generates the points and weights of quadrature rules over the interior of a triangle in 2D, determined by Taylor, Wingate, and Bos.
  342. triangle01_integrals, a Python code which returns the integral of any monomial over the interior of the unit triangle in 2D.
  343. triangle01_monte_carlo, a Python code which uses the Monte Carlo method to estimate the integral of any function over the interior of the unit triangle in 2D.
  344. truncated_normal, a Python code which works with the truncated normal distribution over [A,B], or [A,+oo) or (-oo,B], returning the probability density function (PDF), the cumulative density function (CDF), the inverse CDF, the mean, the variance, and sample values.
  345. truncated_normal_rule, a Python code which computes a quadrature rule for a normal probability density function (PDF), sometimes called a Gaussian distribution, that has been truncated to [A,+oo), (-oo,B] or [A,B].
  346. tsp_brute, a Python code which reads a file of city-to-city distances and solves a (small!) traveling salesperson problem (TSP), using brute force.
  347. ubvec, a Python code which demonstrates how nonnegative integers can be stored as unsigned binary vectors, and arithmetic can be performed on them.
  348. unicycle, a Python code which considers permutations containing a single cycle, sometimes called cyclic permutations.
  349. uniform, a Python code which contains uniform random number generators (RNG) for several arithmetic types.
  350. upc, a Python code which can compute the check digit associated with a uniform product code (UPC), or it can report whether a 12-digit UPC is actually valid.
  351. van_der_corput, a Python code which computes elements of the van der Corput 1-dimensional Quasi Monte Carlo (QMC) sequence, using a simple interface.
  352. vandermonde_interp_1d, a Python code which finds a polynomial interpolant to data y(x) of a 1D argument by setting up and solving a linear system for the polynomial coefficients involving the Vandermonde matrix, creating graphics with matplotlib.
  353. voronoi_plot, a Python code which estimates the Voronoi neighborhoods of points using sampling, and with a distance based on the L1, L2, LInfinity or arbitrary LP norms;
  354. voronoi_test, a Python code which demonstrates the use of the scipy.spatial function Voronoi(), to compute a Voronoi diagram, and voronoi_plot_2d(), to display it.
  355. walker_sample, a Python code which efficiently samples a discrete probability density function (PDF) represented by a vector, using Walker sampling.
  356. walsh, a Python code which implements versions of the Walsh and Haar transforms.
  357. wathen, a Python code which compares storage schemes (full, banded, sparse triplet, sparse) and solution strategies (A\x, Linpack, conjugate gradient) for linear systems involving the Wathen matrix, which can arise when solving a problem using the finite element method (FEM).
  358. wedge_grid, a Python code which computes a grid of points over the interior of the unit wedge in 3D.
  359. wedge_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit wedge in 3D.
  360. wedge_monte_carlo, a Python code which uses the Monte Carlo method to estimate an integral over the interior of the unit wedge in 3D.
  361. weekday, a Python code which determines the day of the week corresponding to a given date, such as 14 October 1066, Julian calendar, ... which was a Saturday.
  362. weekday_zeller, a Python code which uses the Zeller congruence to determine the day of the week corresponding to a given date, such as 13 July 1989, Gregorian calendar, ... which was a Thursday.
  363. wtime, a Python code which shows how to return a reading of the wall clock time.
  364. xml_to_fem, a Python code which reads an XML file created by dolfin() or fenics(), describing a mesh in 1D, 2D, or 3D, and extracts two sets of information, namely, the coordinates of nodes, and the indices of nodes that form each element, which constitute a finite element method (FEM) mesh of the geometry.
  365. zero_rc, a Python code which seeks solutions of a scalar nonlinear equation f(x)=0, or a system of nonlinear equations, using reverse communication (RC).


Last revised on 26 July 2020.