Report due date. Please note: report has to be handed in by Monday, May 16 noon.

Similar documents
An Iterative Descent Method

Unconstrained Optimization

Optimization and Calculus

1. Method 1: bisection. The bisection methods starts from two points a 0 and b 0 such that

Lecture 5. September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico

Scientific Computing: Optimization

NONLINEAR. (Hillier & Lieberman Introduction to Operations Research, 8 th edition)

Optimization Methods via Simulation

CS 542G: Robustifying Newton, Constraints, Nonlinear Least Squares

AM 205: lecture 18. Last time: optimization methods Today: conditions for optimality

PHYS 410/555 Computational Physics Solution of Non Linear Equations (a.k.a. Root Finding) (Reference Numerical Recipes, 9.0, 9.1, 9.

Numerical Optimization. Review: Unconstrained Optimization

1 Newton s Method. Suppose we want to solve: x R. At x = x, f (x) can be approximated by:

Gradient Descent. Dr. Xiaowei Huang

Vector Derivatives and the Gradient

Root Finding (and Optimisation)

REVIEW OF DIFFERENTIAL CALCULUS

Computer simulation can be thought as a virtual experiment. There are

Constrained optimization. Unconstrained optimization. One-dimensional. Multi-dimensional. Newton with equality constraints. Active-set method.

MA102: Multivariable Calculus

Introduction to gradient descent

Math 10b Ch. 8 Reading 1: Introduction to Taylor Polynomials

Nonlinear Optimization for Optimal Control

2.098/6.255/ Optimization Methods Practice True/False Questions

Constrained Optimization

LECTURE 22: SWARM INTELLIGENCE 3 / CLASSICAL OPTIMIZATION

Lecture 35 Minimization and maximization of functions. Powell s method in multidimensions Conjugate gradient method. Annealing methods.

The classifier. Theorem. where the min is over all possible classifiers. To calculate the Bayes classifier/bayes risk, we need to know

The classifier. Linear discriminant analysis (LDA) Example. Challenges for LDA

Unconstrained minimization of smooth functions

Introduction to Unconstrained Optimization: Part 2

LOCAL SEARCH. Today. Reading AIMA Chapter , Goals Local search algorithms. Introduce adversarial search 1/31/14

8 Numerical methods for unconstrained problems

MATHEMATICS FOR COMPUTER VISION WEEK 8 OPTIMISATION PART 2. Dr Fabio Cuzzolin MSc in Computer Vision Oxford Brookes University Year

Optimization. Totally not complete this is...don't use it yet...

Quasi-Newton Methods

Math 273a: Optimization Netwon s methods

Optimization Methods. Lecture 19: Line Searches and Newton s Method

Bindel, Spring 2016 Numerical Analysis (CS 4220) Notes for

Notes for CS542G (Iterative Solvers for Linear Systems)

Lecture 17: Numerical Optimization October 2014

A6523 Signal Modeling, Statistical Inference and Data Mining in Astrophysics Spring

BOUNDARY VALUE PROBLEMS

Solution Methods. Richard Lusby. Department of Management Engineering Technical University of Denmark

Math 409/509 (Spring 2011)

FALL 2018 MATH 4211/6211 Optimization Homework 1

Sections 4.1 & 4.2: Using the Derivative to Analyze Functions

Numerical Optimization Algorithms

Newton-Raphson. Relies on the Taylor expansion f(x + δ) = f(x) + δ f (x) + ½ δ 2 f (x) +..

Optimization Tutorial 1. Basic Gradient Descent

Unconstrained optimization

ROOT FINDING REVIEW MICHELLE FENG

Computational Finance

Optimization. Escuela de Ingeniería Informática de Oviedo. (Dpto. de Matemáticas-UniOvi) Numerical Computation Optimization 1 / 30

MAT 419 Lecture Notes Transcribed by Eowyn Cenek 6/1/2012

Exploring the energy landscape

On the interior of the simplex, we have the Hessian of d(x), Hd(x) is diagonal with ith. µd(w) + w T c. minimize. subject to w T 1 = 1,

Local search algorithms. Chapter 4, Sections 3 4 1

Practical Numerical Methods in Physics and Astronomy. Lecture 5 Optimisation and Search Techniques

High Performance Nonlinear Solvers

Math (P)refresher Lecture 8: Unconstrained Optimization

Nonlinear Optimization

1 Computing with constraints

Physics 403. Segev BenZvi. Numerical Methods, Maximum Likelihood, and Least Squares. Department of Physics and Astronomy University of Rochester

10.34: Numerical Methods Applied to Chemical Engineering. Lecture 7: Solutions of nonlinear equations Newton-Raphson method

ARE202A, Fall 2005 CONTENTS. 1. Graphical Overview of Optimization Theory (cont) Separating Hyperplanes 1

Local Search & Optimization

Review for Exam 2 Ben Wang and Mark Styczynski

Improving the Convergence of Back-Propogation Learning with Second Order Methods

Computational Optimization. Mathematical Programming Fundamentals 1/25 (revised)

Numerical Methods I Solving Nonlinear Equations

Analysis Methods in Atmospheric and Oceanic Science

Root Finding and Optimization

Contents. 1 Introduction. 1.1 History of Optimization ALG-ML SEMINAR LISSA: LINEAR TIME SECOND-ORDER STOCHASTIC ALGORITHM FEBRUARY 23, 2016

MVE165/MMG631 Linear and integer optimization with applications Lecture 13 Overview of nonlinear programming. Ann-Brith Strömberg

Monte Carlo Methods. PHY 688: Numerical Methods for (Astro)Physics

Chapter 3 Numerical Methods

Preliminary Examination in Numerical Analysis

Lecture V. Numerical Optimization

Analysis Methods in Atmospheric and Oceanic Science

Mathematical optimization

Lecture 15 Newton Method and Self-Concordance. October 23, 2008

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

Optimization. Benjamin Recht University of California, Berkeley Stephen Wright University of Wisconsin-Madison

Lecture 5: September 12

N. L. P. NONLINEAR PROGRAMMING (NLP) deals with optimization models with at least one nonlinear function. NLP. Optimization. Models of following form:

MAT 122 Homework 7 Solutions

Math 273a: Optimization Basic concepts

SIMPLE MULTIVARIATE OPTIMIZATION

Convex Optimization. Problem set 2. Due Monday April 26th

, b = 0. (2) 1 2 The eigenvectors of A corresponding to the eigenvalues λ 1 = 1, λ 2 = 3 are

Numerisches Rechnen. (für Informatiker) M. Grepl P. Esser & G. Welper & L. Zhang. Institut für Geometrie und Praktische Mathematik RWTH Aachen

Lecture Notes: Geometric Considerations in Unconstrained Optimization

Local Beam Search. CS 331: Artificial Intelligence Local Search II. Local Beam Search Example. Local Beam Search Example. Local Beam Search Example

10.34 Numerical Methods Applied to Chemical Engineering Fall Quiz #1 Review

Multivariate Newton Minimanization

Homework #3 RELEASE DATE: 10/28/2013 DUE DATE: extended to 11/18/2013, BEFORE NOON QUESTIONS ABOUT HOMEWORK MATERIALS ARE WELCOMED ON THE FORUM.

A new nonmonotone Newton s modification for unconstrained Optimization

GENG2140, S2, 2012 Week 7: Curve fitting

SYSTEMS OF NONLINEAR EQUATIONS

Transcription:

Lecture 23 18.86

Report due date Please note: report has to be handed in by Monday, May 16 noon. Course evaluation: Please submit your feedback (you should have gotten an email)

From the weak form to finite elements Electrostatics: The electrostatic potential p and the charge distribution r fulfill the Poisson equation (1D): (x) = 4 (x) Alternative system: r the mass density, p the gravitational potential We have seen that this can be expressed in its weak form as Z b a ( on interval Ω=[a,b] Dirichlet BCs to simplify the analysis (but not necessary): or (a) = a, (b) = b Z b a ( v +4 v) dx = v +4 v) dx + v b a = for all test functions v (BCs) for all test functions v

FE approximation (x) = 1X Plugging into the weak form we get: i=1 iv i (x) Find coe cients i such that Z!! b NX ivi(x) v (x)+4 (x)v(x) dx =, a i=1 for all v 2 H 1 D ( ) What about those v s? Since we have a basis and the problem is linear in v and v, we can just write the equivalent problem: Find coe cients i such that Z!! b NX ivi(x) vj(x)+4 (x)v j (x) dx =, a i=1 for j =1,..,N

FE approximation Find coe cients i such that Z!! b NX ivi(x) vj(x)+4 (x)v j (x) a i=1 dx =, for j =1,..,N Rearranging the terms a bit, the equation can be written as: Solve A ~ = ~ b with Z b ~ =( 1, 2,..., N ), A ij = vi(x)v j(x)dx, b i =4 a Z b a (x)v i (x)dx Since we need to invert a matrix, it makes sense to choose the basis such that most entries in A are zero! This is the case if different vi have only very small support (hence the name finite elements )

Nonlinear finite elements Solve (x) d2 dx 2 (x) = Z b a ( 4 (x) Equivalent weak statement: Find Φ such that for all v i : (x)+4 (x)) v i (x)dx = The same derivation as before now results in nonlinear coupled equations X i,j A ijk i j = b k with bk as before but A ijk = (1) Z b a v i (x)v j (x)v k (x)dx We now need a nonlinear root-finding algorithm to solve (1) for ɸ i.

asonable shot at this, especially if f is twice Nonlinear FE X How to solve? problems i,j A ijk i j = b k Write as r k ( ~ )= X i,j A ijk i j b k t f : R n Minimize (, ],! find ~r( ~ ) 2 2 We thus need methods to solve nonlinear problems. Quite general: given x s.t. a function f (x ) = f, we minneed to find find min {f (x)} n x R min {f (x)} n x R x R n {f (x)} l, but some cases, like f convex, are fairly solvable. find x s.t. f x lem: How about f : R n R, differentiable? Let s assume f is differentiable Then the problem becomes a root finding problem: find x s.t. f (x ) =

est we can get Nonlinear root-finding optimization: f (x) = 1 2 x t Ax x t b + c. ommon (actually universal) r expansion Let s first consider a particular form of f: f (x) = 1 2 x t Ax x t b + c. x) = f (x) + ( x) t f (x) + 1 2 ( x)t f (x) x + ly universal) Interpretation: Energy, quadratic in x. We have seen these kinds of f (x) = energies in the context of CG. Here: f (x) = Ax b = x = A 1 b mean A In has other to be words, invertible? quadratic Is this optimization all we need? amounts to a single matrix inversion (using direct methods, iterative methods (CG etc.)). But A has to be more than invertible! R. A. Lippert Non-linear optimization

