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. cobweb_plot, a Python library which displays a cobweb plot illustrating the process of function iteration, by John D Cook.
  117. coin_simulation, a Python code which looks at ways of simulating or visualizing the results of many tosses of a fair or biased coin.
  118. collatz, a Python code which computes and analyzes the Collatz sequence, also known as the hailstone sequence or 3n+1 sequence;
  119. collatz_dict, a Python code which demonstrates how the Python dict variable type can be used to efficiently record data about the Collatz iteration.
  120. 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.
  121. collatz_recursive, a Python code which demonstrates recursive programming by considering the simple Collatz 3n+1 problem.
  122. columns, a Python code which copies columns clo:chi from a text file to a new text file.
  123. combination_lock, a Python code which simulates the process of determining the secret combination of a lock.
  124. 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.
  125. 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.
  126. complex_numbers_test, demonstrates some of the features of using complex numbers.
  127. 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.
  128. condition, a Python code which implements methods of computing or estimating the condition number of a matrix.
  129. 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).
  130. continued_fraction, a Python code which implements some simple algorithms for dealing with simple and generalized continued fractions.
  131. ConvexHull_test, a Python code which calls ConvexHull(), which is a scipy.spatial function to compute the convex hull of a set of points.
  132. cordic, a Python code which computes a few special functions using the CORDIC algorithm.
  133. cosine_transform, a Python code which demonstrates some simple properties of the discrete cosine transform (DCT).
  134. 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.
  135. 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.
  136. crs_io a Python code which reads and writes sparse linear systems stored in the Compressed Row Storage (CRS) format.
  137. csv_test, a Python code which tests the csv() library for reading and writing Comma Separated Value (CSV) data files.
  138. 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.
  139. cube_exactness, a Python code which tests the exactness of quadrature rules over the interior of a cube in 3D.
  140. cube_grid, a Python code which computes a grid of points over the interior of a cube in 3D.
  141. 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.
  142. 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.
  143. 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.
  144. 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.
  145. 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.
  146. 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.
  147. 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.
  148. 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().
  149. cvxopt_test, a Python code which calls cvxopt(), which solves problems in convex optimization and quadratic programming.
  150. 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.
  151. 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.
  152. 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.
  153. delsq, a Python code which is given a grid G, and returns a corresponding sparse matrix D that defines the Laplacian operator on G.
  154. 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.
  155. dice_simulation, a Python code which simulates N tosses of M dice, making a histogram of the resulting sums.
  156. 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.
  157. digital_dice, a Python code which carries out the probability simulations described in "Digital Dice", by Paul Nahin;
  158. digraph_adj, a Python code which carries out operations on abstract digraphs, a kind of graph with directed edges, described by an adjacency matrix.
  159. 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.
  160. dijkstra, a Python code which implements a simple version of the Dijkstra minimum distance algorithm for graphs.
  161. diophantine, a Python code which finds one solution of a Diophantine equation in any number of variables.
  162. diophantine_nd, a Python code which is given a Diophantine equation in N variables, and returns all nonnegative solutions, or all strictly positive solutions.
  163. 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.
  164. 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.
  165. 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.
  166. disk_integrands, a Python code which defines several test integrals over the unit disk, making it possible to check the accuracy of quadrature rules.
  167. 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;
  168. 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.
  169. disk_rule, a Python code which computes a quadrature rule over the interior of the general disk in 2D.
  170. 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.
  171. 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.
  172. disk01_integrands, a Python code which defines several test integrals over the unit disk, making it possible to check the accuracy of quadrature rules.
  173. 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;
  174. 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;
  175. 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).
  176. 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.
  177. 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.
  178. 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.
  179. 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.
  180. duel_simulation, a Python code which simulates N repetitions of a duel between two players, each of whom has a known firing accuracy.
  181. dueling_idiots, a Python code which carries out the probability simulations described in "Dueling Idiots", by Paul Nahin;
  182. duffing_ode, a Python code which sets up a second-order ordinary differential equation (ODE) whose solution can exhibit chaotic behavior.
  183. e_spigot, a Python code which produces N digits of the decimal expansion of e.
  184. elements, a Python code which stores the atomic number, atomic weight, element name and element symbol for the chemical elements.
  185. 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.
  186. 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.
  187. ellipse_grid, a Python code which computes grid points over the interior of an ellipse in 2D.
  188. 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.
  189. ellipsoid, a Python code which carries out geometric calculations for ellipsoids, including area, random sampling, conversion between standard and quadratic forms.
  190. ellipsoid_grid, a Python code which computes a grid of points over the interior of an ellipsoid in 3D.
  191. 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.
  192. elliptic_integral, a Python code which evaluates complete elliptic integrals of first, second and third kind, using the Carlson elliptic integral functions.
  193. epicycloid, a Python code which plots an epicycloid curve.
  194. eros, a Python code which implements elementary row operations (EROs) for the interactive solution of a system of linear equations.
  195. euclid, a Python code which investigates various versions of Euclid's algorithm for computing the greatest common divisor (GCD) of two integers.
  196. euler, a Python code which solves one or more ordinary differential equations (ODE) using the forward Euler method.
  197. 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).
  198. exp_ode, a Python code which sets up an ordinary differential equation (ODE) whose solution is an exponential function.
  199. fair_dice_simulation, a Python code which simulates N tosses of 2 dice, making a histogram of the resulting sums.
  200. fd_predator_prey, a Python code which solves a time-dependent predator prey system using the finite difference method (FDM).
  201. 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().
  202. fd1d_bvp, a Python code which applies the finite difference method (FDM) to a two point boundary value problem (BVP) in one spatial dimension.
  203. fd1d_heat_explicit, a Python code which implements a finite difference method (FDM), explicit in time, to solve the time dependent 1D heat equation;
  204. fd1d_heat_implicit, a Python code which implements a finite difference method (FDM), implicit in time, to solve the time dependent 1D heat equation;
  205. fd2d_heat_steady, a Python code which implements a finite difference method (FDM) for the steady time-independent 2D heat equation;
  206. 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.)
  207. 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().
  208. 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.
  209. 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.
  210. 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.
  211. 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.
  212. 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.
  213. 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.
  214. fern, a Python code which computes and displays the Barnsley fractal fern.
  215. fibonacci_spiral, a Python code which displays points on a Fibonacci spiral, suggesting the arrangement of seeds in a sunflower, for instance.
  216. 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.
  217. filum, a Python code which performs various operations on files;
  218. 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.
  219. fitzhugh_nagumo_ode, a Python code which sets up the Fitzhugh-Nagumo system of ordinary differential equations (ODE).
  220. 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.
  221. 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.
  222. 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.
  223. 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.
  224. 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.
  225. floyd, a Python code which implements the Floyd algorithm for finding the shortest distance between pairs of nodes on a directed graph.
  226. 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.
  227. 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.
  228. 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.
  229. 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.
  230. 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.
  231. 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.
  232. freefem_msh_io, a Python code which reads and writes files used by the FreeFem++ finite element program to store mesh information.
  233. fsolve_test, a Python code which calls fsolve() which seeks the solution x of one or more nonlinear equations f(x)=0.
  234. 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.
  235. gamblers_ruin_simulation, a Python code which simulates a game in which a gambler never stops playing until all money is lost.
  236. gauss_seidel, a Python code which uses the Gauss-Seidel iteration to solve a linear system with a symmetric positive definite (SPD) matrix.
  237. 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.
  238. gaussian, a Python code which evaluates the Gaussian function and its derivatives.
  239. gaussian_2d, a Python code which evaluates a general Gaussian function of a 2D argument.
  240. gaussian_prime_spiral, a Python code which computes a twisting spiral path along the Gaussian primes, and displays a plot of the total trajectory.
  241. ge_to_crs, a Python code which converts a matrix from General (GE) to Compressed Row Storage (CRS) format.
  242. gegenbauer_cc, a Python code which computes the Gegenbauer weighted integral of a function f(x) using a Clenshaw-Curtis approach.
  243. gegenbauer_exactness, a Python code which tests the exactness of Gauss-Gegenbauer quadrature rules.
  244. gegenbauer_polynomial, a Python code which evaluates the Gegenbauer polynomial and associated functions.
  245. gen_hermite_exactness, a Python code which tests the exactness of generalized Gauss-Hermite quadrature rules.
  246. gen_laguerre_exactness, a Python code which tests the exactness of generalized Gauss-Laguerre quadrature rules.
  247. 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.
  248. 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.
  249. 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.
  250. 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.
  251. gmgsolve, a Python code which applies one step of the V-cycle of the geometric multigrid method, by Mike Sussman.
  252. gradient_descent, a Python code which uses gradient descent to solve a linear least squares (LLS) problem.
  253. gram_polynomial, a Python code which evaluates the Gram polynomials, also known as the discrete Chebyshev polyomials and associated functions.
  254. gram_schmidt, a Python code which implements the Gram-Schmidt process to orthogonalize and normalize a set of vectors.
  255. 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.
  256. 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.
  257. graphics_test, a Python code which demonstrates techniques for creating a graphic display of a variety of scientific data.
  258. graphviz_test, a Python code which calls graphiviz(), which displays representations of graphs.
  259. 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.
  260. grf_io, a Python code which reads or writes a GRF file which represents a mathematical graph;
  261. 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().
  262. haar_transform, a Python code which computes the Haar transform of 1d or 2d data.
  263. halton, a Python code which computes elements of a Halton Quasi Monte Carlo (QMC) sequence, using a simple interface.
  264. hammersley, a Python code which computes elements of a Hammersley Quasi Monte Carlo (QMC) sequence, using a simple interface.
  265. hamming, a Python code which implements some simple versions of Hamming codes which can detect and correct errors in data.
  266. 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.
  267. 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.
  268. 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'.
  269. hdf5_test, a Python code which demonstrates the use of the HDF5 library and file format.
  270. 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.
  271. hello, a Python code which prints "Hello, world!".
  272. hello_mpi, a Python code which prints out "Hello, world!", carried out in parallel using MPI and MPI4PY.
  273. 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.
  274. henon_orbit, a Python code which computes the orbit of the Henon map for various sets of initial data.
  275. 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).
  276. hermite_polynomial, a Python code which evaluates the physicist's Hermite polynomial, the probabilist's Hermite polynomial, the Hermite function, and related functions.
  277. 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).
  278. hexagon_integrals, a Python code which returns the exact value of the integral of a monomial over the interior of a hexagon in 2D.
  279. 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;
  280. hexagon_stroud_rule, a Python code which computes one of four Stroud quadrature rules over the interior of the unit hexagon.
  281. hexahedron_jaskowiec_rule, a Python code which returns a symmetric Jaskowiec quadrature rule for the hexahedron, with exactness up to total degree 21.
  282. hexahedron_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for the hexahedron, with exactness up to total degree 11.
  283. 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.
  284. hilbert_curve, a Python code which computes the sequence of discrete Hilbert curves whose limit is a space-filling curve.
  285. hits, a Python code which uses the HITS algorithm to assign authority and hub indices to a set of nodes in a directed network.
  286. humps, a Python code which evaluates the humps function, its first and second derivatives and its antiderivative.
  287. humps_ode, a Python code which sets up an ordinary differential equation (ODE) whose solution is a double hump curve.
  288. 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.
  289. 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.
  290. 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.
  291. 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;
  292. 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.
  293. 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.
  294. hypercube_grid, a Python code which computes a grid of points over the interior of a hypercube in M dimensions.
  295. 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.
  296. 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.
  297. 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.
  298. 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.
  299. 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.
  300. 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.
  301. 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.
  302. 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.
  303. 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;
  304. 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.
  305. i4lib, a Python code which contains many utility routines, using single precision integer (I4) arithmetic.
  306. 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.
  307. 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.
  308. is_gaussian_prime, a Python code which is true if a given complex number c is a Gaussian prime.
  309. is_prime, a Python code which is true if a given integer n is prime.
  310. isbn, a Python code which determines the check digit for an International Standard Book Number (ISBN), or reports whether a given ISBN is valid.
  311. 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.
  312. jaccard_distance, a Python code which computes the Jaccard distance between two sets.
  313. jacobi, a Python code which implements the Jacobi iteration for the iterative solution of linear systems.
  314. jacobi_eigenvalue, a Python code which implements the Jacobi iteration for the iterative determination of the eigenvalues and eigenvectors of a real symmetric matrix.
  315. jacobi_exactness, a Python code which tests the exactness of rules for integrals with a Jacobi weight function.
  316. jacobi_poisson_1d, a Python code which uses Jacobi iteration to solve the linear system for a discretized steady 1D Poisson equation.
  317. jacobi_rule, a Python code which computes a Gauss-Jacobi quadrature rule.
  318. jai_alai_simulation, a Python code which simulates a sequence matches of the game of jai alai.
  319. jordan_matrix, a Python code which returns a random matrix in Jordan canonical form.
  320. joukowsky_transform, a Python code which applies the Joukowsky transform to data, mapping between a circle in the complex plane and various airfoil shapes.
  321. 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.
  322. kdv_exact, a Python code which evaluates an exact solution of the Korteweg-deVries (KdV) partial differential equation (PDE).
  323. kepler_ode, a Python code which sets up the ordinary differential equations (ODE) for a Kepler two-body gravitational system.
  324. knapsack_01_brute, a Python code which uses brute force to solve small versions of the 0/1 knapsack problem;
  325. knapsack_dynamic, a Python code which uses dynamic programming to solve a knapsack problem.
  326. knapsack_greedy, a Python code which uses a greedy algorithm to estimate a solution of the knapsack problem;
  327. kronrod_rule, a Python code which computes a Gauss and Gauss-Kronrod pair of quadrature rules of arbitrary order, by Robert Piessens, Maria Branders.
  328. 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).
  329. laguerre_exactness, a Python code which tests the exactness of Gauss-Laguerre quadrature rules for integrating functions with density exp(-x) over [0,+oo).
  330. laguerre_polynomial, a Python code which evaluates the Laguerre polynomial, the generalized Laguerre polynomials, and the Laguerre function.
  331. laguerre_rule, a Python code which returns a Gauss-Laguerre quadrature rule of given order.
  332. lambert_w, a Python code which evaluates Lambert's W function.
  333. langford_ode, a Python code which sets up and solves the Langford system of ordinary differential equations (ODE).
  334. latin_center, a Python code which computes N points in an M dimensional Latin Center square;
  335. latin_edge, a Python code which returns N points in an M dimensional Latin Edge square;
  336. latin_random, a Python code which computes Latin Random Squares of N points in M dimensions;
  337. 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).
  338. 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.
  339. 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].
  340. legendre_polynomial, a Python code which evaluates the Legendre polynomial and associated functions.
  341. legendre_product_polynomial, a Python code which defines Legendre product polynomials, creating a multivariate polynomial as the product of univariate Legendre polynomials.
  342. legendre_rule, a Python code which returns a Gauss-Legendre quadrature rule of given order.
  343. legendre_shifted_polynomial, a Python code which evaluates the shifted Legendre polynomial, with the domain [0,1].
  344. levenshtein_distance, a Python code which returns the Levenshtein distance between two strings.
  345. levenshtein_matrix, a Python code which returns the Levenshtein distance matrix defined by two strings.
  346. lindberg_ode, a Python code which sets up a system of 4 ordinary differential equations (ODE) which are very stiff.
  347. 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.
  348. line_grid, a Python code which computes a grid of points over the interior of a line segment in 1D.
  349. 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.
  350. 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.
  351. 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.
  352. linear_algebra, a Python code which carry out various linear algebra operations for matrices stored in a variety of formats.
  353. linplus_c8, a Python code which carries out some linear algebra operations on complex matrices.
  354. lissajous, a Python code which displays a Lissajous figure, of the form x = sin ( a1 t + b1 ), y = sin ( a2 t + b2 ).
  355. 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.
  356. loadtxt_test, a Python program which calls the numpy() function loadtxt() to extract numeric data from a text file.
  357. lobatto_polynomial, a Python code which evaluates Lobatto polynomials, which are similar to Legendre polynomials except that they are 0 at both endpoints.
  358. 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.
  359. 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.
  360. 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.
  361. log_norm, a Python code which computes the logarithmic norm of a matrix, for norms 1, 2 and oo.
  362. log_normal, a Python code which returns quantities related to the log normal Probability Distribution Function (PDF).
  363. 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].
  364. logistic_bifurcation, a Python code which computes the bifurcation diagram for the logistic equation, by John Cook.
  365. 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.
  366. lorenz_ode, a Python code which sets up the Lorenz system of ordinary differential equations (ODE), creating graphics files using matplotlib().
  367. 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.
  368. 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.
  369. machar, a Python code which dynamically computes the values of various machine characteristic constants, by William Cody;
  370. machine, a Python code which returns tabulated values of the constants associated with computer arithmetic;
  371. 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.
  372. mandelbrot, a Python code which generates an image of the Mandelbrot set;
  373. mandelbrot_orbit, a Python code which generates the Mandelbrot iterates arising from a single starting point;
  374. mario, a Python code which creates a sort of needlepoint image of Mario, as an array of colored squares.
  375. 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.
  376. 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..
  377. matrix_exponential, a Python code which demonstrates some simple approaches to the problem of computing the exponential of a matrix.
  378. 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.
  379. 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.
  380. md, a Python code which carries out a molecular dynamics (MD) simulation, intended as a starting point for implementing a parallel version.
  381. 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.
  382. mesh_etoe, a Python code which uses ETOV, the mesh element-to-vertex connectivity, to construct ETOE, the element-to-element connectivity.
  383. 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.
  384. midpoint, a Python code which solves one or more ordinary differential equations (ODE) using the implicit midpoint method.
  385. 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.
  386. 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.
  387. 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.
  388. 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.
  389. monomial_value, a Python code which evaluates a monomial in M dimensions.
  390. monopoly_matrix, a Python code which computes the adjacency and transition matrices for the game of Monopoly.
  391. 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.
  392. mortality, a Python code which processes some sample mortality data.
  393. movie_test, a Python code which creates a movie file from a sequence of solutions to a partial differential equation, using matplotlib().
  394. 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.
  395. 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.
  396. 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.
  397. 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.
  398. 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().
  399. neighbor_states, a Python code which creates a plot of the US based only on information about pairs of US states which are neighbors.
  400. 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.
  401. newton, a Python code which applies the Newton method to solve a single nonlinear equation f(x)=0.
  402. newton_interp_1d, a Python code which finds a polynomial interpolant to data using Newton divided differences.
  403. 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.
  404. normal, a Python code which implements a random number generator (RNG) for normally distributed values;
  405. normal_ode, a Python code which sets up an ordinary differential equation (ODE) defining the normal probability density function (PDF).
  406. 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.
  407. 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.
  408. 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.
  409. odefun_test, a Python code which uses odefun() from the multiple precision package mpmath() to solve some simple ordinary differential equations (ODE).
  410. oregonator_ode, a Python code which sets up the ordinary differential equations (ODE) for the Oregonator, a model of the Belousov-Zhabotinsky chemical reaction.
  411. 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.
  412. oscillator_ode, a Python code which sets up the highly oscillatory ordinary differential equation (ODE).
  413. owen, a Python code which evaluates the Owen T function;
  414. 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.
  415. 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.
  416. 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.
  417. pagerank, a Python code which illustrates the eigenvalue (power method) and surfer (Markov Chain Monte Carlo MCMC) approaches to ranking web pages.
  418. pariomino, a Python code which considers pariominoes, which are polyominoes with a checkerboard parity.
  419. 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.
  420. 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.
  421. pbma_io, a Python code which reads or writes ASCII Portable Bit Map (PBM) 2D graphics files;
  422. pbmb_io, a Python code which reads or writes a binary Portable Bit Map (PBM) 2D graphics file;
  423. 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.
  424. pendulum_double_ode, a Python code which sets up the double pendulum ordinary differential equation (ODE).
  425. 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.
  426. 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.
  427. 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.
  428. pentominoes, a Python code which forms or plots any of the 12 members of the pentomino family, shapes formed from 5 adjacent squares.
  429. perceptron, a Python code which demonstrates the calculation of a classifier of linearly separable data using the perceptron algorithm.
  430. 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.
  431. 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.
  432. persistence, a Python code which demonstrates how to initialize, get, or set data stored within a function, using static/persistent/saved/local memory.
  433. pgma_io, a Python code which reads or writes ASCII Portable Gray Map (PGM) 2D graphics files;
  434. pgmb_io, a Python code which reads or writes a binary Portable Gray Map (PGM) 2D graphics file;
  435. pi_spigot, a Python code which produces any number of digits of the decimal expansion of pi.
  436. pink_noise, a Python code which computes a pink noise signal obeying a 1/f power law.
  437. pip3_test, tests the Python installation program.
  438. plasma_matrix, a Python code which sets up a matrix associated with a problem in plasma physics.
  439. 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.
  440. poisson_1d_multigrid, a Python code which applies the multigrid method to a discretized version of the 1D Poisson equation.
  441. poisson_simulation, a Python code which simulates a Poisson process in which events randomly occur with an average waiting time of Lambda.
  442. 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.
  443. 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.
  444. 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.
  445. 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.
  446. 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.
  447. polygon_grid, a Python code which generates a grid of points over the interior of a polygon in 2D.
  448. polygon_integrals, a Python code which returns the exact value of the integral of any monomial over the interior of a polygon in 2D.
  449. 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.
  450. 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.
  451. polynomial, a Python code which adds, multiplies, differentiates, evaluates and prints multivariate polynomials in a space of M dimensions.
  452. polynomial_conversion, a Python code which converts representations of a polynomial between monomial, Bernstein, Chebyshev, Hermite, Laguerre and Legendre forms.
  453. polynomial_multiply, a Python code which multiplies two polynomials p(x) and q(x).
  454. polynomial_resultant, a Python code which computes the resultant R of univariate polynomials P and Q.
  455. polynomial_resultant_symbolic, a Python code which uses the symbolic package sympy() to compute the resultant R of univariate polynomials P and Q.
  456. polynomial_root_bound, a Python code which computes the Cauchy bound on the magnitude of all roots of a polynomial with complex coefficients.
  457. 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.
  458. polyomino_parity, a Python code which uses parity considerations to determine whether a given set of polyominoes can tile a specified region.
  459. polyominoes, a Python code which manipulates polyominoes and tilings.
  460. power_method, a Python code which carries out the power method for finding a dominant eigenvalue and its eigenvector.
  461. ppma_io, a Python code which reads or writes an ASCII Portable Pixel Map (PPM) 2D graphics file;
  462. ppmb_io, a Python code which reads or writes a binary Portable Pixel Map (PPM) 2D graphics file;
  463. praxis, a Python code which minimizes a scalar function of several variables, without requiring derivative information, by Richard Brent.
  464. 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.
  465. 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.
  466. prime, a Python code which counts the number of primes between 1 and N, intended as a starting point for a parallel version.
  467. prime_pi, a Python code which evaluates Pi(n), the number of primes less than or equal to an integer n.
  468. prime_plot, a Python code which displays a box plot of the prime and composite numbers.
  469. 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.
  470. 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.
  471. 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.
  472. pwl_interp_1d, a Python code which interpolates a set of data using a piecewise linear function in 1D.
  473. pwl_interp_2d, a Python code which interpolates a set of data using a piecewise linear function in 2D.
  474. py_test, a Python code which illustrates various features of Python programming.
  475. pyramid_exactness, a Python code which tests the exactness of a quadrature rule over the interior of the unit pyramid in 3D.
  476. pyramid_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of a pyramid in 3D.
  477. pyramid_grid, a Python code which computes a grid of points over the interior of the unit pyramid in 3D;
  478. 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.
  479. 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.
  480. 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;
  481. pyramid_rule, a Python code which computes a conical product quadrature rule over the interior of the unit pyramid in 3D.
  482. 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.
  483. python_combinatorics, a Python code which considers a variety of problems in combinatorics involving counting, combinations, permutations, and so on.
  484. 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.
  485. python_grid, a Python code which generates a regular grid of points inside a variety of regions in one, two, three or many dimensions.
  486. 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.
  487. python_intrinsics_test, a Python code which demonstrates some of the intrinsic functions in the Python language.
  488. python_mistake, a Python code which illustrates mistakes caused by Python, encouraged by Python, or made difficult to spot because of Python.
  489. python_monte_carlo, a Python code which uses Monte Carlo sampling to estimate areas and integrals.
  490. python_plots, a Python code which uses plotting to illustrate a mathematical structure, such as an iterative map, a fractal, a curve or surface.
  491. python_polynomial, a Python code which analyzes a variety of polynomial families, returning the polynomial values, coefficients, derivatives, integrals, roots, or other information.
  492. python_random_test, a Python code which demonstrates random number generation.
  493. 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.
  494. 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.
  495. python_ode, a Python code which sets up various systems of ordinary differential equations (ODE).
  496. quad_mpi, a Python code which approximates an integral using a quadrature rule, carried out in parallel using MPI and MPI4PY.
  497. quad_rule, a Python code which implements rules for approximate integration, or quadrature, in one dimension;
  498. quad_serial, a Python code which applies a quadrature rule to estimate an integral, intended as a starting point for parallelization exercises.
  499. quad2d, a Python code which estimates an integral over a 2D rectangle using quadrature, intended as the starting point for program optimization or parallelization.
  500. 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.
  501. quadrilateral, a Python code which carries out geometric calculations on quadrilaterals, including angles, area, distances, nearest point, point containment, perimeter, and random generation.
  502. quadrilateral_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for the quadrilateral, with exactness up to total degree 21.
  503. quasiperiodic_ode, a Python code which sets up a system of ordinary differential equations (ODE) for a problem with a quasiperiodic solution.
  504. quaternions, a Python code which carries out some simple arithmetic operations for quaternions.
  505. r83, a Python code which contains linear algebra routines for r83 matrices, in real, 64 bit, tridiagonal 3xN format.
  506. r83_np, a Python code which contains linear algebra routines for r83_np matrices (real, 64 bit, tridiagonal 3xN format, nonpivoting factorization).
  507. r83p, a Python code which contains linear algebra routines for r83p matrices (real, 64 bit, tridiagonal periodic format).
  508. r83s, a Python code which contains linear algebra routines for r83s matrices (real, 64 bit, tridiagonal scalar format).
  509. r83t, a Python code which contains linear algebra routines for r83t matrices (real, 64 bit, tridiagonal Mx3 format).
  510. r83v, a Python code which contains linear algebra routines for r83v matrices (real, 64 bit, tridiagonal three vector format).
  511. r85, a Python code which contains linear algebra routines for r85 matrices (real, 64 bit, pentadiagonal format).
  512. r8bb, a Python code which contains linear algebra routines for r8bb matrices (real, 64 bit, border banded format).
  513. r8blt, a Python code which contains linear algebra routines for r8blt matrices (real, 64 bit, band lower triangular format).
  514. r8bto, a Python code which contains linear algebra routines for r8bto matrices (real, 64 bit, block Toeplitz format).
  515. r8but, a Python code which contains linear algebra routines for r8but matrices (real, 64 bit, band upper triangular format).
  516. r8cb, a Python code which contains linear algebra routines for r8cb matrices (real, 64 bit, Compressed Band format).
  517. r8cbb, a Python code which contains linear algebra routines for r8cbb matrices (real, 64 bit, Compressed Border Banded format).
  518. r8ccs, a Python code which contains linear algebra routines for r8ccs matrices: real, 64 bit, Compressed Column Storage (CCS) format.
  519. r8ci, a Python code which contains linear algebra routines for r8ci matrices (real, 64 bit, circulant format).
  520. 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.
  521. r8crs, a Python code which contains linear algebra routines for r8crs matrices: real, 64 bit, Compressed Row Storage (CRS) format.
  522. r8gb, a Python code which contains linear algebra routines for r8gb matrices (real, 64 bit, General Banded format).
  523. r8gd, a Python code which contains linear algebra routines for r8gd matrices (real, 64 bit, general diagonal format).
  524. r8ge, a Python code which contains linear algebra routines for r8ge matrices in real, 64 bit, general format.
  525. r8lib, a Python code which contains many utility routines, using 64 bit precision real (R8) arithmetic.
  526. r8lt, a Python code which contains linear algebra routines for r8lt matrices, in real, 64 bit, Lower Triangular format.
  527. r8ltt, a Python code which contains linear algebra routines for r8ltt matrices (real, 64 bit, lower triangular Toeplitz format).
  528. r8ncf, a Python code which contains linear algebra routines for r8ncf matrices (real, 64 bit, nonsymmetric coordinate format).
  529. r8pbl, a Python code which contains linear algebra routines for r8pbl matrices (real, 64 bit, symmetric positive definite (SPD) band lower format).
  530. r8pbu, a Python code which contains linear algebra routines for r8pbu matrices (real, 64 bit, symmetric positive definite (SPD) band upper format).
  531. r8po, a Python code which contains linear algebra routines for r8po matrices (real, 64 bit, symmetric positive definite (SPD) format).
  532. 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.
  533. r8pp, a Python code which contains linear algebra routines for r8pp matrices (real, 64 bit, symmetric positive definite (SPD) packed format).
  534. r8ri, a Python code which contains linear algebra routines for r8ri matrices (real, 64 bit, row indexed format).
  535. 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.
  536. r8sd, a Python code which contains linear algebra routines for r8sd matrices (real, 64 bit, symmetric diagonal format).
  537. r8sm, a Python code which contains linear algebra routines for r8sm matrices (real, 64 bit, Sherman-Morrison A-u*v' format).
  538. r8sr, a Python code which carries out linear algebra operations for r8sr matrices (real, 64 bit, diagonal + compressed row offdiagonal format).
  539. r8ss, a Python code which carries out linear algebra operations for r8ss matrices (real, 64 bit, symmetric skyline format).
  540. r8st, a Python code which contains linear algebra routines for r8st matrices, in real, 64 bit, Sparse Triplet (ST) format.
  541. r8sto, a Python code which contains linear algebra routines for r8sto matrices (real, 64 bit, symmetric Toeplitz N format).
  542. r8to, a Python code which contains linear algebra routines for r8to matrices (real, 64 bit, Toeplitz 2*N-1 format).
  543. r8ut, a Python code which contains linear algebra routines for r8ut matrices, in real, 64 bit, Upper Triangular format.
  544. r8utp, a Python code which carries out linear algebra operations on r8utp matrices, real 64 bit, Upper Triangular Packed format.
  545. r8utt, a Python code which contains linear algebra routines for r8utt matrices (real, 64 bit, upper triangular Toeplitz format).
  546. r8vm, a Python code which contains linear algebra routines for r8vm matrices (real, 64 bit, vandermonde format).
  547. randlc, a Python code which implements a random number generator (RNG) used by the NAS Benchmark programs.
  548. 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.
  549. 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.
  550. random_sorted, a Python code which generates vectors of random values which are already sorted.
  551. random_walk_1d_simulation, a Python code which simulates a random walk in a 1-dimensional region.
  552. random_walk_2d_simulation, a Python code which simulates a random walk in a 2-dimensional region.
  553. random_walk_2d_avoid_simulation, a Python code which simulates a self-avoiding random walk in a 2-dimensional region.
  554. random_walk_3d_simulation, a Python code which simulates a random walk in a 3-dimensional region.
  555. 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.
  556. rbf_interp_1d, a Python code which defines and evaluates radial basis function (RBF) interpolants to 1D data.
  557. rbf_interp_2d, a Python code which defines radial basis function (RBF) interpolants to 2D data.
  558. reaction_ode, a Python code which sets up the ordinary differential equations (ODE) which model a simple chemical reaction A+B --k--> C.
  559. 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.
  560. 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.
  561. 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."
  562. 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.
  563. 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.
  564. ripple_ode, a Python code which sets up an ordinary differential equation (ODE) whose family of solutions start as ripples and end as hyperbolas.
  565. risk_matrix, a Python code which returns the transition and adjacency matrix for the game of RISK.
  566. 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.
  567. rk23, a Python code which applies Runge-Kutta (RK) solvers of order 2 and 3 to a system of ordinary differential equations (ODE);
  568. rk34, a Python code which applies Runge-Kutta (RK) solvers of order 3 and 4 to a system of ordinary differential equations (ODE);
  569. 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.
  570. rk45, a Python code which applies Runge-Kutta (RK) solvers of order 4 and 5 to a system of ordinary differential equations (ODE);
  571. rkf45, a Python code which implements the Runge-Kutta-Fehlberg (RKF) solver for the approximate solution of an ordinary differential equation (ODE) system.
  572. 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.
  573. robertson_ode, a Python code which sets up a system of three nonlinear stiff ordinary differential equations (ODE) characterizing an autocatalytic chemical reaction.
  574. roessler_ode, a Python code which sets up the Roessler system of ordinary differential equations (ODE).
  575. root_rc, a Python code which seeks a solution of a scalar nonlinear equation f(x)=0, using reverse communication (RC), by Gaston Gonnet.
  576. roots_rc, a Python code which seeks solutions of a system of nonlinear equations, using reverse communication (RC), by Gaston Gonnet.
  577. 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.
  578. roulette_simulation, a Python code which simulates the spinning of a roulette wheel and the evaluation of certain common roulette bets.
  579. 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.
  580. 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.
  581. 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.
  582. sammon_data, a Python code which generates six examples of M dimensional datasets for cluster analysis.
  583. 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.
  584. 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.
  585. 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.
  586. 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.
  587. sensitive_ode, a Python code which sets up a second order ordinary differential equation (ODE) which exhibits sensitive dependence on the initial condition.
  588. set_theory, a Python code which implements set theory operations such as union, intersection, complement, symmetric difference.
  589. sftpack, a Python code which implements the slow Fourier transform (SFT), intended as a teaching tool and comparison with the fast Fourier transform (FFT).
  590. shallow_water_1d, a Python code which simulates the evolution of a 1D fluid governed by the time-dependent shallow water equations.
  591. shepard_interp_1d, a Python code which defines and evaluates Shepard interpolants to 1D data, based on inverse distance weighting.
  592. simplex_coordinates, a Python code which computes the Cartesian coordinates of the vertices of a regular simplex in M dimensions.
  593. 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.
  594. simplex_grid, a Python code which generates a regular grid of points over the interior of an arbitrary simplex in M dimensions.
  595. 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.
  596. 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.
  597. sine_transform, a Python code which demonstrates simple properties of the discrete sine transform (DST).
  598. 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.
  599. 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.
  600. 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.
  601. snakes_and_ladders, a Python code which provides some tools for studying the game of Snakes and Ladders.
  602. 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.
  603. snakes_matrix, a Python code which returns the transition matrix for the game of Snakes and Ladders.
  604. sobol, a Python code which computes elements of a Sobol Quasi Monte Carlo (QMC) sequence.
  605. solve, a Python code which demonstrates how Gauss elimination can be used to solve a linear system A*x=b.
  606. solve_bvp_test, a Python code which calls scipy.integrate.solve_bvp(), which solves boundary value problems (BVP) in one spatial dimension.
  607. sort_rc, a Python code which sorts a list of any kind of objects, using reverse communication (RC).
  608. sortrows, a Python code which lexically sorts the rows of an array, in a similar fashion to the MATLAB sortrows() function.
  609. sparse_test, a Python code which tests the scipy.sparse() functions for creating sparse matrices and carrying out linear algebraic functions on them;
  610. 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.
  611. 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.
  612. 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.
  613. 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.
  614. 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.
  615. 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.
  616. 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.
  617. 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.
  618. 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.
  619. 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.
  620. 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.
  621. 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.
  622. square_grid, a Python code which computes a grid of points over the interior of a square in 2D.
  623. 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.
  624. 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.
  625. 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.
  626. 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.
  627. 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.
  628. 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.
  629. st_io a Python code which reads and writes sparse linear systems stored in the Sparse Triplet (ST) format.
  630. st_to_ccs, a Python code which converts sparse matrix data from Sparse Triplet (ST) format to Compressed Column Storage (CCS) format;
  631. 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.
  632. stiff_ode, a Python code which sets up a stiff ordinary differential equation (ODE).
  633. stochastic_diffusion, a Python code which implements several versions of a stochastic diffusivity coefficient.
  634. stokes_2d_exact, a Python code which evaluates exact solutions to the incompressible steady Stokes equations over the unit square in 2D.
  635. 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.
  636. 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.
  637. 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.
  638. 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.
  639. 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.
  640. 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).
  641. 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.
  642. svd_powers, a Python code which applies singular value decomposition (SVD) analysis to a set of powers A(i,j) = x(i)^j.
  643. 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.
  644. 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).
  645. svd_test, a Python code which demonstrates the calculation of the singular value decomposition (SVD) and some of its properties;
  646. 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.
  647. table_io, a Python code which reads and writes files.
  648. 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.
  649. tennis_matrix, a Python code which computes the transition matrix for a game of tennis, which has 17 distinct states.
  650. test_eigen, a Python code which implements test matrices for eigenvalue analysis.
  651. test_int, a Python code which implements test problems for approximate integration (quadrature) in one dimension.
  652. test_interp, a Python code which defines test problems for interpolation, provided as a set of (x,y(x)) data.
  653. test_interp_1d, a Python code which defines test problems for interpolation of data y(x), which depends on a 1D argument.
  654. test_interp_2d, a Python code which defines test problems for interpolation of data z(x,y), which depends on a 2D argument.
  655. test_lls, a Python code which implements linear least squares test problems of the form A*x=b.
  656. 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.
  657. test_matrix_exponential, a Python code which defines a set of test cases for computing the matrix exponential.
  658. test_min, a Python code which implements test problems for minimization of a scalar function of a scalar variable.
  659. test_nonlin, a Python code which implements test problems for the solution of systems of nonlinear equations.
  660. test_optimization, a Python code which implements test problems for optimization of a scalar function of several variables, as described by Molga and Smutnicki.
  661. 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.
  662. test_zero, a Python code which defines some functions f(x) suitable for testing software that solves f(x)=0;
  663. tester, a BASH script which runs the test codes.
  664. 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.
  665. 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.
  666. tetrahedron_exactness, a Python code which tests the exactness of a quadrature rule over the interior of a tetrahedron in 3D.
  667. tetrahedron_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of a tetrahedron in 3D.
  668. tetrahedron_grid, a Python code which computes a grid of points over the interior of a tetrahedron in 3D.
  669. 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.
  670. 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.
  671. tetrahedron_monte_carlo, a Python code which uses the Monte Carlo method to estimate an integral over the interior of a tetrahedron in 3D.
  672. tetrahedron_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for the tetrahedron, with exactness up to total degree 10.
  673. 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.
  674. theta_method, a Python code which solves one or more ordinary differential equations (ODE) using the theta method.
  675. 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.
  676. tictoc, a Python code which provides versions of the tic() and toc() functions for wallclock timing.
  677. timer_test, a Python code which tests various timers.
  678. timestamp, a Python code which prints the current YMDHMS date as a timestamp.
  679. toeplitz_cholesky, a Python code which computes the Cholesky factorization of a symmetric positive definite (SPD) Toeplitz matrix.
  680. toeplitz_inverse, a Python code which computes the inverse of a Toeplitz matrix.
  681. 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.
  682. 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.
  683. 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.
  684. toms179, a Python code which calculates the incomplete Beta ratio, by Oliver Ludwig. This is a version of ACM TOMS algorithm 179.
  685. toms243, a Python code which evaluates the logarithm of a complex value, by David Collens. This is a version of ACM TOMS algorithm 243.
  686. toms443, a Python code which evaluates the Lambert W function, by Fritsch, Shafer and Crowley. This is a version of ACM TOMS algorithm 443.
  687. 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.
  688. 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.
  689. 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!
  690. 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.
  691. toms923, a Python code which evaluates the Pfaffian for a dense or banded skew symmetric matrix, by Michael Wimmer.
  692. tough_ode, a Python code which sets up a system of four ordinary differential equations (ODE) which is extremely difficult to solve accurately.
  693. traffic_simulation, a Python code which simulates the cars waiting to get through a traffic light.
  694. 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.
  695. trapezoidal_explicit, a Python code which solves one or more ordinary differential equations (ODE) using the (explicit) trapezoidal method.
  696. 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.
  697. triangle, a Python code which computes properties, including angles, area, centroid, circumcircle, edge lengths, incircle, orientation, orthocenter, and quality, of a triangle in 2D.
  698. 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.
  699. triangle_exactness, a Python code which tests the exactness of a quadrature rule over the interior of a triangle in 2D.
  700. triangle_grid, a Python code which computes a grid of points over the interior of a triangle in 2D.
  701. 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.
  702. triangle_interpolate, a Python code which shows how vertex data can be interpolated at any point in the interior of a triangle.
  703. 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.
  704. 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.
  705. 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.
  706. triangle_witherden_rule, a Python code which returns a symmetric Witherden quadrature rule for the triangle, with exactness up to total degree 20.
  707. triangle01_integrals, a Python code which returns the integral of any monomial over the interior of the unit triangle in 2D.
  708. 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.
  709. tridiagonal_solver a Python code which solves a tridiagonal linear system.
  710. truel_simulation, a Python code which simulates N repetitions of a duel between three players, each of whom has a known firing accuracy.
  711. 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.
  712. 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].
  713. 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.
  714. 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).
  715. 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.
  716. tsp_moler, a Python code which tries to optimize the traveling salesperson problem (TSP), written by Cleve Moler.
  717. 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.
  718. 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.
  719. ubvec, a Python code which demonstrates how nonnegative integers can be stored as unsigned binary vectors, and arithmetic can be performed on them.
  720. 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.
  721. umlaut_remover, a Python code which replaces certain special characters in German text by English equivalents, based on work by John Berroa.
  722. unicycle, a Python code which considers permutations containing a single cycle, sometimes called cyclic permutations.
  723. uniform, a Python code which contains uniform random number generators (RNG) for several arithmetic types.
  724. unstable_ode, a Python code which sets up an unstable ordinary differential equation (ODE) which the backward Euler method incorrectly drives to zero.
  725. 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.
  726. urn_simulation, a Python code which simulates the experiment of sampling K balls from an urn containing N balls of various colors.
  727. 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.
  728. usa_matrix, a Python code which defines the adjacency matrix for US states, using a variety of matrix formats.
  729. 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.
  730. 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.
  731. 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().
  732. 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.
  733. 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.
  734. 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.
  735. 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).
  736. vin, a Python code which computes the check digit for a Vehicle Identification Number (VIN), or verifies that a given VIN is legitimate.
  737. 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;
  738. 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.
  739. walker_sample, a Python code which efficiently samples a discrete probability density function (PDF) represented by a vector, using Walker sampling.
  740. walsh_transform, a Python code which implements the Walsh data transform.
  741. 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).
  742. 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.
  743. wedge_exactness, a Python code which tests the exactness of a quadrature rule over the interior of the unit wedge in 3D.
  744. wedge_felippa_rule, a Python code which returns a Felippa quadrature rule for approximating integrals over the interior of the unit wedge in 3D.
  745. wedge_grid, a Python code which computes a grid of points over the interior of the unit wedge in 3D.
  746. 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.
  747. 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.
  748. 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.
  749. 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.
  750. 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;
  751. wishart_matrix, a Python code which produces sample matrices from the Wishart or Bartlett distributions, useful for sampling random covariance matrices.
  752. wtime, a Python code which shows how to return a reading of the wall clock time.
  753. 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.
  754. zero, a Python code which seeks a solution of a scalar nonlinear equation f(x)=0, by Richard Brent.
  755. 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.
  756. zero_rc, a Python code which seeks a solution of a scalar nonlinear equation f(x)=0, using reverse communication (RC), by Richard Brent.
  757. 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 04 March 2024.