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