Max, min, saddle, or what? Requires A be positive definite, why? 3 2.5 Positive definitenes reexamined.5 2 1 A 1.5 not only needs to be invertible, 1.5 but also positive definite 1 2.5 1 f (x) = 2.5 3 1.5 1.5 1 Otherwise, f.5 could also be a maximum or saddle point.5.5.5.5.5 1 1 1 1 or a line! 1 1.5.8.5 1 1.5.6.4.2 2 1 1.5.5 1 1.5.5 1.5.5 1 1.5.5 1 Positive definiteness is crucial to guarantee that we found a minimum by matrix inversion for quadratic energies! R. A. Lippert Non-linear optimization For general energies, positive definiteness requires convex f(x) image source: Ross A. Lippert D. E. Shaw Research

Nonlinear root-finding What do we do if f(x) is more complicated? If you have no clue, Taylor you can do! To start, lets consider 1D case: Minimize f(x): If x * is solution, we can write f (x )=f(x)+f (x)(x x)+ 1 2 f 2 (x)(x x)+... Need to find x * such that f (x * ) =, thus x = x x f (x) f (x) x n+1 = x n f (x n ) f (x n )

Nonlinear root-finding x = x x f (x) f (x) f (x n ) x n+1 = x n f (x n ) Instead of minimizing f, we could also search for a root of g(x)=f (x): x n+1 = x n g(x n ) g (x n ) Lecture

