rickeyzack_285936_53810636_HW10 2850
pdf
keyboard_arrow_up
School
Arizona State University *
*We aren’t endorsed by this school
Course
MISC
Subject
Mathematics
Date
Nov 24, 2024
Type
Pages
13
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
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
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
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
From 9.4
i
o
o
3
Goi'd
1.5
Is
21
9
10
32.2
33
32.8
31.8 29.927.1
23.4
18.8
13.4
31
a
Use the
3
pt
centered
difference
rule
to
calculate
EIGIL
tiofootgrfityPI.PK
weE.tt
1.5
seconds
Three
point
central
difference
k
2
f
ti
ft
i
2ft
tin
E
1.5
s
i
6
h
big
3
30
0.3
f
to
f
ts
2ft
f
E
29.9
2,13317
23.4
10
m
s
f
yo
10m15
vs
9.81
m
s
expected
Percent
error
10298,81
100
1.936
off
b
Use
the
4
pt
backward
difference
rule
to
calculate
the
acceleration
day Ide
of
the
pumpkin
at
E3
seconds
fifteen
ft
f
ti
f
ti
3
4ft
p
5f
ti
1
2ft
backward
t
3
seconds
5
11
day
f
ti
f
to
4f
ty
5f
to
2f
tin
18.8 4 13.4
5
7
1
2107
0.37
dffef
ti
7.77
miss
c
If
you
obtained
and
used
measurements
every
oil
seconds
instead
of
every
0.3
seconds
aventify
how
much
you'd
expect
the
error
in
your
acceleration
calculation
to
change
ht
ox
0.1
8
8
t
th
f
or
order
for
3
pt
centered
and
4
pt
backward
difference
Cox
Therefore
the
go
by
tf
I
write
fl
5
fix
5
Giv
f
xi
g
Ifi
s
Gfi
z
t
12ft
i
10ft
t
3
fit
1
a
Calculate
the
discretization
error
order
write
error
06
7
White
th
II
fifireseries
expansions
for
each
term
to
fi
3
f
xi
Gox
t
xi
9g
F ki
Fox
f
xi
Egox
f
Vi
35g
trail
fi
z
f
xi
Tox
f
xi
t
4g
f
xi
foxf
xi
q
ox
f
Vi
if
oxtuxi
fi
i
fail
Cox
f
Gift
of
f
xi
f
off
ki
tyg
oxf Vai
Io
oxtail
fit
f
x
x
f
xi
t
of
f
xi
tf
ox
f
ki
tyg
oxf Vai
go
of
Vail
ti
z
Gfi
z
t
12ft
y
10ft
t
3
fit
1
1
6
12
3
Coefficient
calculation
oxt
xi
1127
66
227
121
1
3
i
0
ox't
xi
1
92
6
4
27
121112
3
1
2
0
off
xi
1471
6681
12
461
311161
2
ox't
xi
I
8
6
2
37
17
1124
3
1
24
0
ox't
xi
I
81
61757
121
4120
3
1
170
0.5
Combined
3
ti
g
G
fi
z
t
12
fi
i
lo fi
t
3ti
ti
20
3
t
ki
tox't
xi
t
ki
y
It
error
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
order
of
error
2
because
we
ha
e
toxtrixil
left
065
b
Calculate
the
precision
of
the
scheme
precision
is
when
the
error
d
foxfYxi
O
precision
ty
I
Derive
forward
difference
scheme
using
fi
titi
fitz
it
and
tity
to
order
ox
error
order
Cleans
T
unknowns
fixt
I
is
fitz
I
213
C
4
15
of
error
with
ox
0
3
0
8
Ex
ox
so
Want
Ux
term
so
ox
xi
I
Matrix
to
calculate
Eff
39
E
It
1
4
3
2
I
Ito
5,9
cell
to
Full
4
pt
forwards
method
with
ox
error
0
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
For
each
of
the
ODE's
A
get
r
dat
Fyi
9127 0
a
107
1
i
order
2nd
rider
highest
order
of
ODE
ii
BUP
or
IVP
BUP
Boundary
rendition
at
iiit
ODE
in
standard form
Z
and
x
o
get
off
ftp
E
rit
er
r
FET
II
er
ray
B
y
I
sin
At
x1
47
1
it
orderIst
order
in
BUP
or
IVP
I.VE
gntyahgglYe
given
us
an
iii
ODE
in
standard form
YE
sink
Left
y
E
sink
Left
F
Y
4
C
It
df
d
x
4,4
x
3
3
x
137
2
x
37
1
i
order
Jd
order
ODE
ii
BUP
or
IVP
IVP
t
3
is
given
us
an
initial
value
or
the
iiit
ODE
in
standard
matte
Additionally
devi tires
are
present
It
def
d
tx
If
It
dÉE
II
x
4dg
I
I
d
II
x
44
I
dye
It
d
tx
4ft
1
x
Etz
x
d
Ee
1
x
EE
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
I
Is
475
too
To
30
at
t
D
h
10
Runge
Kutta
4th
order
y
it
it
yit
f
kitzka
2k
t
ka
K
he
f
xinyi
k
h
xith
it
k
hot
kith
it
Ky
h
faith
it
ks
to
0
To
30
T
To
the
kitzka
2kg
t
ka