Numerical Analysis Assignment Help
Numerical Analysis Assignment Help
Problem 2:
(a) Using the notebook for a 100 × 100 grid, compute the 6 smallest-
magnitude eigen values and eigen functions of A with λi,
Ui=eigs(Ai,nev=6,which=”SM”). The eigen values are given by λi. The
notebook also shows how to compute the exact eigen value from
the square of the root of the Bessel function. Compared with the
high-accuracy λ1 value, compute the error Δλ1 in the corresponding
finite-difference eigen value from the previous part. Also compute
Δλ1 for Nx = Ny = 200 and 400. How fast is the convergence rate
with Δx? Can you explain your results, in light of the fact that the
center-difference approximation we are using has an error that is
supposed to be ∼ Δx2? (Hint: think about how accurately the
boundary condition on ∂Ω is described in this finite-difference
approximation.)
that multiplies the gradient by c(r)= r +1. Draw a sketch of the grid
2
Problem 3:
(b) Suppose that f(x, t)= g(x)e−iωt, and we want to find a steady-
state solution u(x, t)=
−iωt
v(x)ethat is oscillating everywhere at the same frequency as the
input force. (This will be the solution after a long time if there is
any dissipation in the system to allow the initial transients to die
away.) Write an equation ˆ= A self-adjoint? Av g that v solves. Is
ˆ
Positive/negative definite/semidefinite?
(c) Solve for the Green’s function G(x, x') of this ˆ A, assuming that
ω= nπ/L for any integer n (i.e. assume ω is not an eigenfrequency
[why?]). [Write down the continuity conditions that G must satisfy
at x = x', solve for x= x', and then use the continuity conditions to
eliminate unknowns.]
(d) Form a finite-difference approximation A of your Aˆ. Compute
an approximate G(x, x ) in Matlab by A\ dk, where dk is the unit
'
vector of all 0’s except for one 1/Δx at index k = x /Δx, and compare
'
(by plotting both) to your analytical solution from the previous part
for a couple values of x and a couple of different frequencies ω
(one < π/L and one > π/L) with L =1.
(b) This is just (u, Aˆ−1u)/(u, u), which is a Rayleigh quotient for
the self-adjoint operator Aˆ−1, and hence (thanks to the min–max
theorem) it is bounded above by the largest eigen value of Aˆ−1,
which is 1/λ1 (the inverse of the smallest eigen value of Aˆ).
(Note that by positive- definiteness 0 < λ1 < λ2 < · · · .)
Problem 2:
Problem 3:
since f = ˜˜¯= �f˜. The key factors that allowed us to do this are (i)
linearity, and (ii) the 2 real-ness of the PDE (the PDE itself contains
no i factors or other complex coefficients).
(b) Plugging u(x, t)= v(x)e−iωt and f(x, t)= g(x)e−iωt into the PDE, we
obtain
(c) We know that ˆ')=0 for x x'. Also, just as in class and as in the
notes, the fact AG(x, x = that ˆ')= ') meas that G must be
continuous (otherwise there would be a δ'
for −∂2G/∂x2 to give δ(x − x'). We could also show this more
explicitly by integrating:
Similarly, for x > x', we also have a sine or cosine of ωx. To get G(L,
x') = 0, the simplest way to do this is to use a sine with a phase
shift: G(x, x') = β sin(ω[L x]) for some coefficient β.
Continuity now gives two equations in the two unknowns α and
β:
This simplifies a bit from the identity sinAcosB + cosB sinA = sin(A
+ B), and hence
The resulting plots are shown in figure 1, for ω =0.4π/L (left) and ω
=5.4π/L (right)
and x’ =0.5 and 0.75. As expected, for ω < π/L where it is positive-
definite, the Green’s function is positive and qualitatively similar to
that for ω =0, except that it is slightly curved. For larger ω, though,
it becomes oscillatory and much more interesting in shape. The
exact G and the finite-difference G match very well, as they should,
although the match becomes worse at higher frequencies—the
difference approximations become less and less accurate as the
function becomes more and more oscillatory relative to the grid
Δx, just as was the case
for the eigenfunctions as discussed in class.
[If you try to plug in an eigenfrequency (e.g. 4π/L) for ω, you may
notice that the exact G blows up but the finite-difference G is
finite. The reason for this is simple: the eigenvalues of the finite-
difference matrix DTD are not exactly (nπ/L)2, so the matrix is not
exactly singular, nor is it realistically possible to make it exactly
singular thanks to rounding errors. If you plug in something very
close to an eigenfrequency, then G becomes very close to an
eigenfunction multipled by a large amplitude. It is easy to see why
this is if you look at the expansion of the solution in terms of the
eigenfunctions.]
(e) For small ω, sin(ωy) ≈ ωy for any y, and hence