← Back to team overview

dolfin team mailing list archive

Newton solve with relaxation

 

Hi, I would like to solve an nonlinear algebraic system of equations and
thought
I could use ufl/dolfin to do it. It appears that relaxation is needed, but
I don't
manage to set the relaxation parameter properly.
Here is my attempt:

from dolfin import *

mesh = UnitSquare(1,1)
V = FunctionSpace(mesh, "CG", 1)
W = MixedFunctionSpace([V,V,V,V])

XX = Function(W)
(Omega2, Alpha, A, B) = split(XX)

# Define variational problem
(k,l,m,n) = TestFunctions(W)
xx = TrialFunction(W)

L = 
(-Omega2*(0.019800000000000001626+A)+B*Alpha-8.074897999999999243)*k*dx +
\
(-(-0.019800000000000001626+A)*Omega2+B*Alpha-1.5951630000000001086)*l*dx + \
(Alpha*(0.002340000000000000066+A)+Omega2*(-0.012749999999999999181+B) +
8.568149999999999267)*m*dx + \
(Omega2*(0.025149999999999998745+B)+(-4.4000000000000001566E-4+A)*Alpha +
1.7244260000000000144)*n*dx

J = derivative(L,XX, xx)

problem = VariationalProblem(J, L, nonlinear=True)

newton_solver = NewtonSolver()
newton_solver.parameters["relaxation_parameter"] = 0.1
print newton_solver.parameters["relaxation_parameter"]
x = Function(W)
newton_solver.solve(problem, x.vector())

Any idea why the relaxation parameter does not have effect ?

Kent