|
|
|
@@ -21,15 +21,17 @@ public: |
|
|
|
// Funktionsauswertung |
|
|
|
void F (const hdnum::Vector<N>& x, hdnum::Vector<N>& result) const |
|
|
|
{ |
|
|
|
result[0] = pow(x[0], 2) + pow(x[1], 2) - 4; |
|
|
|
result[1] = pow(x[0], 2)/9 + pow(x[1], 2) - 1; |
|
|
|
result[0] = x[0] * x[1] + 2*x[0] - x[1] - 2; |
|
|
|
result[1] = x[0] * x[1] - x[0] + x[1] -3; |
|
|
|
} |
|
|
|
|
|
|
|
// Jacobimatrix |
|
|
|
void F_x (const hdnum::Vector<N>& x, hdnum::DenseMatrix<N>& result) const |
|
|
|
{ |
|
|
|
result[0][0] = 2*x[0]; result[0][1] = 2*x[1]; |
|
|
|
result[1][0] = 2*x[0]/9; result[1][1] = 2*x[1]; |
|
|
|
result[0][0] = x[1] + 2; |
|
|
|
result[0][1] = x[0] - 1; |
|
|
|
result[1][0] = x[1] - 1; |
|
|
|
result[1][1] = x[0] + 1; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
@@ -48,13 +50,13 @@ int main () |
|
|
|
// Newton |
|
|
|
hdnum::Newton newton; |
|
|
|
newton.set_maxit(20); |
|
|
|
newton.set_verbosity(2); |
|
|
|
newton.set_verbosity(10); |
|
|
|
newton.set_reduction(1e-10); |
|
|
|
newton.set_abslimit(1e-20); |
|
|
|
newton.set_linesearchsteps(3); |
|
|
|
newton.set_linesearchsteps(2); |
|
|
|
|
|
|
|
// 1. Quadrant |
|
|
|
u[0] = 2.0; u[1] = 1.0; |
|
|
|
u[0] = 0.0; u[1] = 1.0; |
|
|
|
newton.solve(problem,u); |
|
|
|
std::cout << "Nullstelle im 1. Quadrant: " << std::setprecision(15) << u << std::endl; |
|
|
|
problem.F(u, result); |
|
|
|
|