MA2552 Introduction to Computing (DLI) 2023/24
Computational Project
代做代寫Aims and Intended Learning Outcomes
代做代寫The aims of the Project are to describe methods for solving given computational problems, develop and test Matlab code implementing the methods, and demonstrate application
代做代寫of the code to solving a specific computational problem. In this Project, you be will be required to demonstrate
代做代寫• ability to investigate a topic through guided independent research, using resources
代做代寫available on the internet and/or in the library;
代做代寫• understanding of the researched material;
代做代寫• implementation of the described methods in Matlab;
代做代寫• use of the implemented methods on test examples;
代做代寫• ability to present the studied topic and your computations in a written Project Report.
代做代寫Plagiarism and Declaration
代做代寫• This report should be your independent work. You should not seek help from other
代做代寫students or provide such help to other students. All sources you used in preparing your
代做代寫report should be listed in the References section at the end of your report and referred
代做代寫to as necessary throughout the report.
代做代寫• Your Project Report must contain the following Declaration (after the title page):
代做代寫DECLARATION
代做代寫All sentences or passages quoted in this Project Report from other people’s work have
代做代寫been specifically acknowledged by clear and specific cross referencing to author, work and
代做代寫page(s), or website link. I understand that failure to do so amounts to plagiarism and
代做代寫will be considered grounds for failure in this module and the degree as a whole.
代做代寫Name:
代做代寫Signed: (name, if submitted electronically)
代做代寫Date:
代做代寫Project Report
代做代寫The report should be about 6-8 pages long, written in Word or Latex. Equations should
代做代寫be properly formatted and cross-referenced, if necessary. All the code should be included in
代做代寫the report. Copy and paste from MATLAB Editor or Command Window and choose ‘Courier
代做代寫New’ or another fixed-width font. The Report should be submitted via Blackboard in a single
代做代寫file (Word document or Adobe PDF) and contain answers to the following questions:
代做代寫1
代做代寫MA2552 Introduction to Computing (DLI) 2023/24
代做代寫Part 0: Context
代做代寫Let f(x) be a periodic function. The goal of this project is to implement a numerical method
代做代寫for solving the following family of ordinary differential equations (O.D.E):
代做代寫an
代做代寫d
代做代寫nu(x)
代做代寫dxn
代做代寫+ an−1
代做代寫d
代做代寫n−1u(x)
代做代寫dxn−1
代做代寫+ . . . + a0u(x) = f(x), (1)
代做代寫where ak, k = 0, · · · , n, are real-valued constants. The differential equation is complemented
代做代寫with periodic boundary conditions:
代做代寫d
代做代寫ku(−π)
代做代寫dxk
代做代寫=
代做代寫d
代做代寫ku(π)
代做代寫dxk
代做代寫for k = 0, · · · , n − 1.
代做代寫We aim to solve this problem using a trigonometric function expansion.
代做代寫Part 1: Basis of trigonometric functions
代做代寫Let u(x) be a periodic function with period 2π. There exist coefficients α0, α1, α2, . . ., and
代做代寫β1, β2, . . . such that
代做代寫u(x) = X∞
代做代寫k=0
代做代寫αk cos(kx) +X∞
代做代寫1
代做代寫βk sin(kx).
代做代寫The coefficients αk and βk can be found using the following orthogonality properties:
代做代寫Z π
代做代寫−π
代做代寫cos(kx) sin(nx) dx = 0, for any k, n
代做代寫Z π
代做代寫−π
代做代寫cos(kx) cos(nx) dx =
代做代寫
代做代寫
代做代寫
代做代寫0 if k ̸= n
代做代寫π if k = n ̸= 0
代做代寫2π if k = n = 0.
代做代寫Z π
代做代寫−π
代做代寫sin(kx) sin(nx) dx =
代做代寫(
代做代寫0 if k ̸= n
代做代寫π if k = n ̸= 0.
代做代寫1. Implement a function that takes as an input two function handles f and g, and an
代做代寫array x, and outputs the integral
代做代寫1
代做代寫π
代做代寫Z π
代做代寫−π
代做代寫f(x)g(x) dx,
代做代寫using your own implementation of the Simpson’s rule scheme. Corroborate numerically
代做代寫the orthogonality properties above for different values of k and n.
代做代寫2. Show that
代做代寫αk =
代做代寫(
代做代寫1
代做代寫π
代做代寫R π
代做代寫−π
代做代寫u(x) cos(kx) dx if k ̸= 0
代做代寫1
代做代寫2π
代做代寫R π
代做代寫−π
代做代寫u(x) dx if k = 0
代做代寫βk =
代做代寫1
代做代寫π
代做代寫Z π
代做代寫π
代做代寫u(x) sin(kx) dx.
代做代寫2
代做代寫MA2552 Introduction to Computing (DLI) 2023/24
代做代寫3. Using question 1 and 2, write a function that given a function handle u and an integer
代做代寫m, outputs the array [α0, α1 . . . , αm, β1, . . . , βm].
代做代寫4. Write a function that given an array [α0, α1 . . . , αm, β1, . . . , βm], outputs (in the form
代做代寫of an array) the truncated series
代做代寫um(x) := Xm
代做代寫k=0
代做代寫αk cos(kx) +Xm
代做代寫k=1
代做代寫βk sin(kx), (2)
代做代寫where x is a linspace array on the interval [−π, π].
代做代寫5. Using the function from question 3, compute the truncated series um(x) of the following
代做代寫functions:
代做代寫• u(x) = sin3
代做代寫(x)
代做代寫• u(x) = |x|
代做代寫• u(x) = (
代做代寫x + π, for x ∈ [−π, 0]
代做代寫x − π, for x ∈ [0, π]
代做代寫,
代做代寫and using question 4, plot u(x) and um(x) for different values of m.
代做代寫6. Carry out a study of the error between u(x) and um(x) for ∥u(x)−um(x)∥p with p = 2
代做代寫and then with p = ∞. What do you observe?
代做代寫Part 2: Solving the O.D.E
代做代寫Any given periodic function u(x) can be well approximated by its truncate series expansion (2) if m is large enough. Thus, to solve the ordinary differential equation (1)
代做代寫one can approximate u(x) by um(x):
代做代寫u(x) ≈
代做代寫Xm
代做代寫k=0
代做代寫αk cos(kx) +Xm
代做代寫k=1
代做代寫βk sin(kx),
代做代寫Since um(x) is completely determined by its coefficients [α0, α1 . . . , αm, β1, . . . , βm],
代做代寫to solve (1) numerically, one could build a system of equations for determining these
代做代寫coefficients.
代做代寫7. Explain why under the above approximation, the boundary conditions of (1) are automatically satisfied.
代做代寫8. We have that
代做代寫dum(x)
代做代寫dx =
代做代寫Xm
代做代寫k=0
代做代寫γk cos(kx) +Xm
代做代寫k=1
代做代寫ηk sin(kx)
代做代寫Write a function that takes as input the integer m, and outputs a square matrix D that
代做代寫maps the coefficients [α0, . . . , αm, β1, . . . , βm] to the coefficients [γ0, . . . , γm, η1, . . . , ηm].
代做代寫3
代做代寫MA2552 Introduction to Computing (DLI) 2023/24
代做代寫9. Write a function that given a function handler f and the constants ak, solves the
代做代寫O.D.E. (1). Note that some systems might have an infinite number of solutions. In
代做代寫that case your function should be able identify such cases.
代做代寫10. u(x) = cos(sin(x)) is the exact solution for f(x) = sin(x) sin(sin(x))−cos(sin(x)) (cos2
代做代寫(x) + 1),
代做代寫with a2 = 1, a0 = −1 and ak = 0 otherwise. Plot the p = 2 error between your numerical solution and u(x) for m = 1, 2, . . .. Use a log-scale for the y-axis. At what rate
代做代寫does your numerical solution converge to the exact solution?
代做代寫11. Show your numerical solution for different f(x) and different ak of your choice.
代做代寫請加QQ:99515681 或郵箱:99515681@qq.com WX:codehelp
代做代寫代做代寫