Nonlinear root finding

Nonlinear root-finding Now in higher dimensions: Taylor is now f (x ) f (x)+(x x) T rf (x)+ 1 2 (x x) T rrf (x)(x x)+... f(x) is a matrix of second derivatives (also called Hessian or Jacobian) Again, min f(x) means f(x * )= for solution x * x = x x (rrf (x)) 1 rf (x)

ton s method Naive nonlin. root solver (Newton-Raphson method) ewton s method finding x s.t. f (x) = ) Algorithm: find x s.t. f (x) = ) ; Start with initial guess x. Then iterate x i = ( f (x i )) 1 f (x i ) x i+1 = x i + x i until Δxi < tolerance or max. number if steps f (x i ) posdef, ( f (x i )) t (x i+1 x i ) < so x i is a ion of decrease (could overshoot) This means we need to invert the Hessian, i.e. solve again a linear problem! f (x i ) not posdef, x i might be in an increasing ion. However, (as in 1D), we have to do this many times (at each iteration!) convex, f (x i+1 ) f (x i ), so problems go away.

Why and where it fails x i = ( f (x i )) 1 f (x i ) x i+1 = x i + x i if f (x i ) posdef, ( f (x i )) t (x i+1 x i ) < so x i is a direction of decrease (could overshoot) if f (x i ) not posdef, x i might be in an increasing direction. if f is convex, f (x i+1 ) f (x i ), so problems go away. T

