|
Posted: 09/06/23
Due: 09/13/23, 11:59PM
Tracks 1 & 2: 1. Track 2: 2.
This homework introduces the fundamentals of additive approximation techniques in vector spaces. Read and understand the concepts in L04: Linear combinations in and , in particular to the example presented in the text and in the code attached to L04: Figure 2. Additional Julia coding constructs are also introduced. Remember to always execute the code snippets within the lecture notes to understand Julia programming techniques.
Approximate on the interval by the following series and study the convergence behavior of the solution. The pseudo-matrix arising in the approximation is shown in each case
Cosine series
Trigonometric series
Sine series
Triangle wave series
with
where is the fractional part of , e.g., .
Solution. Sample at points , , with spacing , and let denote the vector with components . Let denote the number of columns in the pseudo-matrix, i.e., the number of functions entering into the approximation of by the linear combination
(1) |
Table 1 defines , for each of the four cases, with . Case also conforms to this pattern since the presence of both and suggests the use of complex numbers
As expected for , are complex conjugates
hence only one need be computed and the expression
is obtained, indeed conforming to the same pattern as the other cases.
Problem solution consists of the following steps, leading to results in Fig. 1.
Define and the basis functions , to be investigated.
Define a function to compute the error in approximating by a series with terms with coefficients determined by sampling at points
with vectors obtained by sampling at . With the vector with components , is evaluated by the matrix-vector product
Test the error function by computing the coefficients for and using basis set . We should obtain zero error once enough terms are included.
Define a function to construct a convergence plot by evaluating on a of range values
Choose sufficient sample points to resolve the function , say , and construct convergence plots for the four cases
Study the analytical theory underlying the above approximations by considering the following.
State the convergence theorem for Fourier series and the Fourier coefficient formulas (see, e.g., [1]). Analytically compute the Fourier coefficients for . Use of a symbolic computation package (e.g., Maxima, Mathematica) eliminates tedious hand computation.
Solution. For with a finite set of isolated discontinuity points,
At points of discontinuity
The Fourier coefficients are computed by (MATH529: L15)
Compare the analytically computed Fourier coefficients with the numerical results obtained in Problem 1, a)-c). Assess the analytically predicted Fourier series convergence by comparison to the numerical results.
Solution. The relevant basis is case , and numerically computed coefficients are compared against analytical results in Fig. 2 .
Carry out series approximations as in Problem 1, a)-d) of
where is the Heaviside step function
Solution. The steps of Problem 1 are repeated for leading to Fig. 3
Define
Sample the function , and construct convergence plots for the four cases
Again, compare analytically evaluated Fourier coefficients with numerical results. How do the approximations of behave differently from those of ?
Solution. Plot and to gain insight into different behavior (Fig. 4). Note that is a discontinuous analogue of .
The Fourier coefficients are now
Convergence is obtained for both and . Convergence is faster for in the continuous Fourier basis, while for it is faster in the discontinuous triangle wave basis. Convergence is slower for the discontinuous function with coefficient decay by comparison to the coefficient decay for the continuous function .