kimbk_891523_53809698_HW10
pdf
keyboard_arrow_up
School
Arizona State University *
*We aren’t endorsed by this school
Course
PHYSICAL C
Subject
Mathematics
Date
Nov 24, 2024
Type
Pages
5
Uploaded by BailiffPelican2900
Numerical Methods
HOMEWORK 10 – Due April 17, before 11:59 pm
10.1
Application:
Finite Difference Rules
Go back to problem 9.4 (from your last HW) which had data for the
height
y
i
(m) of a pumpkin as a function of time
t
i
(sec).
a)
Use the
3-point centered
difference rule to calculate the
acceleration
(d
2
y
/d
t
2
) of the pumpkin at
t
= 1.5 seconds.
(Compare
this value to what you already know the acceleration due to gravity
should
be in m/s
2
.)
3 pts
Time, t
i
Height, y
i
0
1
2
3
0
10
20
30
b)
Use the
4-point backward
difference rule to calculate the
acceleration
(d
2
y
/d
t
2
) of the pumpkin
at
t
= 3.0 seconds.
Hint
: you can find this rule in Table 8-1 (pg 318) of the textbook, or the back
of your “Class 30/31” handout.
c)
IF you obtained and used measurements every 0.1 seconds (instead of 0.3 seconds, like in the
table of data), quantify how much you’d expect the error in your
acceleration
calculation from
part (a) to change.
10.2
Fundamentals:
Taylor Series
This is the equation for the Taylor Series expansion of
f
(
x
+
d
), as a function of
f
(
x
) and all its
derivatives at
x
, that will be given to you on your midterm and exam cheat-sheets:
Start with that equation and use it to derive the expression for
f
(
x
i
– 5
D
x
)
(
i.e. f
(
x
) evaluated
five
nodes to the left of
x
i
) as a function of
f
(
x
i
) and all the derivatives at
x
i
(up to the
FIFTH
derivative).
2 pts
f
(
x
+
δ
)
=
f
(
x
)
+
δ
ʹ
f
(
x
)
+
δ
2
2
ʹʹ
f
(
x
)
+
δ
3
3!
ʹʹʹ
f
(
x
)
+
δ
4
4!
ʹʹʹʹ
f
(
x
)
+
!
10.3
Application:
Error Order and Precision
The following is a 5-point difference scheme, over equally-spaced
x
i
, for d
3
f
/d
x
3
at
x
=
x
i
:
Write out Taylor Series expressions for each of the four
f
i
-3
,
f
i
-2
,
f
i
-1
,
f
i
+1
to the
FIFTH
derivative, like
you did in 8.4, and then combine them using the given difference scheme above to …
a)
Calculate the discretization
error order
(
i.e.
write the error =
O
(
D
x
p
) for some integer
p
).
b)
Calculate the
precision
of the scheme.
ʹʹʹ
f
(
x
i
)
=
1
2
Δ
x
3
f
i
−
3
−
6
f
i
−
2
+
12
f
i
−
1
−
10
f
i
+
3
f
i
+
1
(
)
+
Error
7 pts
10.1
Bibel
laser
hand
let
drink
18
ala
=
F"M
=
A2fXi)+f(X:-
=
f(1,2)
-2f(1.5)
+
f(1.8)
329.9
-
2(22.1)
+
23.4
=
-10m/2
ze
.
9
b)
a
=
-
f
(Xi
-
z)
+
4f(xi
-
2)
-
5f(xi
-
1)
+
2
f(xi)
hi
=4-(5x.1)
+
12
x
0)
3
-
7.78
mO
2)
29.9-2(27.7
+
23,4
-
-
9
·
I
12
=
Ol
-
9%
32
=
.09
10.2
f(xi
-
5xx)
=
f(xi)
-
56x+(xi)
+
f()
-
f(xi)
+
+
(xi)-
fN
Using
the
given
equation:
f(xi)-50xf'(Xi)
+
"(i)-
+
(xi)
+
f(xi)-f(xi)
10.3
1.)
f(xi
-
3xx)
=
f(xi)
-
30x+(xi)
+
f"(x
!
)-
*f(xi)+
f(xi)
-
xi
2.1
f(xi
-
2xx)
=
f(xi)
-
20x+(xi)
+
f(xi)
-
**
(xi)
+
f(xi)
-
xi
3.)
f(xi
-
ox)
=
f(xi)
-
oxf(xi)
f(xi)-
**
(i)
f(xi)-
fil
4)
f(xi
-
x)
=
f(xi)
+
oxf(xi)
f(xi)
+
*
i)
*fvi)+i
Plug
into
scheme
to
get:
f"(xi)
=
(ctx)
+
(xi)
+
oxf"
"
(Xi)
-
Fox
of
(Xi)+Error
a)
Error
=
0
(0x
b)
Lowest
order;
3
HW10
(
10.1 – 10.6)
due Monday April 17
10.4
DERIVING difference formula for ANY order derivative to ANY error order
Use Taylor series expansions to derive
a
forward
difference scheme, over equally-spaced points,
using any or all of
f
i
,
f
i+1
,
f
i+2
,
f
i+3
and
f
i+4
that approximates d
2
f
/d
x
2
(
2
nd
derivative at
x
i
) to order
(
D
x
3
) discretization error.
Hint
:
DON’T
write a Taylor Series for
f
i
.
f
i
is just itself (or just written as
f
(
x
i
)).
There’s nothing else
you can do with it!
Only ever create Taylor Series expansions for points
other
than
f
i
.
Show all your work!
Write all appropriate Taylor Series out, and describe your
goals
– what terms
do you need to keep, what terms do you need to eliminate?
If you follow the methodology from
class, you should end up with 4 equations for 4 unknowns (
i.e.
coefficients
a
,
b
,
c
,
d
that you’re
using to weight each Taylor Series).
It’s fine if you then use MATLAB to solve for them – you should
get nice “round” fractions in your final scheme.
10.5
Fundamentals:
Characterizing ODEs (Chapter 10)
For each of the following three ODEs …
i.
characterize its
order
(
e.g.
1
st
-order,
2
nd
-order, etc.),
ii.
characterize it as an
IVP
(Initial Value Problem) or
BVP
(Boundary Value Problem),
iii.
write the ODE in
standard
form.
7 pts
6 pts
(
B
)
y
dx
dy
⎛
⎝
⎜
⎞
⎠
⎟
=
sin(
x
)
+
d
(
x
3
)
dy
,
x
−
4
(
)
=
1
(
A
)
qe
r
=
r
dq
dr
+
d
2
q
dr
2
,
q
2
( )
=
0,
q
' 0
( )
=
1
(
C
)
1
+
d
2
x
dt
2
d
3
x
dt
3
+
x
⎛
⎝
⎜
⎜
⎞
⎠
⎟
⎟
=
−
4
dx
dt
,
x
3
( )
=
3,
x
' 3
( )
=
2,
x
'' 3
( )
=
1
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
10.4
1.1
f(xi
+
1)
=
f(xi)
+
f'(Xi)-x
+
If
"(X:)4x
+
5+
(Xi)0x
+
0(10x)
2.)
f(xi
+
2)
=
f(xi)
+
2f(xi)0x
+
2(i)
+
"(Xi)0x
+
2(j)f"(xi)0x
+
0((0x))
3.)
f(xi
+
3)
=
f(xi)
+
3f'(xi)-x
+
(3)f"(X:)4x
+
5(3)+"(Xi)0x
+
0(10x)
4.)
f(xi
+
2)
=
f(xi)
+
4f'(Xi)-x
+
I()+
"(X:)4x
+
5(y)+"(Xi)0x
+
0(10x)
Want
to
eliminate
its
3rd
derivative
Mult.
Eg1.
by
8.
Subtract
Eq2.
8(fXi
+
3)
-
f(xi
+
2)
=
7f(xi)
+
6f(xi)8x
+
I
f"
(Xi)x
5.
Mult.
Eg.
3
by
2
subtract
Eq.H
2
f(xi
+
x)
-
f(Xi
+
n)
=
-
f(xi)
+
2f(Xi10x
+
2
f"(Xi)0x
+
011ox))
6.
Add
Eq.S,
Eq.6
to
get
rid
1sder.
(fXi
+
3)
-
f(xi
+
z)
+
2
f(xi
+
x)
-
f(Xi
+
n)
=
6f(xi)
+
f"(Xi)(0x)
+
0((0x))
divide
f"(xi)
by
x
f"(xi)
=
(8*
f(xi
-
)
-
f(xi
+
z)
+
2f(Xi
+
y)
-
f(Xi
+
n)
-
bf(xi)
IX
4
S
Ali.
Orderik
B)
i.
Order:
I
ii.
BVP
ii.
BUP
iii.
=
+
iii.
Y(*)=
0
C)
i.
Order:
3
+
+
*
=
6
HW10
(
10.1 – 10.6)
due Monday April 17
10.6
Application:
(Single-Step, Explicit) Euler Method to Solve an IVP
You want to solve the following 1
st
-order Initial Value Problem:
with the
initial condition
T
(
t
= 0) =
T
0
= 30.
Why??
Because your manufacturing floor is at an excruciating
T
0
= 30
o
C (about 86 F), when you
turn on the air-conditioning.
What you want to determine is how long it will take to get the room
temperature down to 18
o
C.
The room has a volume
V
= (10m) x (20m) x (6m) = 1800 m
3
, so
knowing the density of air = 1.2 kg/m
3
there’s
m
= 2160 kg
of air you need to cool.
5 pts
dT
dt
=
−
T
18
+
43
45
−
t
300
m
= 2160 kg of air,
initially at
T
0
= 30
o
C
m
= 120 kg/min of
cold air at
T
AC
= 10
o
C
.
mc
dT
dt
=
!
mcT
AC
−
!
mcT
+
!
Q
dT
dt
=
!
m
m
T
AC
−
T
(
)
+
!
Q
mc
m
= 120 kg/min of
room air leaving at
T
(
t
)
.
Q
= 14400 – 120
t
Watts of solar heat
Your air-conditioner can only
provide 120 kg/min of cold air
(at
T
AC
= 10
o
C
, about 50F).
That
will mix around with the air in
the room, so an equal amount
of air will leave the room at
whatever the temperature of
the room is.
Let’s call that
T
(
t
)
.
Room temp
=
T
(
t
)
That all wouldn’t be too bad, except the sun is still coming in the windows, putting in a lot of heat!
It’s near the end of the day, so the amount of solar heat is dropping off with time, according to the
formula
Q
= 14400 – 120
t
, where
t
is in minutes, and
Q
in Watts (so it will be at 0 after 2 hours).
So what does all this mean?
You’ll learn in a Thermodynamics class that the temperature of the
room
T
(
t
)
will go up and down as the
thermal energy
in the room goes up and down.
The solar
heat
raises
the thermal energy.
The difference between the cold air in and room-temp air out
lowers
the thermal energy.
The “energy balance” is given by the 1
st
order ODE
The “
c
” in the equation represents the “thermal capacity” of the air (how much heat it takes to
raise the temperature of 1 kg of air by 1
o
C).
That’s known to be 1000 J/kg
.o
C.
When I plug all the
values for the problem in the equation, and convert units so I’m working with time (
t
) in minutes, I
get the equation I started with at the top of the page!
So let’s get back to that (since, as you
probably figured out by now, you didn’t really have to understand anything in this “Why??” box to
solve the problem).
, which can be rewritten as
(a)
Use the (single-step, explicit)
Euler
method to solve the 1
st
-order IVP
,
where
T
is the temperature of the room (in
o
C), and
t
is time (in
minutes).
Solve the problem over the range
t
= [0, 40] minutes,
using step size
D
t
= 10 min (
i.e.
calculate
T
i
at
t
0
= 0,
t
1
= 10,
t
2
= 20,
t
3
= 30, and
t
4
= 40 minutes).
Show all your work in table form, like we did in class, showing how you start from each (
t
i
,
T
i
) to get
the next
t
i+1
, “
slope
i
”, and
T
i+1
.
(b)
Make a sketch of
T
i
(
t
i
) (
i.e.
draw and connect the 5 dots), and comment about what time you
think (if ever!) the temperature of the room will get down to 18
o
C.
dT
dt
=
−
T
18
+
43
45
−
t
300
T
(0)
=
30