28 f[ 0 ] =
z[ 0 ] *
z[ 0 ] +
p *
p - 2.0;
43 cout <<
"=== ARC: continuation of x^2 + p^2 = 2.0 ============\n";
48 residual_problem.
p = 1.0;
50 const double tol = 1.e-10;
58 newton.
init_arc( state, &residual_problem.
p, 0.001, 0.1 );
61 for (
int i = 0; i < 100; ++i )
69 catch (
const std::runtime_error &error )
71 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
77 cout <<
" Bifurcation detected near x = " << state[ 0 ] <<
" p = " << residual_problem.
p <<
"\n\n";
79 if ( abs( pow( state[ 0 ], 2 ) + pow( residual_problem.
p, 2 ) - 2.0 ) > tol )
82 cout <<
" Error = " << pow( state[ 0 ], 2 ) + pow( residual_problem.
p, 2 ) - 2.0 <<
"\n";
88 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
93 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
A shorter bundled include file for Newton iteration problems.
void init_arc(DenseVector< _Type > x, _Type *p, const double &length, const double &max_length)
Initialise the class ready for arc-length continuation.
An DenseVector class – a dense vector object.
Define the residual for arc-length continuation of a circle.
void residual_fn(const DenseVector< double > &z, DenseVector< double > &f) const
A blank virtual residual function method.
A vector NEWTON iteration class.
void set_monitor_det(bool flag)
If set then the system will monitor the sign of determinant of the Jacobian matrix and cause an Excep...
void arclength_solve(DenseVector< _Type > &x)
Arc-length solve the system.
A base class to be inherited by objects that define residuals.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...