next up previous
Next: Problem 2 Up: Hints Previous: Hints

Problem 1

  1. The time-stepping loop could look something like

      T = pi/2;
      k = T/10;
      time = 0;
    
      for n = 1:10
    
        time = time + k; 
    
      end
    
  2. Add U0 = zeros(size(p,2),1) and U0 = zeros(size(p,2),1) at the beginning of the program, and then add U0 = U1 in every step of the loop.
  3. The variational formulation that you need to put in the file Heat.m is

        u*v*dx + k*(du'*dv*dx + g(x,d,t)*u*v*ds)

    for the left-hand side and

        k*(f(x,d,t)*v*dx + (g(x,d,t)*gd(x,d,t) - gn(x,d,t))*v*ds) + w*v*dx

    for the right-hand side.



Christoffer Cromvik 2004-04-25