Math 104C UC Santa Barbara Local Truncation Error Mathematics Problems Please answer all of the problems on an assignment just using a jupyter notebook. Ma

Math 104C UC Santa Barbara Local Truncation Error Mathematics Problems Please answer all of the problems on an assignment just using a jupyter notebook. Math 104C Homework #2

Instructor: Xu Yang
General Instructions: Please write your homework papers neatly. You need to turn in both
your codes and descriptions on the appropriate runs you made by following Grader’s instructions.
Write your own code, individually. Do not copy codes!
1. Consider the second-order Runge-Kutta method:
U n+1 = U n +
where
(
k
(F1 + F2 )
2
F1 = f (tn , U n )
F2 = f (tn + k, U n + kF1 )
Show the local truncation error of the method is O(k 2 ).
2. Consider the initial value problem
(
u0 (t) = 1 + ut , 1 ≤ t ≤ 2,
u(1) = 2
(a) Solve the exact solution to this initial value problem.
(b) Write a code for the classical Fourth-order Runge-Kutta method and use it to solve the
problem using k = 0.2, 0.1, 0.05, 0.025. Your output should be a table like the following
k
0.2
0.1
0.05
0.025
ek
where ek = max |u(tk ) − U k | and N = k1 .
0≤k≤N
(c) Repeat the same process as in (b) using the second-order Runge-Kutta method given in
Problem 1.

All course materials (class lectures and discussions, handouts, homework assignments, examinations, web materials) and the intellectual content of the course itself are protected by United States Federal Copyright Law, the
California Civil Code. The UC Policy 102.23 expressly prohibits students (and all other persons) from recording
lectures or discussions and from distributing or selling lectures notes and all other course materials without the prior
written permission of the instructor.
1
Use the short-hand notation fn = f (tn , U n ) for Problems 3–5.
3. Consider the following two-step method:
3
1
5
3
U n+2 − U n+1 + U n = k( fn+1 − fn )
2
2
4
4
Show the local truncation error is of O(k 2 ).
4. Consider another two-step method:
1
3
U n+2 − 3U n+1 + 2U n = k( fn+1 − fn )
2
2
Show the local truncation error is of O(k 2 ).
5. Consider the initial value problem
(
u0 (t) = u(t),
u(0) = 1.
t ∈ [0, 1]
The exact solution is u(t) = et .
(a). Write a code for solving the model problem using the method in Problem 3 with U 0 = 1
and U 1 = ek . Here k = 0.01 is the time step size. Graph the numerical solution and
exact solution in the same plot.
(b). Repeat the same procedure using the method in Problem 4.
(c). Compare the graph obtained in part (a) and (b). Show the difference that observed.
Can you explain it using zero-stability.
6. Consider the following two-step method:
U n+2 = U n + 2kfn+1 .
Show it is zero-stable.
2

Purchase answer to see full
attachment

Don't use plagiarized sources. Get Your Custom Essay on
Math 104C UC Santa Barbara Local Truncation Error Mathematics Problems Please answer all of the problems on an assignment just using a jupyter notebook. Ma
Get an essay WRITTEN FOR YOU, Plagiarism free, and by an EXPERT!
Order Essay
superadmin

Recent Posts

LDR 3302-21.01.01-1A24-S1, Organizational Theory and Behavior

LDR 3302-21.01.01-1A24-S1, Organizational Theory and Behavior Unit III Essay Top of Form Bottom of Form…

3 years ago

Psychology Question | My Essay Helpers

Chapter 9 What are teratogens? Give 5 examples. Define each of these stages: Germinal, embryonic,…

3 years ago

Financial Market Analysis | My Essay Helpers

You are a Financial Analyst that has been appointed to lead a team in the…

3 years ago

Decision theory | My Essay Helpers

This week’s discussion will focus on management decision-making and control in two companies, American corporation…

3 years ago

Literature Question | My Essay Helpers

Mary Rowlandson felt that the man who eventually came to own her, Quinnapin, was “the…

3 years ago