lec36_12152006

Upload: ehsanmojtahedi

Post on 09-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 lec36_12152006

    1/6

    10.34, Numerical Methods Applied to Chemical Engineering

    Professor William H. Green

    Lecture #36: TA-Led Final Review.

    BVP: Finite Differences or Method of Lines

    xC

    = Forward/Upwind/Central difference formulas

    2

    2

    x

    C

    = Central difference-like

    Understand when to use the different formulas.

    Boundary Condition (Flux) D

    boundaryx

    C

    =Reaction per surface area [moles/m2s]

    [m2/s] Internal Flux [(mol/m3)/m]

    A

    BThe flux is the same for these two arrows

    can solve even if A and B are not known

    Partition

    functioncoefficient Figure 1. The flux is the same for arrows at A and B.

    Method of Lines

    Solve a differential equation

    along line i = 2, , N-1

    x

    CC

    x

    C

    2

    13

    2

    =

    Sparse

    Discretize

    y

    1 2 3

    xBoundary Condition

    may need to useshooting method

    Initial Condition

    gradient stiff in y-directon

    Figure 2. Example problem good for method of lines.

    If this is the B.C.:x

    CC

    x

    C

    =

    12

    1

    Use this additional equation with rest to solve for C1 D.A.E.

    Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical Engineering, Fall2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of Technology. Downloaded on [DDMonth YYYY].

  • 8/7/2019 lec36_12152006

    2/6

    Models vs. Datay = f(x,) y1 = f(x1,)

    y2 = f(x2,)

    |

    yn = f(xn,)

    Assumption: 1) y distributed normally around y

    2) x are known exactly

    P(y)

    y y y

    10.34, Numerical Methods Applied to Chemical Engineering Lecture 36Prof. William Green Page 2 of 6

    Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical Engineering, Fall2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of Technology. Downloaded on [DDMonth YYYY].

    WANT:

    1) Find the best 2) Is the model consistent?3) Error bars on parameters

    Assume model is exact

    xi yi f(=iy xi,) data will be distributed around model

    x1 y1 x2 y2 xn yn

    P(yi) ( )

    2

    2

    2

    ),(exp

    ii xfy

    P(y) ( )

    ( )

    ==

    N

    i

    ii

    N

    i

    ii xfyxfy

    1

    2

    21

    2

    2

    ),(2

    1exp

    2

    ),(exp

    FIT: Max P(y) Min

    ( )=

    N

    iii

    xfy1

    2),(

    k = Aexp(-Ea/RT)

    ln k = ln A - Ea/R (1/T) Linear in parameters ln k, ln A,

    Ea/R

    y = xn = [xTx]-1xTy

    xn: n rows (measurements), m parameters

    Figure 3. A normal distribution.

  • 8/7/2019 lec36_12152006

    3/6

    S.V.D.: x = UmxmmxnVnxn

    = =

    N

    i

    i

    i

    iv

    yv

    1 Sample variance guess for : s2 =

    )dim(

    )(1

    2

    =

    N

    yyN

    i

    i

    y is mean y, f(x,)

    If non-linear, use optimization methods.

    For correctness, compare s to . Quantitatively, use 2 (chi squared)

    2 =( )

    =

    N

    i

    ii xfy

    12

    2),(

    Transform to z

    P(y)

    y y y

    1

    0

    mean of 0, = 1

    z[N-dim()] 2min

    2

    Goodness of fit: areaunder curve 2min to

    P(y)

    y y y

    Error Bars Difficult

    If linear in parameters and is known, covariance() = 2[xTx]-1 (diagonal mxm matrix)

    i=

    min,iz

    2,5[xTx]

    i,i

    -1/2 m = # parameters

    min,i point that boundsfrom 2 error on min,i

    0.0252.5%

    Figure 4. Usually we will accept a model with the integral greater than 5%, but we wouldlike it higher. If 99% chance it is wrong, reject.

    Figure 5. Chi-squared distribution.

    Non-linear: [xT

    x]i,i xi,j =j

    ixf

    ),(Find xi,j

    10.34, Numerical Methods Applied to Chemical Engineering Lecture 36Prof. William Green Page 3 of 6

    Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical Engineering, Fall2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of Technology. Downloaded on [DDMonth YYYY].

  • 8/7/2019 lec36_12152006

    4/6

    I

    F

    I

    y

    x

    F

    n MATLAB, use nlinfit, nlparei

    10.34, Numerical Methods Applied to Chemical Engineering Lecture 36Prof. William Green Page 4 of 6

    Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical Engineering, Fall2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of Technology. Downloaded on [DDMonth YYYY].

    igure 6. Location of chi-squared and 95% confidence interval in 1-2 space.2 [1

    2 min2] = 2 additional degrees of freedom: let 1, 2 vary

    f unknown, use student t distribution based on s.

    normal

    student tbroader

    Report T(,), being N-dim. as N increases, student t approaches normal distribution

    i = ( you want to calculate )

    is known, yi is to be measured.

    Average value of parameter: m = (yi)/N

    = xN

    Tx = [ = N [x]

    Tx]-1/2/N

    Global OptimizationConvex function H 0 (Hessian Matrix is positive definite)

    Figure 7. Comparison of normal and

    Student-t distributions.

    igure 8. Example of a convex function.Only 1 minimum

    Non-convex:

    2,m2

    95% confidence

    2min

    1,m 1 1

    2

  • 8/7/2019 lec36_12152006

    5/6

    10.34, Numerical Methods Applied to Chemical Engineering Lecture 36Prof. William Green Page 5 of 6

    Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical Engineering, Fall2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of Technology. Downloaded on [DDMonth YYYY].

    Branch and bound

    Professor Barton Non convex function guarantees global minimum

    Split

    Divide domain

    Bound from aboveUnderestimate below

    Find mimina.

    Bound again

    Figure 9. An example of a

    non-convex function.

    Figure 10. An illustration of the branch and bound algorithm.If new upper bound is lower than the lower bound, use other region; can stop considering

    that section.

    Multistart:

    Take a bunch of initial guesses and then run local minimization.

    No guarantee.

    100 points, 6 variables 1006 calculations.

  • 8/7/2019 lec36_12152006

    6/6

    Simulated annealing

    E

    0 2

    Dihedral angle

    Figure 11. The energy varies with dihedral angle.

    Start at high temperature, decrease T eventually can sample wells once the point is caught

    in a minimum.

    Genetic Algorithms

    Hybrid system: integer variables and continuous variables

    Sample space by allowing function values to live, die, replicate, switch values, etc.

    Monte Carlo: Metropolis Monte Carlo

    Gillespie Kinetics Monte Carlo

    StochasticsLook at homework solutions to 10 and 11.

    Additional TopicsFourier Transforms and operator splitting may make a showing.

    10.34, Numerical Methods Applied to Chemical Engineering Lecture 36Prof. William Green Page 6 of 6

    Cite as: William Green, Jr., course materials for 10.34 Numerical Methods Applied to Chemical Engineering, Fall2006. MIT OpenCourseWare (http://ocw.mit.edu), Massachusetts Institute of Technology. Downloaded on [DDMonth YYYY].