17 class Arc_problem :
public Residual<double>
27 f[ 0 ] = 1.0 - std::pow(
z[ 0 ], 2 ) - std::pow(
p, 2 );
28 f[ 1 ] =
z[ 1 ] - std::sin(
z[ 0 ] );
40 cout <<
"=== ARC: cont of x^2 + p^2 = 1.0, y = sin(x) ========\n";
55 newton.
init_arc( x, &residual.
p, 0.05, 0.1 );
59 for (
int i = 0; i < 400; ++i )
67 catch (
const std::runtime_error &error )
69 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
75 cout <<
" Bifurcation detected near x = " << x[ 0 ]
76 <<
" p = " << residual.
p <<
"\n\n";
78 if ( abs( pow( x[ 0 ], 2 )
79 + pow( residual.
p, 2 ) - 1.0 ) > tol )
82 cout <<
" Error = " << pow( x[ 0 ], 2 )
83 + pow( residual.
p, 2 ) - 1.0 <<
"\n";
89 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
94 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...