next up previous
Next: Solutions Up: Hints Previous: Problem 1

Problem 2

Add the term

    b(x,d,t)'*du*v*dx

to the varational formulation in both Reaction1.m and Reaction2.m where b(x,d,t) is a function that specifies the convection. Also modify the function f(x,d,t) so that it only adds a drop every second:

function y = f(x, d, t)

if norm(x - [0.75; 0.5]) < 0.1 & abs(t - round(t)) < 0.1
  y = 20;
else
  y = 0;
end



Christoffer Cromvik 2004-04-25