Hi,
Let's say your expression for the boundary condition is $c_1 x+ c_2 y$. Where $c_1, c_2$ are your parameters.
You code might look something like this
#initial parameter values
c1 = 1.0; c2 = 1.0;
#Apply parameters to your expression
f = Expression("{}*x[0] + {}*x[1]".format(c1,c2))
bc = DirichletBC(V, f, u0_boundary)
for i in range(max_iterations):
#Solve problem with current bc
<solver>
#update boundary condition
c1 = newValue; c2 = newValue;
f = Expression("{}*x[0] + {}*x[1]".format(c1,c2))
bc = DirichletBC(V, f, u0_boundary)