Example 1D example of trouble in 1D 1D example of trouble: f (x) = x 4 2x 2 + 12x 2 15 1 5 5 1 15 1D example of trouble: f (x) = x 4 2x 2 + 12x 2 15 1 5 5 1 15 2 2 1.5 1.5.5 1 Has one local minimum Is not convex (note the concavity near x=) 2 2 1.5 1.5.5 1 1.5 source: Ross A. Lippert D. E. Shaw Research R. A. Lippert Non-linear optimization

Example in 1D derivative of trouble: f (x) = 4x 3 4x + 12 2 15 1 5 5 1 negative f around x= is a barrier to reach solution! 15 2 1.5 1.5.5 1 1.5 the negative f region around x repells the iterates: source: Ross A. Lippert D. E. Shaw Research

n ) f (x i ) Line search methods Algorithm: Try to enforce f(x i+1 )<f(x i ) by going in gradient direction far enough : i = ( f (x i )) 1 f (x i ) x i = ( f (x i )) 1 f (x i ) = x i + α i x i x i+1 = x i + α i x i t f (x i + α i x i ) f (x i ). If x i is a direction ch that f x x f x. If x Since Δx i is a direction in which f decreases, there will be some α i > such that f decreases. i exists. n do 1D optimization problem, But since f is nonlinear, we would need to solve the nonlinear optimization problem min f (x i + α i x i ) α i (,β] It s getting complicated use this rule: α i = ρµ n some n Convergence very much depends on quality of initial guess s x ) f (x ) νs ( x ) t f (x )

Alternatives Instead of solving f=, it is often easier to just minimize f, by using, e.g. gradient descent and a good guess for the step length: 1. dient Start descent: with initial guess xi 2. gradient descent: 1 Search direction: r i = f (x i ) 2 Search step: x i+1 = x i + α i r i Search direction: r i = f (x i ) 3 Pick alpha: (depends on what s cheap) 3. Search step: x i+1 = x i + α i r i 4. Pick Find alpha: optimal (depends!i on what s c 1 linearized α i = r t E.g. by approx 1D minimization of etc. i ( f )r i r t i r i 2 1D minimization f (x i + αr i ) (danger: low 3 zero-finding ri t f (x i + αr i ) = Can be extended to nonlinear CG as well Do not need second derivative evaluations!

What if f has: many local minima, is not differentiable or x is discrete? Traveling salesman problem: Find shortest route to visit all cities once! Here, f=length of route, x: ordered indices of cities to visit Many different methods available: Monte Carlo, simulated annealing, genetic algorithms etc.

What if f is has many local minima? Rough energy landscape: Gradient descent fails. General idea: Make sure we don t get stuck in local minimum!

Genetic algorithm Sketch: Start with a population of genes (for instance, random values of x in f(x)) A C B M Calculate cost for each. Then: XXX (no drugs) and rock & roll: Generate new x by crossing parents of good fitness Incorporate random mutations into children (=>overcomes minima) Run long enough until most populations converge to an optimal set of genes (=> best values of vector x)

Monte Carlo E Idea: Find a way to statistically sample all states according to well-defined probability (lower energy states = higher probability) Need: A way to walk through phase space such that there is a finite probability to visit each state in finite steps Ex.: Particle in energy landscape, coupled to heat bath (temperature T): Statistical physics: PDF for states with energy E is given by p(e) =e E = 1 k B T In order to visit all possible states with correct probability, the Metropolis algorithm can be used

Metropolis algorithm Make a trial move from current state x to a new randomly selected state x Calculate energy change de = E - E If de<, accept the new state x and repeat. If de>, accept state with probability e de : Draw random number r in [,1) Accept state if e de >r Application: Packing problems (see class)