Post on 23-Feb-2016
description
transcript
Scientists: Which scientific advance has had the most impact on people’s everyday lives?
#3: Darwin’s theory of evolution
Scientists: Which scientific advance has had the most impact on people’s everyday lives?
#3: Darwin’s theory of evolution
#2: Einstein’s relativity (cold war)
Scientists: Which scientific advance has had the most impact on people’s everyday lives?
#3: Darwin’s theory of evolution
#2: Einstein’s relativity (cold war)
#1: Newton’s Calculus
Calculus: the Science of ChangeNo single thing abides,but all things flow - Heraclitus
Example: Climate change
• Global mean temperature– Rate of change consistent with natural causes?– OR is human activity implicated?
• What else changes due to global warming?– Sea ice extent– …?
??
Think of a quantity you might measure
Think of a quantity you might measure
• How fast is it changing:– over a decade?– a year?– a month?– a day?– a second?– right now?
Monday Sept. 13Univariate Calculus 1
• Derivative: the RATE OF CHANGE• Taylor series approximations• Differentiating data
Calculus: the Science of Change
Functions as models of changing quantities
0
0
0
212
population growth:
radioactive decay:
gravity:
rt
Rt
P P e
N N e
h h gt
x
y y mx b 2 12 1
Slope: y y ym x x x
Univariate function and slope
change in slope = change in yx
x
y
( )y f x
y mx b 2 12 1
Slope: y y ym x x x
Univariate function and slope
Slope ?
x
y ( )y f x
“Slope” of a function: the tangent line
( )y f x
x x h
( )f x h
( )f x
0( ) ( )'( ) lim
hf x h f xf x h
The derivative as a limit
( )y f x
x x h
( )f x h
( )f x
0( ) ( )'( ) lim
hf x h f xf x h
The derivative as a limit
( )y f x
x x h
( )f x h( )f x
0( ) ( )'( ) lim
hf x h f xf x h
The derivative as a limit
( )f x
x
'( )f x
( )y f x
0( ) ( )'( ) lim
hf x h f xf x h
The derivative as a limit
0( ) ( )'( ) lim
= "little change in"
hf x h f x dff x h dx
d
Alternative symbols
Examples
2
2
3
1
2 2
0
2 2
2 2
( ) ,
( ) ( ) ( )
( )
'
; '( ) ?
?
lim
; '(
.
( )
)( )
h
f x x
f x h f x x hx h x x hh h
x xf h x
f f xx
f x
x
f x x
Rules of differentiation
31
RULE
Power rule:
EXAMPLE
Sum rule: ( )' ' '
?
d dx xdx x
f g f g
dx
3 4
3
2
2 7
( )'
Product rule: ( )' ' '
Multiplication by a constant: ( )' ' (2 )'
Linearity: ( )' ' '
(
?
?
(2 3
?
2 )
?)
1
'
x x
fg f g fg x
af af x
af bg af bg x x
d xdx
The Chain Rule:Latitude
1o = 110km
30o
60o
Unit conversion
100km hr
1degree degrees100km 0.91hr 110km hr
dydt
ddt
Unit conversion
100km hr
1degree degrees100km 0.91110km hr hr
dydt
ddt
d dydy dt
The CHAIN RULE
The Chain Rule( ); ( )
'( ) '( )
y f x x g t
dy dy dx f x g tdt dx dt
2 22 2
1
2 7
; ( )(1 ) i.e. ( ) 1
(1 )
(4 5
? ?
)
?
?
y f x x dyd t x g t tdt dt
d tdt
d t tdt
EXAMPLES:
Higher-order derivatives
22
'( )
''( )
dff x dx
d f dfdf x dx dx dx
(3)
2
1
'( )
''(
?
?
?
?
)
( )
'( ) 2
''( ) 2
( ) (1
)
)
(
f x
f x
f x
f x x
f x
f x x
f x x
EXAMPLES
maximum ' 0; '' 0 f f
minimum
' 0; '' 0 f f
inflectionpoint
'' 0f
Extrema
Taylor series
0
0 0 0 0 0(3) ( )2 31 1 1( ) ( ) '( ) ''( ) ( ) ( )2! 3! !
n nf x f x f x h f x h f x h f x hn
h x x
Factorial function: ! ( 1)( 2) 1 1!=1 2!=2 1=2 3!=3 2 1=6
n n n n
4!=4 3 2 1=24
(3) ( )0 0 0 0
2 30
1 1 12( ) '( ) ''( ) (! 3! !( () ) ) nnh h h hf x f x f x f x xnf fx
constant derivativeat x0
powerof h=x-x0
Taylor series example(3) ( )2 3
0 0 0 0 01 1 1( ) ( ) '( ) ''( ) ( ) ( )2! 3! !
n nf x f x f x h f x h f x h f x hn
01
2 3 4
( )
( )
2 3
Expand: ( ) (1 )
'( ) (1 ) ; ''( ) 2·(1 ) ; '''( ) 3·2·(1 )
(0) 1; '(0) 1; ''(0) 2; '''(0) 3·2
(0) !
(0) 1!
( )
about 0
1
n
n
f x x
f x x f x x f x x
f f f f
f n
fn
f x x
x
x x
Taylor series example
2 31Example: ( ) 11f x x x xx
2 31 x x x
21 x x
1 x
1
Taylor series example(3) ( )2 3
0 0 0 0 01 1 1( ) ( ) '( ) ''( ) ( ) ( )2! 3! !
n nf x f x f x h f x h f x h f x hn
02
21 122!
Expand: ( ) (1 )
'( ) 2(1 ); '(0) 2
''( ) 2; ''(0) 2
''
about 0
(0) 1
'( ) 0; '''(0) 0 etc.
( ) 1
2
xf x x
f x x f
f x f
f x f
f x x x
f
3
2
03!
1 2 0
x
x x
Negating the argument
(3) (4) ( )2 3
(3) (4) ( )2 3
4
4
2
1 1 1 1( ) (0) '(0) ''(0) (0) (0) (0)2! 3! 4! !
1 1 1 1( ) (0) '(0)( ) ''(0)( ) (0)( ) (0)( ) (0)( 1)2! 3! 4! !
1 1 (0) '(0) ''(0)2! 3!
n n
n n n
f x f f x f x f x f x f xn
f x f f x f x f x f x f xn
f f x f x f
(3) (4) ( )3 4 ( 1)1(0) (0) (0)4! !n n nx f x f xn
02Expand: ( ) (1 about 0)g x x x
EXAMPLE:
Negating the argument
(3) (4) ( )2 3
(3) (4) ( )2 3
4
4
2
1 1 1 1( ) (0) '(0) ''(0) (0) (0) (0)2! 3! 4! !
1 1 1 1( ) (0) '(0)( ) ''(0)( ) (0)( ) (0)( ) (0)( 1)2! 3! 4! !
1 1 (0) '(0) ''(0)2! 3!
n n
n n n
f x f f x f x f x f x f xn
f x f f x f x f x f x f xn
f f x f x f
(3) (4) ( )3 4 ( 1)1(0) (0) (0)4! !n n nx f x f xn
0
0
2
2
2
2
about 0
about 0
Expand: ( ) (1 )
Recall: ( ) (1 ) ( ) 1 2
g( ) 1 2
g x x
f x xf x x x
x x x
x
x
EXAMPLE:
Approximating the derivativeObservational data analysisNumerical modeling
0
0
(3) (4)2
0
3 30 0 0 0 0 0
(3) (4) 3200 0 0
1 1 1( ) ( ) '( ) ''( ) ( ) ( )2! 3! 4!
Solve for
1 ''
'( )
( ) ( ) 1 1( ) ('( ) ( ) ) 3! 4!2!
f x f x f x h f x h f x h f x h
f x
f x h ff x hf x
h
f hx xx
h h f
Forwarddifferenceapproximation
Error ~ O(h)
Differentiating data:Forward difference example
x f=x3 f’ 3x2
1 1 (8-1)/1 = 7 3
2 8 (27-8)/1 = 19 12
3 27 (64-27)/1 = 37 27
4 64 (125-64)/1 =61 48
5 125 75
0 00
( ) ( )' ) ( f x h f xf x h
1h
Approximating the derivativeObservational data analysisNumerical modeling
Backwarddifference
(3) (
0 0
0 00
4 300
)20
( ) ( )
( ) ( ) ' 1 ''(( 1 1( ) ( )3! ! !) ) 42 f x
h h
f x h f x h
f x h f xh
f x f x h fh hx
(3) (4)2 3 30 0 0 0 0 0
(3) (4) 30 0
200
00
1 1 1( ) ( ) '( ) ''( ) ( ) ( )2! 3! 4!
1 1( )( ) 1 ''(( ( ) 3)2! !)
!) 4'(f x
f x f x f x h f x h f x h f x h
f x hh f x f f
h
hh xx x h f
Forwarddifferenceapproximation
Error ~ O(h)
y( )y f x
FD
actual
x hx
BD
x h
Forward and backward differences
Approximating the derivative
20 00
(3) (4) 30 00
1 1(( 1 ''( ) ) () ) 3( )
! 4!2) !'( f x h f xf x h hf x h f x f xh
Forwarddifference
Backwarddifference
0 0 (3) (4)0
30
200
1 ''( ) 1 1( ) ( )3! 4!( ) ( '( ) 2!
) f x h ff x f f xx h hh xhf x
SUM
Approximating the derivative
Forwarddifference
Backwarddifference
SUM (3 20 )0
00
( ) ( ) 2 '( 2 ( ) 3!0) 0f x h f x h f x f x hh
/2
20 00
(3) (4) 30 00
1 1(( 1 ''( ) ) () ) 3( )
! 4!2) !'( f x h f xf x h hf x h f x f xh
0 0 (3) (4)0
30
200
1 ''( ) 1 1( ) ( )3! 4!( ) ( '( ) 2!
) f x h ff x f f xx h hh xhf x
Approximating the derivative
Forwarddifference
Backwarddifference
SUM (3 20 )0
00
( ) ( ) 2 '( 2 ( ) 3!0) 0f x h f x h f x f x hh
/2 0 00
(3) 20
( ) ( ) '( ) 1 ( )3 2 ! ff x h f f hh xx h x
Centereddifference
Error ~ O(h2)
20 00
(3) (4) 30 00
1 1(( 1 ''( ) ) () ) 3( )
! 4!2) !'( f x h f xf x h hf x h f x f xh
0 0 (3) (4)0
30
200
1 ''( ) 1 1( ) ( )3! 4!( ) ( '( ) 2!
) f x h ff x f f xx h hh xhf x
Centered difference example
x f=x3 f’ 3x2
1 1
2 8 (27-1)/2 = 13 12
3 27 (64-8)/2 = 28 27
4 64 (125-27)/2 = 49 48
5 125 (216-64)/2=76 75
6 216 (343-125)/2=109 108
7 343
0 00
( ) ( )'( ) 2f x h f x hf x h
Approximating the 2nd derivative(3) (4)
0 02 3
00 0
01 ''( ) 1 1( ) ( )3! 4!
( ) ( ) '( 2!) f x h ff xf x h f x f xh h x h
Forwarddifference
Backwarddifference
0 0 (3) (4)2 30 00 0
1 ''( ) 1 1( ) ( )3! 4!( ) ( '( ) 2!
) f x h ff x f f xx h hh xhf x
SUBTRACT
/h 0 0 0 (4)0 02
2( ) 2 ( ) ( ) '' 2 ( )4( ) !f x h f x f x h f x
hf x h
Centereddifference
Error ~ O(h2)
(4)00
0 0 30
( ) 2 ( ) ( ) 20 ''( ) 2 0 !2! ( )4f x h f x f x h f x h f x hh
Application: error analysis
Floodwaters in the Kalama Gap
V?
1/2 2( ) ; 10 /
. .150 :
160
?
?
In general
:
...?
V gh g m s
e gh m V
h m V
x
( )y f x
R
2 3/2'' 1 ;
(1 ' )fK Rf
Curvature
x
( )y f x
R
2 3/2'' 1 ;
(1 ' )fK Rf
CurvatureGentle turn
Sharp turn
r