4_optimization
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
Harvard Applied Math 205: Code Examples Unit 4: Nonlinear Equations and Optimization ============================================ bisection.py - Demonstrates the one-dimensional bisection root-finding algorithm. iter.py - Demonstrates two possible fixed-point iterations for finding the solution to a nonlinear equation. One converges to the solution, whereas the other diverges. iter_2d.py - Demonstrates a fixed-point iteration to find the solution of a two-dimensional nonlinear function. gq_solve.py - Compares a custom implementation of the Newton method to Python's "fsolve" routine for finding the nodes and weights in the two-point Gauss quadrature scheme. n_secant.py - Uses the Newton and secant methods to find the solution to a nonlinear equation. himmelblau.py - A common program file that defines the Himmelblau function, a common optimization benchmark function. The Jacobian and Hessian of the Himmelblau function are also defined. This file is used by the h_sdescent.py, h_newton.py, and h_bfgs.py examples. h_sdescent.py - Finds minima of the Himmelblau function using the steepest descent method. h_newton.py - Finds critical points of the Himmelblau function using the Newton method. h_bfgs.py - Finds minima of the Himmelblau function using the BFGS optimization method. penalty.py - Demonstrates solving a constrained optimization problem using the penalty method. linprog.py - this Python program solves the linear program described in the slides. It makes use of the Python module cvxopt that is available online. linprog_alt.py - this is an alternative Python program that solves the same linear program, but with the linprog library in SciPy. feasible.gnu - Data to draw the wireframe outline of the feasible set for the example linear program. In Gnuplot, type "splot 'feasible.gnu' with lp" to see a 3D plot of the outline.