Python Source


  1. allen_cahn_pde, a Python code which sets up the Allen-Cahn reaction-diffusion partial differential equations (PDE) in one space dimension and time.
  2. alpert_rule, a Python code which sets 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. anishchenko_ode, a Python code which sets up and solves the Anishchenko ordinary differential equation (ODE), which has chaotic behavior and an attractor.
  6. annulus_distance, a Python code which estimates the typical distance between a pair of points randomly selected inside a circular annulus.
  7. annulus_grid, a Python code which computes a grid of points over the interior of a circular annulus.
  8. annulus_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of an annulus centered at the origin.
  9. 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.
  10. 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.
  11. approx_bernstein, a Python code which approximates a function f(x) in the interval [a,b] by constructing a Bernstein polynomial of order n.
  12. arclength, a Python code which estimates the arclength of curves of the form (x,f(x)) or (x(t),y(t)).
  13. arenstorf_ode, a Python code which sets up an ordinary differential equation (ODE) which defines a stable periodic orbit of a spacecraft around the Earth and the Moon.
  14. args, a Python code which reports the command line arguments with which it was invoked;
  15. arneodo_ode, a Python code which sets up and solves the Arneodo ordinary differential equation (ODE), which has chaotic behavior and an attractor.
  16. asa005, a Python code which evaluates the Cumulative Density Function (CDF) of the noncentral T Probability Density Function (PDF), by BE Cooper. This is a version of Applied Statistics Algorithm 5;
  17. asa006, a Python code which computes the Cholesky factorization of a symmetric positive definite (SPD) matrix, by Michael Healy. This is a version of Applied Statistics Algorithm 6;
  18. asa007, a Python code which computes the inverse of a symmetric positive definite (SPD) matrix, by Michael Healy. This is a version of Applied Statistics Algorithm 7.
  19. asa032, a Python code which evaluates the incomplete Gamma function, by G Bhattacharjee. This is a version of Applied Statistics Algorithm 32.
  20. 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.
  21. 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.
  22. 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.
  23. asa066, a Python code which evaluates the Cumulative Density Function (CDF) of the normal distribution, by David Hill. This is a version of Applied Statistics Algorithm 66.
  24. asa076, a Python code which evaluates the Owen T function, needed to compute the Cumulative Density Function (CDF) of the noncentral T distribution, by Young and Minder. This is a version of Applied Statistics Algorithm 76.
  25. asa082, a Python code which computes the determinant of an orthogonal matrix; this is a version of Applied Statistics Algorithm 82, by J C Gower.
  26. asa091, a Python code which evaluates the percentage points of the Chi-Squared distribution, by Best and Roberts. This is a version of Applied Statistics Algorithm 91.
  27. asa103, a Python code which evaluates the digamma or psi function, by Jose Bernardo. This is a version of Applied Statistics Algorithm 103.
  28. asa109, a Python code which inverts the incomplete Beta function, by Cran, Martin and Thomas. This is a version of Applied Statistics Algorithm 109.
  29. asa111, a Python code which evaluates the percentage points of the normal distribution, by Beasley and Springer. This is a version of Applied Statistics Algorithm 111.
  30. asa121, a Python code which evaluates the trigamma function, by BE Schneider. This is a version of Applied Statistics Algorithm 121.
  31. asa147, a Python code which evaluates the incomplete Gamma function, by Chi Leung Lau. This is a version of Applied Statistics Algorithm 147.
  32. asa152, a Python code which evaluates the Probability Density Function (PDF) and Cumulative Density Function (CDF) associated with the hypergeometric distribution, by Richard Lund; this is a version of Applied Statistics Algorithm 152.
  33. asa183, a Python code which implements a random number generator (RNG), by Wichman and Hill. This is a version of Applied Statistics Algorithm 183.
  34. asa226, a Python code which evaluates the Cumulative Density Function (CDF) of the noncentral Beta distribution, by Russell Lenth. This is a version of Applied Statistics Algorithm 226.
  35. asa239, a Python code which evaluates the incomplete Gamma function, by Shea. This is a version of Applied Statistics Algorithm 239.
  36. asa241, a Python code which evaluates the percentage points of the normal distribution, by Michael Wichura. This is a version of Applied Statistics Algorithm 241.
  37. asa243, a Python code which evaluates the Cumulative Density Function (CDF) of the noncentral T distribution, by Russell Lenth; this is a version of Applied Statistics Algorithm 243.
  38. asa245, a Python code which evaluates the logarithm of the Gamma function, by Allan Mcleod; this is a version of Applied Statistics Algorithm 245.
  39. asa299, a Python code which computes the lattice points in an M-dimensional simplex, by Chasalow and Brand; this is a version of Applied Statistics Algorithm 299;
  40. atbash, a Python code which applies the Atbash substitution cipher to a string of text.
  41. autocatalytic_ode, a Python code which sets up and solves the autocatalytic ordinary differential equation (ODE), which has chaotic behavior and an attractor.
  42. axon_ode, a Python code which sets up the ordinary differential equations (ODE) for the Hodgkin-Huxley model of an axon.
  43. backtrack_binary_rc, a Python code which carries out a backtrack search for a set of binary decisions, using reverse communication (RC).
  44. backward_euler, a Python code which solves one or more ordinary differential equations (ODE) using the (implicit) backward Euler method, using fsolve() for the implicit equation.
  45. backward_euler_fixed, a Python code which solves one or more ordinary differential equations (ODE) using the (implicit) backward Euler method, using fixed point iteration for the implicit equation.
  46. 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.
  47. ball_grid, a Python code which computes grid points inside a 3D ball.
  48. 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.
  49. 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;
  50. ball_positive_distance, a Python code which computes the expected value of the distance between a pair of points randomly selected from the interior of the unit positive ball in 3D.
  51. 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.
  52. 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.
  53. bdf2, a Python code which solves one or more ordinary differential equations (ODE) using BDF2, the (implicit) backward difference formula of order 2, using fsolve() to solve the implicit equation.
  54. 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.
  55. bernstein_approximation, a Python code which looks at some simple cases of approximation of a function f(x) by a Bernstein polynomial.
  56. bernstein_polynomial, a Python code which evaluates the Bernstein polynomials;
  57. besselj, a Python code which evaluates Bessel J functions of noninteger order;
  58. bicycle_lock, a Python code which simulates the process of determining the secret combination of a bicycle lock, an integer between 000 and 999.
  59. biochemical_linear_ode, a Python code which sets up a linear biochemical ordinary differential equation (ODE).
  60. biochemical_nonlinear_ode, a Python code which sets up a nonlinear biochemical ordinary differential equation (ODE).
  61. bioconvection_ode, a Python code which approximates solutions to a system of ordinary differential equations (ODE) which model a bioconvection problem, and which are related to the Lorenz system.
  62. bird_egg, a Python code which evaluates some formulas for the shapes of bird eggs.
  63. 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.
  64. 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).
  65. black_scholes, a Python code which implements some simple approaches to the Black-Scholes option valuation theory, by Desmond Higham.
  66. blood_pressure_ode, a Python code which sets up and solves an ordinary differential equation (ODE) which models the variation in blood pressure in the human artery.
  67. blowup_ode, a Python code which sets up an ordinary differential equation (ODE) y'=y^2. whose solution "blows up" in finite time.
  68. boundary_locus, a Python code which uses the boundary locus method to display the region of absolute stability for a solver of ordinary differential equations (ODE).
  69. boundary_locus2, a Python code which uses the boundary locus method to plot the boundary of the absolute stability region for a solver of ordinary differential equations (ODE), based on a procedure by Randall Leveque.
  70. boundary_word_square, a Python code which describes the outline of an object on a grid of squares, using a string of symbols that represent the sequence of steps tracing out the boundary.
  71. box_distance, a Python code which estimates the distribution and expected value of the distance between two points picked uniformly at random within a box.
  72. brownian_motion_simulation, a Python code which simulates Brownian motion in an M dimensional region.
  73. broyden, a Python code which implements the Broyden iterative method for nonlinear equations, by Tim Kelley.
  74. brusselator_ode, a Python code which sets up the Brusselator ordinary differential equation (ODE) system.
  75. burgers_solution, a Python code which evaluates exact solutions of the time-dependent 1D viscous Burgers equation.
  76. bvp_fd, a Python code which demonstrates the use of the finite difference method (FDM) to solve a boundary value problem (BVP).
  77. bvec, a Python code which demonstrates how signed integers can be stored as binary vectors, and arithmetic can be performed on them.
  78. c8lib, a Python code which implements certain elementary functions for 64 bit precision complex (C8) variables;
  79. caesar, a Python code which applies a Caesar Shift Cipher to a string of text.
  80. calpak, a Python code which makes various calendar calculations;
  81. casino_simulation, a Python code which simulates a casino game that gives you 20% of your bet for heads, and only takes 17% for tails. How much will you end up winning?
  82. cauchy_method, a Python code which solves one or more ordinary differential equations (ODE) using the Cauchy method.
  83. cauchy_principal_value, a Python code which uses Gauss-Legendre quadrature to estimate the Cauchy Principal Value (CPV) of certain singular integrals.
  84. caustic, a Python code which generates an image of a caustic, by drawing n equally spaced points in a circle, and then connecting specific pairs of points using a spacing parameter m.
  85. ccn_rule, a Python code which defines a Clenshaw Curtis Nested (CCN) quadrature rule.
  86. ccs_io a Python code which reads and writes sparse linear systems stored in the Compressed Column Storage (CCS) format.
  87. ccs_to_st a Python code which converts a sparse matrix from Compressed Column Storage (CCS) to sparse triplet (ST) format.
  88. cellular_automaton, a Python code which prints or plots the evolution of Cellular Automaton rule #30.
  89. cfd_barba, a Python code which contains some of the iPython workbooks associated with the "12 Steps to Navier-Stokes" presentation by Lorena Barba.
  90. 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 symmetric positive definite (SPD).
  91. cg_rc, a Python code which implements the conjugate gradient (CG) method for solving a symmetric positive definite (SPD) sparse linear system A*x=b, using reverse communication (RC).
  92. change_diophantine, a Python code which sets up a Diophantine equation to solve the change making problem, which counts the number of ways a given sum can be formed using coins of various denominations.
  93. change_dynamic, a Python code which uses dynamic programming to solve the change making problem, in which a given sum is to be formed using coins of various denominations.
  94. change_greedy, a Python code which uses the greedy method to seek a solution to the change making problem, which tries to match a given amount by selecting coins of various denominations.
  95. change_polynomial, a Python code which uses a polynomial multiplication algorithm to count the ways of making various sums using a given number of coins.
  96. chebyshev, a Python code which computes the Chebyshev interpolant/approximant to a given function over an interval.
  97. 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).
  98. 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.
  99. chebyshev1_exactness, a Python code which tests the exactness of Gauss-Chebyshev type 1 quadrature rules.
  100. chebyshev1_rule, a Python code which computes and writes out a Gauss-Chebyshev type 1 quadrature rule of given order.
  101. chebyshev2_exactness, a Python code which tests the exactness of Gauss-Chebyshev type 2 quadrature rules.
  102. chebyshev2_rule, a Python code which computes and writes out a Gauss-Chebyshev type 2 quadrature rule of given order.
  103. chen_ode, a Python code which sets up and solves the Chen system of ordinary differential equations (ODE).
  104. chinese_remainder_theorem, a Python code which demonstrates the Chinese remainder theorem, for reconstructing a number based on its remainders against a set of bases.
  105. chrpak, a Python code which manipulates characters and strings;
  106. chuckaluck_simulation, a Python code which simulates the Chuck-a-Luck gambling game.
  107. circle_arc_grid, a Python code which computes grid points along a circular arc.
  108. 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.
  109. 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.
  110. 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;
  111. circle_positive_distance, a Python code which estimates the mean and variance of the distance between a random pair of points on the circumference of the unit positive circle in 2D.
  112. circle_rule, a Python code which computes quadrature rules for the unit circle in 2D, to approximate integrals of f(x,y) over the circumference of the circle of radius 1 and center (0,0).
  113. clausen, a Python code which evaluates a Chebyshev interpolant to the Clausen function Cl2(x).
  114. clenshaw_curtis_rule, a Python code which implements a Clenshaw Curtis quadrature rule;
  115. clock_solitaire_simulation, a Python code which simulates the game of clock solitaire. The deck is dealt into 13 piles of 4 cards each. Repeatedly, the top card a pile is removed, and its rank indicates the next pile to consider. Game continues until an empty pile is reached. The game is won if all piles are empty. The quantity of interest is the probability of winning.
  116. closest_pair_brute, a Python code which uses brute force to solve a 2D version of the closest pair problem, which identifies the closest pair of points in a given collection.
  117. cobweb_plot, a Python library which displays a cobweb plot illustrating the process of function iteration, by John D Cook.
  118. coin_simulation, a Python code which looks at ways of simulating or visualizing the results of many tosses of a fair or biased coin.
  119. collatz, a Python code which computes and analyzes the Collatz sequence, also known as the hailstone sequence or 3n+1 sequence;
  120. collatz_dict, a Python code which demonstrates how the Python dict variable type can be used to efficiently record data about the Collatz iteration.
  121. collatz_polynomial, a Python code which implements the Collatz polynomial iteration, a polynomial analog of the numerical iteration that is also known as the 3n+1 conjecture or the hailstone sequence.
  122. collatz_recursive, a Python code which demonstrates recursive programming by considering the simple Collatz 3n+1 problem.
  123. columns, a Python code which copies columns clo:chi from a text file to a new text file.
  124. combination_lock, a Python code which simulates the process of determining the secret combination of a lock.
  125. 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.
  126. companion_matrix, a Python code which computes the companion matrix for a polynomial. The polynomial may be represented in the standard monomial basis, or as a sum of Chebyshev, Gegenbauer, Hermite, Laguerre, or Lagrange basis polynomials. All the roots of the polynomial can be determined as the eigenvalues of the corresponding companion matrix.
  127. 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.
  128. complex_numbers_test, demonstrates some of the features of using complex numbers.
  129. components, a Python code which organizes contiguous cells into labeled clusters, for a 1D, 2D, or 3D array. This code has uses in image analysis and percolation simulation.
  130. condition, a Python code which implements methods of computing or estimating the condition number of a matrix.
  131. conservation_ode, a Python code which monitors the conservation of a quantity that should be constant, during the solution of an ordinary differential equation (ODE).
  132. continued_fraction, a Python code which implements some simple algorithms for dealing with simple and generalized continued fractions.
  133. ConvexHull_test, a Python code which calls ConvexHull(), which is a scipy.spatial function to compute the convex hull of a set of points.
  134. cordic, a Python code which computes a few special functions using the CORDIC algorithm.
  135. cosine_transform, a Python code which demonstrates some simple properties of the discrete cosine transform (DCT).
  136. 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.
  137. cpr, a Python code which implements the Chebyshev Proxy Rootfinder (CPR) to locate all the real zeros of a smooth real function f(x) within an interval [a,b], by John Boyd.
  138. craps_simulation, a Python code which simulates the gambling game of craps, in which a player rolls two dice. On the first roll, the player wins immediately if a 7 or 11 is rolled, and loses immediately if a 2, 3 or 12 is rolled. Otherwise, the sum of the dice on this first roll is called the point. The player now continues to roll the dice, winning if the point is rolled again, and losing if a 7 is rolled.
  139. crs_io a Python code which reads and writes sparse linear systems stored in the Compressed Row Storage (CRS) format.
  140. csv_test, a Python code which tests the csv() library for reading and writing Comma Separated Value (CSV) data files.
  141. 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.
  142. cube_exactness, a Python code which tests the exactness of quadrature rules over the interior of a cube in 3D.
  143. cube_grid, a Python code which computes a grid of points over the interior of a cube in 3D.
  144. 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.
  145. 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.
  146. cube_surface_distance, a Python code which estimates the expected value of the distance between a pair of points randomly selected on the surface of the unit cube.
  147. cuda_loop, a Python code which shows how, in a CUDA program running on a Graphics Processing Unit (GPU), the choice of block and thread factors determines the allocation of tasks to processors.
  148. 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.
  149. cvt_1d_sampling, a Python code which computes an N-point Centroidal Voronoi Tessellation (CVT) within the interval [0,1], under a uniform density, using sampling to estimate the Voronoi regions.
  150. 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.
  151. 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().
  152. cvxopt_test, a Python code which calls cvxopt(), which solves problems in convex optimization and quadratic programming.
  153. 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.
  154. 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.
  155. 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.
  156. delsq, a Python code which is given a grid G, and returns a corresponding sparse matrix D that defines the Laplacian operator on G.
  157. dg1d_poisson, a Python code which applies the discontinuous Galerkin method (DG) to a 1D version of the Poisson equation, based on a code by Beatrice Riviere.
  158. dice_simulation, a Python code which simulates N tosses of M dice, making a histogram of the resulting sums.
  159. differ, a Python code which determines the finite difference coefficients necessary in order to combine function values at known locations to compute an approximation of given accuracy to a derivative of a given order.
  160. digital_dice, a Python code which carries out the probability simulations described in "Digital Dice", by Paul Nahin;
  161. digraph_adj, a Python code which carries out operations on abstract digraphs, a kind of graph with directed edges, described by an adjacency matrix.
  162. digraph_dict, a Python code which carries out operations on abstract digraphs, with directed edges, represented by a Python dictionary. The dictionary has a key for each node; the values list the nodes which are immediately reachable from the key node.
  163. dijkstra, a Python code which implements a simple version of the Dijkstra minimum distance algorithm for graphs.
  164. diophantine, a Python code which finds one solution of a Diophantine equation in any number of variables.
  165. diophantine_nd, a Python code which is given a Diophantine equation in N variables, and returns all nonnegative solutions, or all strictly positive solutions.
  166. 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.
  167. 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.
  168. disk_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of a disk of radius R centered at the origin.
  169. disk_integrands, a Python code which defines several test integrals over the unit disk, making it possible to check the accuracy of quadrature rules.
  170. 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;
  171. disk_positive_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 positive disk.
  172. disk_rule, a Python code which computes a quadrature rule over the interior of the general disk in 2D.
  173. disk_triangle_picking, a Python code which estimates the expected value of the area of a triangle formed by three randomly selected points in the unit disk.
  174. 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.
  175. disk01_integrands, a Python code which defines several test integrals over the unit disk, making it possible to check the accuracy of quadrature rules.
  176. 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;
  177. disk01_positive_monte_carlo, a Python code which applies a Monte Carlo method to estimate integrals of a function over the interior of the unit positive disk in 2D;
  178. 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).
  179. dolfin-convert, a Python code which converts mesh file from gmsh(), medit(), METIS or SCOTCH format to an XML format suitable for use by dolfin() or fenics(), by Anders Logg.
  180. 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.
  181. dosage_ode, a Python code which sets up a system of ordinary differential equations (ODE) to simulate the blood levels of a medicinal drug that should stay between medicinal and toxic limits.
  182. double_well_ode, a Python code which sets up an ordinary differential equation (ODE) which models the motion of a particle in a double well potential.
  183. duel_simulation, a Python code which simulates N repetitions of a duel between two players, each of whom has a known firing accuracy.
  184. dueling_idiots, a Python code which carries out the probability simulations described in "Dueling Idiots", by Paul Nahin;
  185. duffing_ode, a Python code which sets up a second-order ordinary differential equation (ODE) whose solution can exhibit chaotic behavior.
  186. e_spigot, a Python code which produces N digits of the decimal expansion of e.
  187. elements, a Python code which stores the atomic number, atomic weight, element name and element symbol for the chemical elements.
  188. ellipse, a Python code which carries out geometric calculations for ellipses and ellipsoids, including area, distance to a point, eccentricity, perimeter, points along the perimeter, random sampling, conversion between standard and quadratic forms.
  189. ellipse_distance, a Python code which computes the expected value of the distance between a pair of points randomly selected on the circumference of the ellipse (x/a)^2+(y/b)^2=1 in 2D.
  190. ellipse_grid, a Python code which computes grid points over the interior of an ellipse in 2D.
  191. 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.
  192. ellipsoid, a Python code which carries out geometric calculations for ellipsoids, including area, random sampling, conversion between standard and quadratic forms.
  193. ellipsoid_grid, a Python code which computes a grid of points over the interior of an ellipsoid in 3D.
  194. 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.
  195. elliptic_integral, a Python code which evaluates complete elliptic integrals of first, second and third kind, using the Carlson elliptic integral functions.
  196. epicycloid, a Python code which plots an epicycloid curve.
  197. eros, a Python code which implements elementary row operations (EROs) for the interactive solution of a system of linear equations.
  198. euclid, a Python code which investigates various versions of Euclid's algorithm for computing the greatest common divisor (GCD) of two integers.
  199. euler, a Python code which solves one or more ordinary differential equations (ODE) using the forward Euler method.
  200. exactness, a Python code which tests 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).
  201. exp_ode, a Python code which sets up an ordinary differential equation (ODE) whose solution is an exponential function.
  202. fair_dice_simulation, a Python code which simulates N tosses of 2 dice, making a histogram of the resulting sums.
  203. fd_predator_prey, a Python code which solves a time-dependent predator prey system using the finite difference method (FDM).
  204. 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().
  205. fd1d_bvp, a Python code which applies the finite difference method (FDM) to a two point boundary value problem (BVP) in one spatial dimension.
  206. fd1d_heat_explicit, a Python code which implements a finite difference method (FDM), explicit in time, to solve the time dependent 1D heat equation;
  207. fd1d_heat_implicit, a Python code which implements a finite difference method (FDM), implicit in time, to solve the time dependent 1D heat equation;
  208. fd2d_heat_steady, a Python code which implements a finite difference method (FDM) for the steady time-independent 2D heat equation;
  209. fem_basis, a Python code which defines and evaluates finite element method (FEM) basis functions for any degree in an M dimensional simplex (1D interval, 2D triangle, 3D tetrahedron, and higher dimensional generalizations.)
  210. 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().
  211. 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.
  212. 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.
  213. 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.
  214. 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.
  215. 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.
  216. 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.
  217. fern, a Python code which computes and displays the Barnsley fractal fern.
  218. fibonacci_spiral, a Python code which displays points on a Fibonacci spiral, suggesting the arrangement of seeds in a sunflower, for instance.
  219. file_name_sequence, a Python code which generates a sequence of filenames, which can be useful when generating a sequence of still snapshots to be animated later.
  220. filum, a Python code which performs various operations on files;
  221. 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.
  222. fitzhugh_nagumo_ode, a Python code which sets up the Fitzhugh-Nagumo system of ordinary differential equations (ODE).
  223. flame_ode, a Python code which sets up an ordinary differential equation (ODE) which models the growth of a ball of flame in a combustion process. The exact solution is defined in terms of the Lambert W function.
  224. flame_odefun, a Python code which uses odefun() from the multiple precision package mpmath() to solve an ordinary differential equation (ODE) which models the growth of a ball of flame in a combustion process. The exact solution is defined in terms of the Lambert W function.
  225. flies_simulation, a Python code which simulates an experiment in which two flies land on a plate of radius 1. By repeating the experiment many times, the average distance between the flies is to be estimated.
  226. florida_cvt_geo, a Python code which explores the creation of a centroidal Voronoi Tessellation (CVT) of the state of Florida, based solely on geometric considerations.
  227. florida_cvt_pop, a Python code which explores the creation of a centroidal Voronoi Tessellation (CVT) of the state of Florida, based on population considerations.
  228. floyd, a Python code which implements the Floyd algorithm for finding the shortest distance between pairs of nodes on a directed graph.
  229. fly_simulation, a Python code which simulates an experiment in which a fly lands on a plate of radius 1. By repeating the experiment many times, the average distance of the fly from the center is to be estimated.
  230. 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.
  231. football_dynamic, a Python code which uses dynamic programming to count the ways of achieving a given score in football, respecting the order of events.
  232. football2_diophantine, a Python code which uses diophantine analysis to count the ways of achieving a given score in football, ignoring the order of events.
  233. football2_dynamic, a Python code which uses dynamic programming to count the ways of achieving a given score in football, respecting the order of events.
  234. 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.
  235. freefem_msh_io, a Python code which reads and writes files used by the FreeFem++ finite element program to store mesh information.
  236. fsolve_test, a Python code which calls fsolve() which seeks the solution x of one or more nonlinear equations f(x)=0.
  237. full_deck_simulation, a Python code which simulates a process in which a random card is drawn from a deck of 52, and then replaced, continuing until every card has been seen at least once.
  238. gamblers_ruin_simulation, a Python code which simulates a game in which a gambler never stops playing until all money is lost.
  239. gauss_seidel, a Python code which uses the Gauss-Seidel iteration to solve a linear system with a symmetric positive definite (SPD) matrix.
  240. gauss_seidel_stochastic, a Python code which uses a stochastic version of the Gauss-Seidel iteration to solve a linear system with a symmetric positive definite (SPD) matrix.
  241. gaussian, a Python code which evaluates the Gaussian function and its derivatives.
  242. gaussian_2d, a Python code which evaluates a general Gaussian function of a 2D argument.
  243. gaussian_prime_spiral, a Python code which computes a twisting spiral path along the Gaussian primes, and displays a plot of the total trajectory.
  244. ge_to_crs, a Python code which converts a matrix from General (GE) to Compressed Row Storage (CRS) format.
  245. gegenbauer_cc, a Python code which computes the Gegenbauer weighted integral of a function f(x) using a Clenshaw-Curtis approach.
  246. gegenbauer_exactness, a Python code which tests the exactness of Gauss-Gegenbauer quadrature rules.
  247. gegenbauer_polynomial, a Python code which evaluates the Gegenbauer polynomial and associated functions.
  248. gen_hermite_exactness, a Python code which tests the exactness of generalized Gauss-Hermite quadrature rules.
  249. gen_laguerre_exactness, a Python code which tests the exactness of generalized Gauss-Laguerre quadrature rules.
  250. 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.
  251. gl_fast_rule, 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.
  252. glomin, a Python code which finds a global minimum of a scalar function of a scalar argument, without the use of derivative information, by Richard Brent.
  253. glycolysis_ode, a Python code which sets up a pair of ordinary differential equations (ODE) that model the biochemical process of glycolysis, for which a limit cycle exists.
  254. gmgsolve, a Python code which applies one step of the V-cycle of the geometric multigrid method, by Mike Sussman.
  255. gradient_descent, a Python code which uses gradient descent to solve a linear least squares (LLS) problem.
  256. gram_polynomial, a Python code which evaluates the Gram polynomials, also known as the discrete Chebyshev polyomials and associated functions.
  257. gram_schmidt, a Python code which implements the Gram-Schmidt process to orthogonalize and normalize a set of vectors.
  258. graph_adj, a Python code which carries out operations on abstract graphs, with undirected edges, represented by an adjacency matrix. Operations included breadth-first search, the computation of a minimum spanning tree, an Euler or Hamilton circuit, blocks, chromatic polynomial, or transitive closure.
  259. graph_class, a Python code which creates classes related to abstract graphs, and uses them to define various algorithms include breadth-first search, depth-first search, and shortest path.
  260. graphics_test, a Python code which demonstrates techniques for creating a graphic display of a variety of scientific data.
  261. graphviz_test, a Python code which calls graphiviz(), which displays representations of graphs.
  262. grazing_ode, a Python code which sets up ordinary differential equations (ODE) that model the populations of an edible plant, and the herbivore that grazes on it.
  263. grf_io, a Python code which reads or writes a GRF file which represents a mathematical graph;
  264. gurobi_solution_read, a Python code which reads a file created by the optimization package gurobi(), representing the solution of a polyomino tiling problem, and writes out an ASCII file that can be read by load().
  265. haar_transform, a Python code which computes the Haar transform of 1d or 2d data.
  266. halton, a Python code which computes elements of a Halton Quasi Monte Carlo (QMC) sequence, using a simple interface.
  267. hammersley, a Python code which computes elements of a Hammersley Quasi Monte Carlo (QMC) sequence, using a simple interface.
  268. hamming, a Python code which implements some simple versions of Hamming codes which can detect and correct errors in data.
  269. hankel_cholesky, a Python code which computes the upper Cholesky factor R of a symmetric positive definite (SPD) H matrix so that H = R' * R.
  270. hankel_cholesky, a Python code which computes the upper Cholesky factor R of a symmetric positive definite (SPD) Hankel matrix so that H = R' * R.
  271. 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'.
  272. hdf5_test, a Python code which demonstrates the use of the HDF5 library and file format.
  273. heartbeat_ode, a Python code which sets up and solves an ordinary differential equation (ODE) describing the beating of the heart, as suggested by Zeeman.
  274. hello, a Python code which prints "Hello, world!".
  275. hello_mpi, a Python code which prints out "Hello, world!", carried out in parallel using MPI and MPI4PY.
  276. henon_heiles_ode, a Python code which sets up the Henon-Heiles system of ordinary differential equations (ODE) which model the motion of a star around the galactic center.
  277. henon_orbit, a Python code which computes the orbit of the Henon map for various sets of initial data.
  278. hermite_exactness, a Python code which tests the exactness of Gauss-Hermite quadrature rules to estimate the integral of a function with density exp(-x^2) over the interval (-oo,+oo).
  279. hermite_polynomial, a Python code which evaluates the physicist's Hermite polynomial, the probabilist's Hermite polynomial, the Hermite function, and related functions.
  280. hermite_rule, a Python code which returns a Gauss-Hermite quadrature rule to estimate the integral of a function with density exp(-x^2) over the interval (-oo,+oo).
  281. hexagon_integrals, a Python code which returns the exact value of the integral of a monomial over the interior of a hexagon in 2D.
  282. hexagon_monte_carlo, a Python code which applies a Monte Carlo method to estimate the integral of a function over the interior of a hexagon in 2D;
  283. hexagon_stroud_rule, a Python code which computes one of four Stroud quadrature rules over the interior of the unit hexagon.
  284. hexahedron_jaskowiec_rule, a Python code which returns a symmetric Jaskowiec quadrature rule for the hexahedron, with exactness up to total degree 21.
  285. hexahedron_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for the hexahedron, with exactness up to total degree 11.
  286. high_card_simulation, a Python code which simulates a situation in which you see the cards in a deck one by one, and must select the one you think is the highest and stop.
  287. hilbert_curve, a Python code which computes the sequence of discrete Hilbert curves whose limit is a space-filling curve.
  288. hits, a Python code which uses the HITS algorithm to assign authority and hub indices to a set of nodes in a directed network.
  289. humps, a Python code which evaluates the humps function, its first and second derivatives and its antiderivative.
  290. humps_ode, a Python code which sets up an ordinary differential equation (ODE) whose solution is a double hump curve.
  291. hyper_2f1, a Python code which evaluates the hypergeometric functions 2F1(a,b,c;x) for real or complex argument x. For convenience, this function is simply a wrapper for the corresponding function in the scipy.special() library.
  292. 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.
  293. 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.
  294. 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;
  295. hyperball_positive_distance, a Python code which computes the expected value of the distance between a pair of points randomly selected from the interior of the unit positive hyperball in M dimensions.
  296. hypercube_distance, a Python code which estimates the expected value of the distance between a pair of points randomly selected in the M-dimensional unit hypercube.
  297. hypercube_grid, a Python code which computes a grid of points over the interior of a hypercube in M dimensions.
  298. 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.
  299. 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.
  300. hypercube_surface_distance, a Python code which estimates the expected value of the distance between a pair of points randomly selected on the surface of the unit hypercube in D dimensions.
  301. hypersphere, a Python code which carries out various operations for a D dimensional hypersphere, including converting between Cartesian and spherical coordinates, stereographic projection, sampling the surface of the sphere, and computing the surface area and volume.
  302. hypersphere_angle, a Python code which considers the problem of describing the typical value of the angle between a pair of points randomly selected on the unit hypersphere in M dimensions. Since by symmetry, this will be zero, we instead look at the average of the absolute value of the dot product, and the corresponding angle. In dimension 1, we have average dot product of 1, and angle 0. As the dimension increases, the average dot product rapidly decreases to 0, while the average angle goes to 90 degrees.
  303. hypersphere_angle_distance, a Python code which considers the problem of describing the typical value of the angle between a pair of points randomly selected on the unit hypersphere in M dimensions. Since by symmetry, this will be zero, we instead look at the average of the absolute value of the dot product, and the corresponding angle. In dimension 1, we have average dot product of 1, and angle 0. As the dimension increases, the average dot product rapidly decreases to 0, while the average angle goes to 90 degrees.
  304. 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.
  305. 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.
  306. 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;
  307. hypersphere_positive_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 positive hypersphere in M dimensions.
  308. i4lib, a Python code which contains many utility routines, using single precision integer (I4) arithmetic.
  309. ill_bvp, a Python code which defines an ill conditioned boundary value problem (BVP), and calls on scipy.integrate.solve_bvp() to solve it with various values of the conditioning parameter.
  310. insurance_simulation, a Python code which simulates a highly simplified model of term life insurance, in which a customer agrees to pay an annual fee for a given number of years, so that if the customer dies within that term, the family receives a large payout.
  311. is_gaussian_prime, a Python code which is true if a given complex number c is a Gaussian prime.
  312. is_prime, a Python code which is true if a given integer n is prime.
  313. isbn, a Python code which determines the check digit for an International Standard Book Number (ISBN), or reports whether a given ISBN is valid.
  314. ising_2d_simulation, a Python code which simulates the evolution of a 2D array of positive and negative charges, each of which is likely to flip to be in agreement with neighbors.
  315. jaccard_distance, a Python code which computes the Jaccard distance between two sets.
  316. jacobi, a Python code which implements the Jacobi iteration for the iterative solution of linear systems.
  317. jacobi_eigenvalue, a Python code which implements the Jacobi iteration for the iterative determination of the eigenvalues and eigenvectors of a real symmetric matrix.
  318. jacobi_exactness, a Python code which tests the exactness of rules for integrals with a Jacobi weight function.
  319. jacobi_poisson_1d, a Python code which uses Jacobi iteration to solve the linear system for a discretized steady 1D Poisson equation.
  320. jacobi_rule, a Python code which computes a Gauss-Jacobi quadrature rule.
  321. jai_alai_simulation, a Python code which simulates a sequence matches of the game of jai alai.
  322. jordan_matrix, a Python code which returns a random matrix in Jordan canonical form.
  323. joukowsky_transform, a Python code which applies the Joukowsky transform to data, mapping between a circle in the complex plane and various airfoil shapes.
  324. julia_set, a Python code which computes and plots a Julia set, the set of points in the complex plane that remain bounded under a mapping of the form f(z) = z^2+c.
  325. kdv_exact, a Python code which evaluates an exact solution of the Korteweg-deVries (KdV) partial differential equation (PDE).
  326. kepler_ode, a Python code which sets up the ordinary differential equations (ODE) for a Kepler two-body gravitational system.
  327. knapsack_01_brute, a Python code which uses brute force to solve small versions of the 0/1 knapsack problem;
  328. knapsack_dynamic, a Python code which uses dynamic programming to solve a knapsack problem.
  329. knapsack_greedy, a Python code which uses a greedy algorithm to estimate a solution of the knapsack problem;
  330. kronrod_rule, a Python code which computes a Gauss and Gauss-Kronrod pair of quadrature rules of arbitrary order, by Robert Piessens, Maria Branders.
  331. 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).
  332. laguerre_exactness, a Python code which tests the exactness of Gauss-Laguerre quadrature rules for integrating functions with density exp(-x) over [0,+oo).
  333. laguerre_polynomial, a Python code which evaluates the Laguerre polynomial, the generalized Laguerre polynomials, and the Laguerre function.
  334. laguerre_rule, a Python code which returns a Gauss-Laguerre quadrature rule of given order.
  335. lambert_w, a Python code which evaluates Lambert's W function.
  336. langford_ode, a Python code which sets up and solves the Langford system of ordinary differential equations (ODE).
  337. latin_center, a Python code which computes N points in an M dimensional Latin Center square;
  338. latin_edge, a Python code which returns N points in an M dimensional Latin Edge square;
  339. latin_random, a Python code which computes Latin Random Squares of N points in M dimensions;
  340. leapfrog, a Python code which uses the leapfrog method to solve a second order ordinary differential equation (ODE) of the form y''=f(t,y).
  341. 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.
  342. legendre_exactness, a Python code which tests the exactness of quadrature rules for the Legendre problem of integrating a function with density 1 over the interval [-1,+1].
  343. legendre_polynomial, a Python code which evaluates the Legendre polynomial and associated functions.
  344. legendre_product_polynomial, a Python code which defines Legendre product polynomials, creating a multivariate polynomial as the product of univariate Legendre polynomials.
  345. legendre_rule, a Python code which returns a Gauss-Legendre quadrature rule of given order.
  346. legendre_shifted_polynomial, a Python code which evaluates the shifted Legendre polynomial, with the domain [0,1].
  347. levenshtein_distance, a Python code which returns the Levenshtein distance between two strings.
  348. levenshtein_matrix, a Python code which returns the Levenshtein distance matrix defined by two strings.
  349. lindberg_ode, a Python code which sets up a system of 4 ordinary differential equations (ODE) which are very stiff.
  350. 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.
  351. line_grid, a Python code which computes a grid of points over the interior of a line segment in 1D.
  352. 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.
  353. 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.
  354. line_ncc_rule, a Python code which computes a Newton Cotes Closed (NCC) quadrature rule, using equally spaced points, over the interior of a line segment in 1D.
  355. linear_algebra, a Python code which carry out various linear algebra operations for matrices stored in a variety of formats.
  356. linplus_c8, a Python code which carries out some linear algebra operations on complex matrices.
  357. lissajous, a Python code which displays a Lissajous figure, of the form x = sin ( a1 t + b1 ), y = sin ( a2 t + b2 ).
  358. 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.
  359. loadtxt_test, a Python program which calls the numpy() function loadtxt() to extract numeric data from a text file.
  360. lobatto_polynomial, a Python code which evaluates Lobatto polynomials, which are similar to Legendre polynomials except that they are 0 at both endpoints.
  361. local_min, a Python code which finds a local minimum of a scalar function of a scalar variable, without the use of derivative information, by Richard Brent.
  362. 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.
  363. locker_simulation, a Python code which simulates the locker problem, in which gym users have left their wallets in lockers; someone has scrambled all the lockers, and the gym users need a strategy that maximizes the chance that everyone will find their wallet by searching a limited number of lockers.
  364. log_norm, a Python code which computes the logarithmic norm of a matrix, for norms 1, 2 and oo.
  365. log_normal, a Python code which returns quantities related to the log normal Probability Distribution Function (PDF).
  366. 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].
  367. logistic_bifurcation, a Python code which computes the bifurcation diagram for the logistic equation, by John Cook.
  368. logistic_ode, a Python code which sets up and solves an ordinary differential equation (ODE) which models population growth in the face of a limited carrying capacity.
  369. lorenz_ode, a Python code which sets up the Lorenz system of ordinary differential equations (ODE), creating graphics files using matplotlib().
  370. lorenz_ode_sensitivity_test, a Python code which demonstrates sensitivity to initial conditions in the Lorenz system of ordinary differential equations (ODE), using an approach suggested by John D Cook.
  371. luhn, a Python code which computes the Luhn check digit for a string, or verifies a string, as used for error detection in credit card numbers.
  372. machar, a Python code which dynamically computes the values of various machine characteristic constants, by William Cody;
  373. machine, a Python code which returns tabulated values of the constants associated with computer arithmetic;
  374. magic_matrix, a Python code which computes a magic matrix, for any odd order n, such that all rows and columns have the same sum.
  375. mandelbrot, a Python code which generates an image of the Mandelbrot set;
  376. mandelbrot_orbit, a Python code which generates the Mandelbrot iterates arising from a single starting point;
  377. mario, a Python code which creates a sort of needlepoint image of Mario, as an array of colored squares.
  378. markov_text, a Python code which uses a Markov Chain Monte Carlo (MCMC) process to sample an existing text file and create a new text that is randomized, but retains some of the structure of the original one.
  379. matrix_chain, a Python code which finds the cost of the most efficient ordering to use when multiplying a sequence of matrices, using dynamic programming..
  380. matrix_exponential, a Python code which demonstrates some simple approaches to the problem of computing the exponential of a matrix.
  381. mcnuggets, a Python code which counts M(N), the number of ways a given number N of Chicken McNuggets can be assembled, given that they are only available in packages of 6, 9, and 20.
  382. mcnuggets_diophantine, a Python code which uses Diophantine methods to find the ways a given number N of Chicken McNuggets can be assembled, given that they are only available in packages of 6, 9, and 20.
  383. md, a Python code which carries out a molecular dynamics (MD) simulation, intended as a starting point for implementing a parallel version.
  384. mesh_boundary, a Python code which is given a mesh of a 2D region, formed by polygonal elements, and determines a sequence of pairs of polygonal vertices that define the boundary of the region.
  385. mesh_etoe, a Python code which uses ETOV, the mesh element-to-vertex connectivity, to construct ETOE, the element-to-element connectivity.
  386. middle_square, a Python code which implements the middle square algorithm for generating random integers. This is a very early method, attributed to von Neumann, which actually is deeply flawed, with short cycles.
  387. midpoint, a Python code which solves one or more ordinary differential equations (ODE) using the implicit midpoint method.
  388. midpoint_adaptive, a Python code which solves one or more ordinary differential equations (ODE) using the (implicit) midpoint method, with fsolve() solving the implicit equation, and an adaptive time step.
  389. midpoint_explicit, a Python code which solves one or more ordinary differential equations (ODE) using the explicit midpoint method, also called the modified Euler method.
  390. midpoint_fixed, a Python code which solves one or more ordinary differential equations (ODE) using the implicit midpoint method, using a simple fixed-point iteration to solve the implicit equation.
  391. 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.
  392. monomial_value, a Python code which evaluates a monomial in M dimensions.
  393. monopoly_matrix, a Python code which computes the adjacency and transition matrices for the game of Monopoly.
  394. monty_hall_simulation, a Python code which simulates the "Let's Make a Deal" game in which Monty Hall has hidden a prize behind one of several doors, and the user wins the prize if the correct door is selected.
  395. mortality, a Python code which processes some sample mortality data.
  396. movie_test, a Python code which creates a movie file from a sequence of solutions to a partial differential equation, using matplotlib().
  397. mxm, a Python code which sets up a matrix multiplication problem A=B*C of arbitrary size, and compares the time required for IJK, IKJ, JIK, JKI, KIJ and KJI orderings of the loops.
  398. naca, a Python code which takes the parameters of certain NACA airfoils and returns the coordinates of a sequence of points that outline the wing shape.
  399. 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.
  400. 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.
  401. 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().
  402. neighbor_states, a Python code which creates a plot of the US based only on information about pairs of US states which are neighbors.
  403. neural_network, a Python code which illustrates the use of neural networks for deep learning, using back propagation and stochastic gradient descent, by Catherine Higham and Desmond Higham.
  404. newton, a Python code which applies the Newton method to solve a single nonlinear equation f(x)=0.
  405. newton_interp_1d, a Python code which finds a polynomial interpolant to data using Newton divided differences.
  406. ngrams, a Python code which analyzes a string or text against the observed frequency of ngrams, that is, particular sequences of n letters, in English text.
  407. normal, a Python code which implements a random number generator (RNG) for normally distributed values;
  408. normal_ode, a Python code which sets up an ordinary differential equation (ODE) defining the normal probability density function (PDF).
  409. 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.
  410. numgrid, a Python code which defines and numbers a subset of the nodes in a regular nxn grid of the [-1,+1]x[-1,+1] unit square.
  411. 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.
  412. odefun_test, a Python code which uses odefun() from the multiple precision package mpmath() to solve some simple ordinary differential equations (ODE).
  413. oregonator_ode, a Python code which sets up the ordinary differential equations (ODE) for the Oregonator, a model of the Belousov-Zhabotinsky chemical reaction.
  414. ornstein_uhlenbeck, a Python code which approximates solutions of the Ornstein-Uhlenbeck stochastic differential equation (SDE) using the Euler method, the Euler-Maruyama method, and the Milstein method.
  415. oscillator_ode, a Python code which sets up the highly oscillatory ordinary differential equation (ODE).
  416. owen, a Python code which evaluates the Owen T function;
  417. ozone_ode, a Python code which sets up a stiff system of four ordinary differential equations (ODE) that simulate the daily variation in atmospheric ozone concentration.
  418. ozone2_ode, a Python code which sets up a stiff system of four ordinary differential equations (ODE) that simulate the daily variation in atmospheric ozone concentration. This version of the ozone ODE includes a nitrogen oxide source term.
  419. 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.
  420. pagerank, a Python code which illustrates the eigenvalue (power method) and surfer (Markov Chain Monte Carlo MCMC) approaches to ranking web pages.
  421. pariomino, a Python code which considers pariominoes, which are polyominoes with a checkerboard parity.
  422. partition_brute, a Python code which uses a brute force algorithm to seek solutions of the partition problem, splitting a set of integers into two subsets with equal sum.
  423. partition_greedy, a Python code which uses a greedy algorithm to seek a solution of the partition problem, in which a given set of integers is to be split into two groups whose sums are as close as possible.
  424. pbma_io, a Python code which reads or writes ASCII Portable Bit Map (PBM) 2D graphics files;
  425. pbmb_io, a Python code which reads or writes a binary Portable Bit Map (PBM) 2D graphics file;
  426. 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.
  427. pendulum_double_ode, a Python code which sets up the double pendulum ordinary differential equation (ODE).
  428. pendulum_elastic_ode a Python code which sets up the ordinary differential equations (ODE) that represent the behavior of a nonlinear elastic pendulum, with gravitational force G, spring constant K, unstretched length L, and mass M.
  429. pendulum_nonlinear_ode, a Python code which sets up the ordinary differential equations (ODE) that represent a nonlinear model of the behavior of a pendulum of length L under a gravitational force of strength G.
  430. pendulum_ode, a Python code which sets up the ordinary differential equations (ODE) that represent a linear model of the behavior of a pendulum of length L under a gravitational force of strength G.
  431. pentominoes, a Python code which forms or plots any of the 12 members of the pentomino family, shapes formed from 5 adjacent squares.
  432. perceptron, a Python code which demonstrates the calculation of a classifier of linearly separable data using the perceptron algorithm.
  433. percolation_simulation, a Python code which simulates a percolation system. A rectangular region is decomposed into a grid of MxN squares. Each square may be porous or solid. We are interested in a path of porous squares connecting the top and bottom, or the left and right boundaries. The original code was written by Ian Cooper.
  434. permutation_distance, a Python code which estimates the expected value of the Ulam distance between a pair of randomly selected permutations of the same order.
  435. persistence, a Python code which demonstrates how to initialize, get, or set data stored within a function, using static/persistent/saved/local memory.
  436. pgma_io, a Python code which reads or writes ASCII Portable Gray Map (PGM) 2D graphics files;
  437. pgmb_io, a Python code which reads or writes a binary Portable Gray Map (PGM) 2D graphics file;
  438. pi_spigot, a Python code which produces any number of digits of the decimal expansion of pi.
  439. pink_noise, a Python code which computes a pink noise signal obeying a 1/f power law.
  440. pip3_test, tests the Python installation program.
  441. plasma_matrix, a Python code which sets up a matrix associated with a problem in plasma physics.
  442. poisson_1d, a Python code which applies the finite difference method (FDM) to solve a two point Poisson boundary value problem (BVP) in one spatial dimension.
  443. poisson_1d_multigrid, a Python code which applies the multigrid method to a discretized version of the 1D Poisson equation.
  444. poisson_simulation, a Python code which simulates a Poisson process in which events randomly occur with an average waiting time of Lambda.
  445. polar_ode, a Python code which sets up an ordinary differential equation (ODE) whose variable is complex, and whose solution should be viewed in a polar coordinate plot.
  446. polpak, a Python code which evaluates a variety of mathematical functions, polynomials, and sequences, including Bell, Benford, Bernoulli, Bernstein, Cardan, Catalan, Charlier, Chebyshev, Collatz, Delannoy, Euler, Fibonacci, Gegenbauer, Gudermannian, Harmonic, Hermite, Hofstadter, Jacobi, Krawtchouk, Laguerre, Lambert, Legendre, Lerch, Meixner, Mertens, Moebius, Motzkin, Phi, Stirling, Tau, Tribonacci, Zernike.
  447. polygon, 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, counter clockwise ordering, diameter, distance to a point, inradius, lattice area, nearest point in set, outradius, uniform sampling, and triangulation.
  448. polygon_average, a Python code which demonstrates a process of repeatedly averaging and normalizing the vertices of a polygon, illustrating a property of the power method.
  449. polygon_distance, a Python code which computes the expected value of the distance between a pair of points randomly selected from the interior of a polygon in 2D.
  450. polygon_grid, a Python code which generates a grid of points over the interior of a polygon in 2D.
  451. polygon_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of a polygon in 2D.
  452. 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.
  453. 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.
  454. polynomial, a Python code which adds, multiplies, differentiates, evaluates and prints multivariate polynomials in a space of M dimensions.
  455. polynomial_conversion, a Python code which converts representations of a polynomial between monomial, Bernstein, Chebyshev, Hermite, Laguerre and Legendre forms.
  456. polynomial_multiply, a Python code which multiplies two polynomials p(x) and q(x).
  457. polynomial_resultant, a Python code which computes the resultant R of univariate polynomials P and Q.
  458. polynomial_resultant_symbolic, a Python code which uses the symbolic package sympy() to compute the resultant R of univariate polynomials P and Q.
  459. polynomial_root_bound, a Python code which computes the Cauchy bound on the magnitude of all roots of a polynomial with complex coefficients.
  460. 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.
  461. polyomino_parity, a Python code which uses parity considerations to determine whether a given set of polyominoes can tile a specified region.
  462. polyominoes, a Python code which manipulates polyominoes and tilings.
  463. power_method, a Python code which carries out the power method for finding a dominant eigenvalue and its eigenvector.
  464. ppma_io, a Python code which reads or writes an ASCII Portable Pixel Map (PPM) 2D graphics file;
  465. ppmb_io, a Python code which reads or writes a binary Portable Pixel Map (PPM) 2D graphics file;
  466. praxis, a Python code which minimizes a scalar function of several variables, without requiring derivative information, by Richard Brent.
  467. predator_prey_ode, a Python code which sets up the ordinary differential equations (ODE) for a Lotka-Volterra predator prey system, for which a limit cycle exists.
  468. predator_prey_ode_period, a Python code which sets up the ordinary differential equations (ODE) for a Lotka-Volterra predator prey system, in order to estimate the period of the limit cycle.
  469. prime, a Python code which counts the number of primes between 1 and N, intended as a starting point for a parallel version.
  470. prime_pi, a Python code which evaluates Pi(n), the number of primes less than or equal to an integer n.
  471. prime_plot, a Python code which displays a box plot of the prime and composite numbers.
  472. prism_jaskowiec_rule, a Python code which returns symmetric quadrature rules, with exactness up to total degree 20, over the interior of a prism with triangular base, by Jan Jaskowiec, Natarajan Sukumar.
  473. prism_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for a prism with triangular base, with exactness up to total degree 10.
  474. 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.
  475. pwl_interp_1d, a Python code which interpolates a set of data using a piecewise linear function in 1D.
  476. pwl_interp_2d, a Python code which interpolates a set of data using a piecewise linear function in 2D.
  477. py_test, a Python code which illustrates various features of Python programming.
  478. pyramid_exactness, a Python code which tests the exactness of a quadrature rule over the interior of the unit pyramid in 3D.
  479. pyramid_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of a pyramid in 3D.
  480. pyramid_grid, a Python code which computes a grid of points over the interior of the unit pyramid in 3D;
  481. pyramid_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of the unit pyramid in 3D.
  482. pyramid_jaskowiec_rule, a Python code which returns quadrature rules, with exactness up to total degree 20, over the interior of a pyramid in 3D, by Jan Jaskowiec, Natarajan Sukumar.
  483. 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;
  484. pyramid_rule, a Python code which computes a conical product quadrature rule over the interior of the unit pyramid in 3D.
  485. pyramid_witherden_rule, a Python code which returns a Witherden quadrature rule, with exactness up to total degree 10, over the interior of a pyramid.
  486. python_combinatorics, a Python code which considers a variety of problems in combinatorics involving counting, combinations, permutations, and so on.
  487. python_distance, a Python code which estimates the typical distance between a pair of points randomly selected from the surface or interior of a geometric object such as a circle, disk, sphere, cube.
  488. python_grid, a Python code which generates a regular grid of points inside a variety of regions in one, two, three or many dimensions.
  489. python_import, a Python code which demonstrates how a Python function can use the import function to access functions from a library that is in a separate directory.
  490. python_intrinsics_test, a Python code which demonstrates some of the intrinsic functions in the Python language.
  491. python_mistake, a Python code which illustrates mistakes caused by Python, encouraged by Python, or made difficult to spot because of Python.
  492. python_monte_carlo, a Python code which uses Monte Carlo sampling to estimate areas and integrals.
  493. python_plots, a Python code which uses plotting to illustrate a mathematical structure, such as an iterative map, a fractal, a curve or surface.
  494. python_polynomial, a Python code which analyzes a variety of polynomial families, returning the polynomial values, coefficients, derivatives, integrals, roots, or other information.
  495. python_random_test, a Python code which demonstrates random number generation.
  496. python_simulation, a Python code which uses simulation to study card games, contests, and other processes which have a random element. Usually, the purpose is to try to predict the average behavior of the system over many trials.
  497. pytorch_test, a Python code which illustrates certain features of the pytorch() programming library, which is used for applications in machine learning and deep learning.
  498. python_ode, a Python code which sets up various systems of ordinary differential equations (ODE).
  499. quad_mpi, a Python code which approximates an integral using a quadrature rule, carried out in parallel using MPI and MPI4PY.
  500. quad_rule, a Python code which implements rules for approximate integration, or quadrature, in one dimension;
  501. quad_serial, a Python code which applies a quadrature rule to estimate an integral, intended as a starting point for parallelization exercises.
  502. quad2d, a Python code which estimates an integral over a 2D rectangle using quadrature, intended as the starting point for program optimization or parallelization.
  503. quadex_ode a Python code which sets up a stiff ordinary differential equation (ODE), whose exact solution is a parabola, but for which errors grow exponentially.
  504. quadrilateral, a Python code which carries out geometric calculations on quadrilaterals, including angles, area, distances, nearest point, point containment, perimeter, and random generation.
  505. quadrilateral_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for the quadrilateral, with exactness up to total degree 21.
  506. quasiperiodic_ode, a Python code which sets up a system of ordinary differential equations (ODE) for a problem with a quasiperiodic solution.
  507. quaternions, a Python code which carries out some simple arithmetic operations for quaternions.
  508. r83, a Python code which contains linear algebra routines for r83 matrices, in real, 64 bit, tridiagonal 3xN format.
  509. r83_np, a Python code which contains linear algebra routines for r83_np matrices (real, 64 bit, tridiagonal 3xN format, nonpivoting factorization).
  510. r83p, a Python code which contains linear algebra routines for r83p matrices (real, 64 bit, tridiagonal periodic format).
  511. r83s, a Python code which contains linear algebra routines for r83s matrices (real, 64 bit, tridiagonal scalar format).
  512. r83t, a Python code which contains linear algebra routines for r83t matrices (real, 64 bit, tridiagonal Mx3 format).
  513. r83v, a Python code which contains linear algebra routines for r83v matrices (real, 64 bit, tridiagonal three vector format).
  514. r85, a Python code which contains linear algebra routines for r85 matrices (real, 64 bit, pentadiagonal format).
  515. r8bb, a Python code which contains linear algebra routines for r8bb matrices (real, 64 bit, border banded format).
  516. r8blt, a Python code which contains linear algebra routines for r8blt matrices (real, 64 bit, band lower triangular format).
  517. r8bto, a Python code which contains linear algebra routines for r8bto matrices (real, 64 bit, block Toeplitz format).
  518. r8but, a Python code which contains linear algebra routines for r8but matrices (real, 64 bit, band upper triangular format).
  519. r8cb, a Python code which contains linear algebra routines for r8cb matrices (real, 64 bit, Compressed Band format).
  520. r8cbb, a Python code which contains linear algebra routines for r8cbb matrices (real, 64 bit, Compressed Border Banded format).
  521. r8ccs, a Python code which contains linear algebra routines for r8ccs matrices: real, 64 bit, Compressed Column Storage (CCS) format.
  522. r8ci, a Python code which contains linear algebra routines for r8ci matrices (real, 64 bit, circulant format).
  523. r8col, a Python code which contains linear algebra routines for r8col matrices, that is, a 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.
  524. r8crs, a Python code which contains linear algebra routines for r8crs matrices: real, 64 bit, Compressed Row Storage (CRS) format.
  525. r8gb, a Python code which contains linear algebra routines for r8gb matrices (real, 64 bit, General Banded format).
  526. r8gd, a Python code which contains linear algebra routines for r8gd matrices (real, 64 bit, general diagonal format).
  527. r8ge, a Python code which contains linear algebra routines for r8ge matrices in real, 64 bit, general format.
  528. r8lib, a Python code which contains many utility routines, using 64 bit precision real (R8) arithmetic.
  529. r8lt, a Python code which contains linear algebra routines for r8lt matrices, in real, 64 bit, Lower Triangular format.
  530. r8ltt, a Python code which contains linear algebra routines for r8ltt matrices (real, 64 bit, lower triangular Toeplitz format).
  531. r8ncf, a Python code which contains linear algebra routines for r8ncf matrices (real, 64 bit, nonsymmetric coordinate format).
  532. r8pbl, a Python code which contains linear algebra routines for r8pbl matrices (real, 64 bit, symmetric positive definite (SPD) band lower format).
  533. r8pbu, a Python code which contains linear algebra routines for r8pbu matrices (real, 64 bit, symmetric positive definite (SPD) band upper format).
  534. r8po, a Python code which contains linear algebra routines for r8po matrices (real, 64 bit, symmetric positive definite (SPD) format).
  535. r8poly, a Python code which operates on real polynomials, including evaluation, differentiation, integration, multiplication, synthetic division, shifting the base, computing a power, taking the norm. It also defines Chebyshev, Lagrange and Legendre polynomials.
  536. r8pp, a Python code which contains linear algebra routines for r8pp matrices (real, 64 bit, symmetric positive definite (SPD) packed format).
  537. r8ri, a Python code which contains linear algebra routines for r8ri matrices (real, 64 bit, row indexed format).
  538. r8row, a Python code which contains linear algebra routines for r8row matrices, that is, a 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.
  539. r8sd, a Python code which contains linear algebra routines for r8sd matrices (real, 64 bit, symmetric diagonal format).
  540. r8sm, a Python code which contains linear algebra routines for r8sm matrices (real, 64 bit, Sherman-Morrison A-u*v' format).
  541. r8sr, a Python code which carries out linear algebra operations for r8sr matrices (real, 64 bit, diagonal + compressed row offdiagonal format).
  542. r8ss, a Python code which carries out linear algebra operations for r8ss matrices (real, 64 bit, symmetric skyline format).
  543. r8st, a Python code which contains linear algebra routines for r8st matrices, in real, 64 bit, Sparse Triplet (ST) format.
  544. r8sto, a Python code which contains linear algebra routines for r8sto matrices (real, 64 bit, symmetric Toeplitz N format).
  545. r8to, a Python code which contains linear algebra routines for r8to matrices (real, 64 bit, Toeplitz 2*N-1 format).
  546. r8ut, a Python code which contains linear algebra routines for r8ut matrices, in real, 64 bit, Upper Triangular format.
  547. r8utp, a Python code which carries out linear algebra operations on r8utp matrices, real 64 bit, Upper Triangular Packed format.
  548. r8utt, a Python code which contains linear algebra routines for r8utt matrices (real, 64 bit, upper triangular Toeplitz format).
  549. r8vm, a Python code which contains linear algebra routines for r8vm matrices (real, 64 bit, vandermonde format).
  550. randlc, a Python code which implements a random number generator (RNG) used by the NAS Benchmark programs.
  551. 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.
  552. 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.
  553. random_sorted, a Python code which generates vectors of random values which are already sorted.
  554. random_walk_1d_simulation, a Python code which simulates a random walk in a 1-dimensional region.
  555. random_walk_2d_simulation, a Python code which simulates a random walk in a 2-dimensional region.
  556. random_walk_2d_avoid_simulation, a Python code which simulates a self-avoiding random walk in a 2-dimensional region.
  557. random_walk_3d_simulation, a Python code which simulates a random walk in a 3-dimensional region.
  558. 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.
  559. rbf_interp_1d, a Python code which defines and evaluates radial basis function (RBF) interpolants to 1D data.
  560. rbf_interp_2d, a Python code which defines radial basis function (RBF) interpolants to 2D data.
  561. reaction_ode, a Python code which sets up the ordinary differential equations (ODE) which model a simple chemical reaction A+B --k--> C.
  562. reaction_twoway_ode, a Python code which sets up the ordinary differential equations (ODE) which model a two-way chemical reaction between species W1 and W2.
  563. reaction_twoway_odefun, a Python code which uses the multiple-precision arithmetic package mpmath() to approximate the solution of the ordinary differential equations (ODE) which model a two-way chemical reaction between species W1 and W2.
  564. reactor simulation, a Python code which is a simple Monte Carlo simulation of the shielding effect of a slab of a certain thickness in front of a neutron source. This program was provided as an example with the book "Numerical Methods and Software."
  565. rectangle_distance, a Python code which estimates the distribution and expected value of the distance between two points picked uniformly at random within a rectangle.
  566. rigid_body_ode, a Python code which sets up the ordinary differential equations (ODE) representing the Euler equations for a rigid body with three unequal moments of inertia, originally proposed by Fred Krogh.
  567. ripple_ode, a Python code which sets up an ordinary differential equation (ODE) whose family of solutions start as ripples and end as hyperbolas.
  568. risk_matrix, a Python code which returns the transition and adjacency matrix for the game of RISK.
  569. rk12, a Python code which solves an ordinary differential equation (ODE) using a Runge-Kutta (RK) method of order 2, estimating the local error with a Runge-Kutta method of order 1.
  570. rk23, a Python code which applies Runge-Kutta (RK) solvers of order 2 and 3 to a system of ordinary differential equations (ODE);
  571. rk34, a Python code which applies Runge-Kutta (RK) solvers of order 3 and 4 to a system of ordinary differential equations (ODE);
  572. 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.
  573. rk45, a Python code which applies Runge-Kutta (RK) solvers of order 4 and 5 to a system of ordinary differential equations (ODE);
  574. rkf45, a Python code which implements the Runge-Kutta-Fehlberg (RKF) solver for the approximate solution of an ordinary differential equation (ODE) system.
  575. 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.
  576. robertson_ode, a Python code which sets up a system of three nonlinear stiff ordinary differential equations (ODE) characterizing an autocatalytic chemical reaction.
  577. roessler_ode, a Python code which sets up the Roessler system of ordinary differential equations (ODE).
  578. root_rc, a Python code which seeks a solution of a scalar nonlinear equation f(x)=0, using reverse communication (RC), by Gaston Gonnet.
  579. roots_rc, a Python code which seeks solutions of a system of nonlinear equations, using reverse communication (RC), by Gaston Gonnet.
  580. 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.
  581. roulette_simulation, a Python code which simulates the spinning of a roulette wheel and the evaluation of certain common roulette bets.
  582. 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.
  583. rubber_band_ode, a Python code which sets up a set of ordinary differential equations (ODE) describing a mass suspended by a spring and rubber band, which exhibit chaotic behavior.
  584. rucklidge_ode, a Python code which sets up and solves the Rucklidge ordinary differential equation (ODE), a model of double convection which embodies a transition to chaos.
  585. sammon_data, a Python code which generates six examples of M dimensional datasets for cluster analysis.
  586. satisfy_brute, a Python code which uses brute force to find all assignments of values to a set of logical variables which make a complicated logical statement true.
  587. sawtooth_ode, a Python code which sets up an ordinary differential equation (ODE) driven by a right hand side which is a sawtooth function, periodic, discontinuous, piecewise linear.
  588. 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.
  589. 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.
  590. sensitive_ode, a Python code which sets up a second order ordinary differential equation (ODE) which exhibits sensitive dependence on the initial condition.
  591. set_theory, a Python code which implements set theory operations such as union, intersection, complement, symmetric difference.
  592. sftpack, a Python code which implements the slow Fourier transform (SFT), intended as a teaching tool and comparison with the fast Fourier transform (FFT).
  593. shallow_water_1d, a Python code which simulates the evolution of a 1D fluid governed by the time-dependent shallow water equations.
  594. shepard_interp_1d, a Python code which defines and evaluates Shepard interpolants to 1D data, based on inverse distance weighting.
  595. simplex_coordinates, a Python code which computes the Cartesian coordinates of the vertices of a regular simplex in M dimensions.
  596. 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.
  597. simplex_grid, a Python code which generates a regular grid of points over the interior of an arbitrary simplex in M dimensions.
  598. 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.
  599. 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.
  600. sine_transform, a Python code which demonstrates simple properties of the discrete sine transform (DST).
  601. sir_ode, a Python code which sets up the ordinary differential equations (ODE) which simulate the spread of a disease using the Susceptible/Infected/Recovered (SIR) model.
  602. sir_simulation, a Python code which simulates the spread of a disease through a hospital room of M by N beds, using the Susceptible/Infected/Recovered (SIR) model.
  603. sling_ode, an Octave code which sets up a system of ordinary differential equations (ODE) for which the exact circular solution can only be approximated for a short interval before it decays to zero.
  604. snakes_and_ladders, a Python code which provides some tools for studying the game of Snakes and Ladders.
  605. snakes_and_ladders_simulation, a Python code which simulates a one-player game of Snakes and Ladders, to produce histograms of the count, PDF and CDF estimates for the length of a one-player game.
  606. snakes_matrix, a Python code which returns the transition matrix for the game of Snakes and Ladders.
  607. sobol, a Python code which computes elements of a Sobol Quasi Monte Carlo (QMC) sequence.
  608. solve, a Python code which demonstrates how Gauss elimination can be used to solve a linear system A*x=b.
  609. solve_bvp_test, a Python code which calls scipy.integrate.solve_bvp(), which solves boundary value problems (BVP) in one spatial dimension.
  610. sort_rc, a Python code which sorts a list of any kind of objects, using reverse communication (RC).
  611. sortrows, a Python code which lexically sorts the rows of an array, in a similar fashion to the MATLAB sortrows() function.
  612. sparse_test, a Python code which tests the scipy.sparse() functions for creating sparse matrices and carrying out linear algebraic functions on them;
  613. sphere_distance, a Python code which computes the expected value of the distance between a pair of points randomly selected from the surface of the unit sphere in 3D.
  614. 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.
  615. 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.
  616. 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.
  617. 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.
  618. 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.
  619. sphere_positive_distance, a Python code which computes the expected value of the distance between a pair of points randomly selected on the surface of the unit positive sphere in 3D.
  620. 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.
  621. spring_ode, a Python code which sets up a system of ordinary differential equations (ODE) for the motion of a spring with mass m, damping b, and stiffness k.
  622. spring_double_ode, a Python code which sets up a system of ordinary differential equations (ODE) for a system in which a mass is connected by a spring to a mass connected by a spring to a fixed support.
  623. spring_sweep_ode, a Python code which computes a grid of solutions to a parameterized system of ordinary differential equations (ODE) that represent the motion of a spring with mass m, damping b, and stiffness k.
  624. 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.
  625. square_grid, a Python code which computes a grid of points over the interior of a square in 2D.
  626. 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.
  627. 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.
  628. 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.
  629. square_surface_distance, a Python code which estimates the expected value of the distance between a pair of points randomly selected on the surface of the unit square.
  630. square_symq_rule, a Python code which returns symmetric quadrature rules, with exactness up to total degree 20, over the interior of the square in 2D, by Hong Xiao and Zydrunas Gimbutas.
  631. squircle_ode, a Python code which sets up a system of ordinary differential equations (ODE) for a pair of functions that generalize the sine and cosine, and whose phase portrait is a squircle, a sort of squared circle.
  632. st_io a Python code which reads and writes sparse linear systems stored in the Sparse Triplet (ST) format.
  633. st_to_ccs, a Python code which converts sparse matrix data from Sparse Triplet (ST) format to Compressed Column Storage (CCS) format;
  634. stetter_ode, a Python code which sets up an ordinary differential equation (ODE) for which a specific time step sequence causes the implicit trapezoidal method to be unstable, while the implicit midpoint method will be stable. Note that the right hand side function f(t,y) is periodic, discontinuous, and piecewise linear.
  635. stiff_ode, a Python code which sets up a stiff ordinary differential equation (ODE).
  636. stochastic_diffusion, a Python code which implements several versions of a stochastic diffusivity coefficient.
  637. stokes_2d_exact, a Python code which evaluates exact solutions to the incompressible steady Stokes equations over the unit square in 2D.
  638. subset, a Python code which enumerates, generates, randomizes, ranks and unranks combinatorial objects including combinations, compositions, Gray plt., index sets, partitions, permutations, polynomials, subsets, and Young tables. Backtracking routines are included to solve some combinatorial problems.
  639. subset_distance, a Python code which estimates the expected value of the Hamming distance between a pair of randomly selected subsets of an M set.
  640. subset_sum, a Python code which seeks solutions of the subset sum problem, in which it is desired to find a subset of integers which has a given sum.
  641. subset_sum_backtrack, a Python code which uses backtracking to find solutions of the subset sum problem, in which it is desired to find a subset of integers which has a given sum.
  642. subset_sum_brute, a Python code which uses brute force to find solutions of the subset sum problem, in which it is desired to find a subset of integers which has a given sum.
  643. svd_circle, a Python code which analyzes a linear map of the unit circle caused by an arbitrary 2x2 matrix A, using the singular value decomposition (SVD).
  644. svd_lls, a Python code which uses the singular value decomposition (SVD) to construct and plot the best affine and linear relationships in the sense of least square, between two vectors of data.
  645. svd_powers, a Python code which applies singular value decomposition (SVD) analysis to a set of powers A(i,j) = x(i)^j.
  646. 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.
  647. svd_sphere, a Python code which analyzes a linear map of the unit sphere caused by an arbitrary 3x3 matrix A, using the singular value decomposition (SVD).
  648. svd_test, a Python code which demonstrates the calculation of the singular value decomposition (SVD) and some of its properties;
  649. svd_truncated_test, a Python code which calls the "economy" version of the Singular Value Decomposition (SVD) of an M by N rectangular matrix, in cases where M is less than N or N is less than M.
  650. table_io, a Python code which reads and writes files.
  651. task_division, a Python code which implements a simple procedure for smoothly dividing T tasks among P processors; such a method can be useful in MPI and other parallel environments, particularly when T is not an exact multiple of P, and when the processors can be indexed starting from 0 or from 1.
  652. tennis_matrix, a Python code which computes the transition matrix for a game of tennis, which has 17 distinct states.
  653. test_eigen, a Python code which implements test matrices for eigenvalue analysis.
  654. test_int, a Python code which implements test problems for approximate integration (quadrature) in one dimension.
  655. test_interp, a Python code which defines test problems for interpolation, provided as a set of (x,y(x)) data.
  656. test_interp_1d, a Python code which defines test problems for interpolation of data y(x), which depends on a 1D argument.
  657. test_interp_2d, a Python code which defines test problems for interpolation of data z(x,y), which depends on a 2D argument.
  658. test_lls, a Python code which implements linear least squares test problems of the form A*x=b.
  659. test_matrix, a Python code which defines test matrices for which the condition number, determinant, eigenvalues, eigenvectors, inverse, null vectors, P*L*U factorization or linear system solution are known. Examples include the Fibonacci, Hilbert, Redheffer, Vandermonde, Wathen and Wilkinson matrices.
  660. test_matrix_exponential, a Python code which defines a set of test cases for computing the matrix exponential.
  661. test_min, a Python code which implements test problems for minimization of a scalar function of a scalar variable.
  662. test_nonlin, a Python code which implements test problems for the solution of systems of nonlinear equations.
  663. test_optimization, a Python code which implements test problems for optimization of a scalar function of several variables, as described by Molga and Smutnicki.
  664. test_values, a Python code which supplies test values of various mathematical functions, including Abramowitz, AGM, Airy, Bell, Bernoulli, Bessel, Beta, Binomial, Bivariate Normal, Catalan, Cauchy, Chebyshev, Chi Square, Clausen, Clebsch Gordan, Collatz, Cosine integral, Dawson, Debye, Dedekind, dilogarithm, Exponential integral, Elliptic, Error, Euler, Exponential integral, F probability, Fresnel, Frobenius, Gamma, Gegenbauer, Goodwin, Gudermannian, Harmonic, Hermite, Hypergeometric 1F1, Hypergeometric 2F1, inverse trigonometic, Jacobi, Julian Ephemeris Date, Kelvin, Laguerre, Laplace, Legendre, Lerch, Lobachevsky, Lobatto, Logarithmic integral, Log normal, McNugget numbers, Mertens, Mittag-Leffler, Moebius, Multinomial, Negative binomial, Nine J, Normal, Omega, Owen, Partition, Phi, Pi, Poisson, Polylogarithm, Polyomino, Prime, Psi, Rayleigh, Hyperbolic Sine integral, Sigma, Sine Power integral, Sine integral, Six J, Sphere area, Sphere volume, Spherical harmonic, Stirling, Stromgen, Struve, Student, Subfactorial, Student probability, Three J, Transport, Trigamma, Truncated normal, van der Corput, von Mises, Weibull, Wright omega, Zeta.
  665. test_zero, a Python code which defines some functions f(x) suitable for testing software that solves f(x)=0;
  666. tester, a BASH script which runs the test codes.
  667. tetrahedron, a Python code which carries out geometric calculations involving a general tetrahedron, including solid and facial angles, face areas, point containment, distances to a point, circumsphere and insphere, measures of shape quality, centroid, barycentric coordinates, edges and edge lengths, random sampling, and volumes.
  668. tetrahedron_arbq_rule, a Python code which returns quadrature rules, with exactness up to total degree 15, over the interior of a tetrahedron in 3D, by Hong Xiao and Zydrunas Gimbutas.
  669. tetrahedron_exactness, a Python code which tests the exactness of a quadrature rule over the interior of a tetrahedron in 3D.
  670. tetrahedron_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of a tetrahedron in 3D.
  671. tetrahedron_grid, a Python code which computes a grid of points over the interior of a tetrahedron in 3D.
  672. 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.
  673. tetrahedron_jaskowiec_rule, a Python code which returns quadrature rules, with exactness up to total degree 20, over the interior of a tetrahedron in 3D, by Jan Jaskowiec, Natarajan Sukumar.
  674. tetrahedron_monte_carlo, a Python code which uses the Monte Carlo method to estimate an integral over the interior of a tetrahedron in 3D.
  675. tetrahedron_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for the tetrahedron, with exactness up to total degree 10.
  676. tetrahedron01_monte_carlo, a Python code which uses the Monte Carlo method to estimate an integral over the interior of the unit tetrahedron in 3D.
  677. theta_method, a Python code which solves one or more ordinary differential equations (ODE) using the theta method.
  678. three_body_ode, a Python code which sets up ordinary differential equations (ODE) that simulate the behavior of three planets, constrained to lie in a plane, and moving under the influence of gravity, by Walter Gander and Jiri Hrebicek.
  679. tictoc, a Python code which provides versions of the tic() and toc() functions for wallclock timing.
  680. timer_test, a Python code which tests various timers.
  681. timestamp, a Python code which prints the current YMDHMS date as a timestamp.
  682. toeplitz_cholesky, a Python code which computes the Cholesky factorization of a symmetric positive definite (SPD) Toeplitz matrix.
  683. toeplitz_inverse, a Python code which computes the inverse of a Toeplitz matrix.
  684. 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.
  685. 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.
  686. 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.
  687. toms179, a Python code which calculates the incomplete Beta ratio, by Oliver Ludwig. This is a version of ACM TOMS algorithm 179.
  688. toms243, a Python code which evaluates the logarithm of a complex value, by David Collens. This is a version of ACM TOMS algorithm 243.
  689. toms443, a Python code which evaluates the Lambert W function, by Fritsch, Shafer and Crowley. This is a version of ACM TOMS algorithm 443.
  690. toms515, a Python code which selects subsets of size K from a set of size N. This is a version of ACM TOMS Algorithm 515, by Bill Buckles, Matthew Lybanon.
  691. 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.
  692. 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!
  693. 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.
  694. toms923, a Python code which evaluates the Pfaffian for a dense or banded skew symmetric matrix, by Michael Wimmer.
  695. tough_ode, a Python code which sets up a system of four ordinary differential equations (ODE) which is extremely difficult to solve accurately.
  696. traffic_simulation, a Python code which simulates the cars waiting to get through a traffic light.
  697. trapezoidal, a Python code which solves one or more ordinary differential equations (ODE) using the implicit trapezoidal method, and using fsolve() to handle the implicit system.
  698. trapezoidal_explicit, a Python code which solves one or more ordinary differential equations (ODE) using the (explicit) trapezoidal method.
  699. trapezoidal_fixed, a Python code which solves one or more ordinary differential equations (ODE) using the implicit trapezoidal method, and using a fixed point method to handle the implicit system.
  700. triangle, a Python code which computes properties, including angles, area, centroid, circumcircle, edge lengths, incircle, orientation, orthocenter, and quality, of a triangle in 2D.
  701. triangle_distance, a Python code which estimates the typical value of the distance between a pair of points randomly selected from the interior of a triangle in 2D.
  702. triangle_exactness, a Python code which tests the exactness of a quadrature rule over the interior of a triangle in 2D.
  703. triangle_grid, a Python code which computes a grid of points over the interior of a triangle in 2D.
  704. 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.
  705. triangle_interpolate, a Python code which shows how vertex data can be interpolated at any point in the interior of a triangle.
  706. 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.
  707. triangle_symq_rule, a Python code which returns symmetric quadrature rules, with precision up to 50, over the interior of a triangle, by Hong Xiao and Zydrunas Gimbutas.
  708. 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.
  709. triangle_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for the triangle, with exactness up to total degree 20.
  710. triangle01_integrals, a Python code which returns the integral of any monomial over the interior of the unit triangle in 2D.
  711. 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.
  712. tridiagonal_solver a Python code which solves a tridiagonal linear system.
  713. truel_simulation, a Python code which simulates N repetitions of a duel between three players, each of whom has a known firing accuracy.
  714. 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.
  715. 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].
  716. tsp_brute, a Python code which is given a table of city-to-city distances and solves a small traveling salesperson problem (TSP), using brute force.
  717. tsp_descent, a Python code which is given a table of city-to-city distances, chooses an initial tour at random, and then tries some simple variations to quickly find a tour of lower length, to solve the traveling salesperson problem (TSP).
  718. tsp_greedy, a Python code which is given a table of city-to-city distances, and solves a small traveling salesperson problem (TSP) using the greedy algorithm. It picks a starting city at random, and then successively visits the nearest unvisited city.
  719. tsp_moler, a Python code which tries to optimize the traveling salesperson problem (TSP), written by Cleve Moler.
  720. tsp_random, a Python code which seeks a solution of the Traveling Salesperson Problem (TSP), by accepting a table of city-to-city distances, and randomly generating round trips that visit every city, returning the tour of shortest length.
  721. two_body_ode, a Python code which sets up ordinary differential equations (ODE) which simulate the behavior of two bodies, constrained to lie in a plane, moving under the influence of gravity, with one body much more massive than the other.
  722. ubvec, a Python code which demonstrates how nonnegative integers can be stored as unsigned binary vectors, and arithmetic can be performed on them.
  723. ulam_spiral, a Python code which displays the integers as a spiral of grid cells, with the primes highlighted, so show that they tend to fall along diagonals, as discovered by Stanislaw Ulam.
  724. umlaut_remover, a Python code which replaces certain special characters in German text by English equivalents, based on work by John Berroa.
  725. unicycle, a Python code which considers permutations containing a single cycle, sometimes called cyclic permutations.
  726. uniform, a Python code which contains uniform random number generators (RNG) for several arithmetic types.
  727. unstable_ode, a Python code which sets up an unstable ordinary differential equation (ODE) which the backward Euler method incorrectly drives to zero.
  728. upc, a Python code which computes the check digit associated with a uniform product code (UPC), or reports whether a 12-digit UPC is actually valid.
  729. urn_simulation, a Python code which simulates the experiment of sampling K balls from an urn containing N balls of various colors.
  730. usa_box_plot, a Python code which creates simplified maps of the USA in which each state appears as a box, and the placement of the boxes only roughly corresponds to the relative locations of states on an accurate map.
  731. usa_matrix, a Python code which defines the adjacency matrix for US states, using a variety of matrix formats.
  732. 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.
  733. vandermonde_approx_1d, a Python code which finds a polynomial approximant to data y(x) of a 1D argument by setting up and solving an overdetermined linear system for the polynomial coefficients involving the Vandermonde matrix.
  734. 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().
  735. vanderpol_ode, a Python code which sets up the ordinary differential equations (ODE) for the van der Pol oscillator, for which a limit cycle exists.
  736. vanderpol_ode_period, a Python code which sets up the ordinary differential equations (ODE) for the van der Pol oscillator in order to estimate the period of the limit cycle.
  737. vector, a Python code which considers a problem involving vectors, which can be considered to belong to equivalence classes, for which an arbitrary collection of coefficients must be gathered, averaged, and then scattered again.
  738. velocity_verlet, a Python code which uses a version of the velocity Verlet method to solve a second order ordinary differential equation (ODE) of the form y''=f(t,y).
  739. vin, a Python code which computes the check digit for a Vehicle Identification Number (VIN), or verifies that a given VIN is legitimate.
  740. 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;
  741. 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.
  742. walker_sample, a Python code which efficiently samples a discrete probability density function (PDF) represented by a vector, using Walker sampling.
  743. walsh_transform, a Python code which implements the Walsh data transform.
  744. wathen_matrix, 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).
  745. web_matrix, a Python code which stores sample matrices describing a web page network. These matrices are typically very sparse, and the examples here are stored using the sparse triplet (ST) format. They can be used to demonstrate pagerank and other graph algorithms.
  746. wedge_exactness, a Python code which tests the exactness of a quadrature rule over the interior of the unit wedge in 3D.
  747. wedge_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of the unit wedge in 3D.
  748. wedge_grid, a Python code which computes a grid of points over the interior of the unit wedge in 3D.
  749. 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.
  750. 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.
  751. 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.
  752. 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.
  753. will_you_be_alive, a Python code which carries out the probability simulations described in "Will You Be Alive 10 Years From Now?" by Paul Nahin;
  754. wishart_matrix, a Python code which produces sample matrices from the Wishart or Bartlett distributions, useful for sampling random covariance matrices.
  755. wtime, a Python code which shows how to return a reading of the wall clock time.
  756. 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.
  757. zero_brent, a Python code which seeks a solution of a scalar nonlinear equation f(x)=0, by Richard Brent.
  758. zero_chandrupatla, a Python code which finds a zero of a scalar function of a scalar variable, starting from a change of sign interval, using the Chandrupatla method, which can converge faster than bisection, regula falsi, or Brent's method, by Tirupathi Chandrapatla.
  759. zero_itp, a Python code which finds a zero of a scalar function of a scalar variable, starting from a change of sign interval, using the Interpolate/Truncate/Project (ITP) method, which has faster convergence than the bisection method.
  760. zero_laguerre, a Python code which uses Laguerre's method to find the zero of a function. The method needs first and second derivative information. The method almost always works when the function is a polynomial.
  761. zero_muller, a Python code which seeks a root of a nonlinear equation using the Muller method, with complex arithmetic.
  762. zero_rc, a Python code which seeks a solution of a scalar nonlinear equation f(x)=0, using reverse communication (RC), by Richard Brent.
  763. zombie_ode, a Python code which sets up a system of ordinary differential equations (ODE) for a generalized Susceptible-Infected-Recovered (SIR) disease model to simulate a zombie attack, developed by Philip Munz.


Last revised on 29 March 2024.