T = pi/2; k = T/10; time = 0; for n = 1:10 time = time + k; end
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.