AMSC 661 / CMSC 661 Homework 4 FAQ

Known typos:

  • Part 1: Several "f"s in Problem 2 should be "g"s.
  • Part 1: It is hard to distinguish the lower case "omega" from the "w", so I changed the "w" to "z".
  • Part 2: Error conditions also occur when those parameters equal zero.
  • Part 2: Notice that k is an index, not a time step.
  • Part 2: Someone found the indexing confusing, so I've changed all j's and k's to l's and m's, but the meaning is unchanged.
  • Part 2: tmax should be an integer. You may assume that 1/4 is a mesh point for the piano problem.
  • Part 2: the guitar is plucked at 1/2, not 1/4.
  • Part 2: Don't worry about putting the plot title in the movie.
  • Question: Problem 2: Are we assuming m=n?

    Answer: Yes.

    Question: Problem 2: Are we assuming that n is a power of 2?

    Answer: No.

    Question: In Problem 2, how is the data normalized?

    Answer: The entries in the n x n array g are function values g(x_i,y_j), so make sure that you normalize the finite difference matrix, by assuming that h = 1/(n+1).

    Question: In Problem 3, should delta_t be tmax/nt or 1/nt?

    Answer: 1/nt, as written. I want it to be the number of time steps per unit time.

    Question: Can you give us some problems to use to test our code?

    Answer: I want you to do this yourself. For the first part, you can use A and a known solution to generate a right-hand side and then see if your function returns your solution. For the second, you can choose a function u, generate the data, send it to your function, and see if you get an approximation to u back again.

    Question: I have read the documentation for DST in MATLAB and there is no mention of ordering in the computation. Can you provide some insight on matching the shifted eigenvalues with the DSTed vectors, i.e., on reordering lambda?

    Answer: If "help" doesn't give the information you need, go to mathworks.com and search for "dst".

    Question: In Problem 3, What are the specifications for the function f?

    Answer: The function takes two inputs, x and t, and x can be a vector. It returns a vector of values of f(x,t) of the same dimension as x.

    Question:

    Answer: You may assume that tmax is an integer. Either flag an error or do something reasonable if tmax is not an integer.

    Question: looks like from your clarifications on the HW4 part2 assignment sheet that, we are not to include time = tmax in our matrix u. Is that correct.

    Answer: No, include tmax values in u.

    Question: Is there some mistake to get the starting u for prob 3? How can we get u^-1 when we want to compute u^1? It seems like 1 equation and 2 unknowns??

    Answer: Solve the centered difference equation for u^{-1} values, and then substitute that expression into your difference equation for the wave equation to get an expression for u^1 values in terms of values at u^0.

    Question:

    Answer: