151lecture3-24-15

Upload: dan-mc

Post on 23-Feb-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/24/2019 151Lecture3-24-15

    1/6

    The Cooper Union for the Advancement of Science and Art

    Chemical Engineering Department

    ChE 151 Lecture

    3/24/15

    Prof. Davis

  • 7/24/2019 151Lecture3-24-15

    2/6

    The Cooper Union for the Advancement of Science and Art

    Chemical Engineering Department

    Ch. 5.2: Eulers Method

    a!lor sa!s "e ca# e$%a#d ! at so&e %oi#t ti:

    ( ) ( ),dy f t y for a t b with y adt = =

    ( ) ( ) ( ) ( ) ( ) ( )

    2

    ' ''

    2i

    i i i i

    t ty t y t t t y t y

    = + +

    'f "e defi#e a ste% si(e h ) ti*1+ tifor a#! i a#d

    evaluate at a #ear,! %oi#t t i*1:

    ( ) ( ) ( )( ) ( )2

    ''

    1 ,

    2i i i i i

    hy t y t hf t y t y

    + = + +

  • 7/24/2019 151Lecture3-24-15

    3/6

    The Cooper Union for the Advancement of Science and Art

    Chemical Engineering Department

    Eulers -Marchi# 0or&ula

    '#ori# the error ter& "hich ro"s "ith h2

    :( ) ( ) ( )( )1 ,i i i iy t y t hf t y t+ +

    i#ce ! is a%%ro$i&ate let the #e" varia,le "i#dicate the a%%ro$i&atio# to !:

    ( ) ( ) ( )( )1 ,i i i iw y w t w t hf t w t + = +

    i&%lif!i# #otatio#:

    ( ) ( )1 ,i i i i i iw w t w w hf t w+ = +@

  • 7/24/2019 151Lecture3-24-15

    4/6

    The Cooper Union for the Advancement of Science and Art

    Chemical Engineering Department

    si# Eulers Method

    o i&%le&e#t the &ethod "e "ould defi#e avector of ti&es call it -t a#d the# calculate

    a# a%%ro$i&atio# to ! -" ,! -&archi#

    for"ards i# -ti&e fro& the -i#itial ti&e t6) a:

    ( )

    ( )

    ( )

    ( )

    ( )

    00 0

    0 0 01 1

    2 2 1 1 1

    1 1 2 2 2

    ,

    2 , ,

    1 ,

    ,

    N N N N N

    N

    y tt wa

    w hf t wt wa h

    t t a h w w w hf t w

    t wa N h w hf t w

    t w

    ++ = = + = = + + +

    MM M M

  • 7/24/2019 151Lecture3-24-15

    5/6

    The Cooper Union for the Advancement of Science and Art

    Chemical Engineering Department

    7ctivit!: Euler i# Pseudocode

    i&e: 16 &i# to do 16 &i# discuss8rite a# alorith& i# %seudocode "hichi&%le&e#ts Eulers &ethod to solve the '9P

    for the 1storder irreversi,le eth!l,e#(e#e

    reactor:( ), 0 oEB f EB EB EB

    dCk C C C

    d

    = = =

    our out%ut should ,e a vector of uesses forCE;"hich ca# ,e i#ter%olated to et a#

    a%%ro$i&ati# fu#ctio#. 7ssu&e !our ste%

    si(e is s&all 16

  • 7/24/2019 151Lecture3-24-15

    6/6

    The Cooper Union for the Advancement of Science and Art

    Chemical Engineering Department

    7#s"er: Eulers Methodet = ) 166666 > et ? of ti&e %oi#ts = to evaluate

    et t6) 6 tfi#al) 16 > et the i#itial/fi#al ti&e %oi#ts

    h ) tfi#al+ t6 / = > Calculate the ste% si(e h ) 1e A#o"# i#itial E; co#c. rate co#st.

    > Calculate the first a%%ro$i&atio# %oi#ts"1 ) CE;

    6 > " vector is a# out%ut/a#s"er

    t1 ) t6 > i&e vector is also a# out%ut

    0or i ) 1:= + 1 > 8e alread! did the first o#e

    "i*1 ) "i * hB@fB"i > 0i#d #e$t uess fro& %rev.

    ti*1 ) ti * h > Aee% vector of ti&es

    E#d 0or loo%

    > 7#s"er is vector of uesses " a#d vector of ti&es t sa&e si(e