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
Why Choose Us
Top quality papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional academic writers
We have hired a team of professional writers experienced in academic and business writing. Most of them are native speakers and PhD holders able to take care of any assignment you need help with.
Free revisions
If you feel that we missed something, send the order for a free revision. You will have 10 days to send the order for revision after you receive the final paper. You can either do it on your own after signing in to your personal account or by contacting our support.
On-time delivery
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & confidential
We use several checkers to make sure that all papers you receive are plagiarism-free. Our editors carefully go through all in-text citations. We also promise full confidentiality in all our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
You are welcome to choose your academic level and the type of your paper. Our academic experts will gladly help you with essays, case studies, research papers and other assignments.
Admissions
Admission help & business writing
You can be positive that we will be here 24/7 to help you get accepted to the Master’s program at the TOP-universities or help you get a well-paid position.
Reviews
Editing your paper
Our academic writers and editors will help you submit a well-structured and organized paper just on time. We will ensure that your final paper is of the highest quality and absolutely free of mistakes.
Reviews
Revising your paper
Our academic writers and editors will help you with unlimited number of revisions in case you need any customization of your academic papers