ReFRACtor
helical_valley_nlls_problem.cc
Go to the documentation of this file.
2 
3 
4 using namespace FullPhysics;
5 using namespace blitz;
6 
7 // See base class for description.
9 {
10  if(R.size() <= 0) {
11  assert_parameter_set_correctly();
12  increment_num_cost_evaluations();
13  R.resize(residual_size());
14 
15  // From J. J. More's paper
16  // "Testing Unconstrained Optimization Software"
17  // it is not obvious which definition of arctangent is used.
18  // One is defined with a range of (-Pi/2, Pi/2), and the other
19  // is defined with a range of (-Pi, Pi). Here I used the first
20  // definition because by convention that is how arctangent is
21  // defined in mathematics. Therefore, I used atan and not atan2.
22  // By choosing atan there is the possibility of division by zero,
23  // the possibility of a division by zero exist in the Jacobian
24  // regardless of whether we use atan or atan2.
25  //
26  double theta = atan(X(1)/X(0))/(2.0*M_PI) + ((X(0) < 0.0)?0.5:0.0);
27  R = 10.0*(X(2)-10.0*theta), 10*(sqrt(X(0)*X(0)+X(1)*X(1))-1.0), X(2);
28  }
29  return R.copy();
30 }
31 
32 // See base class for description.
34 {
35  if(J.size() <= 0) {
36  assert_parameter_set_correctly();
37  increment_num_der1_evaluations();
38  J.resize(residual_size(), parameter_size());
39 
40  double tmp = X(0)*X(0) + X(1)*X(1);
41  J = 100.0*X(1)/(2.0*M_PI*tmp), -100.0*X(0)/(2.0*M_PI*tmp), 10.0,
42  10.0*X(0)/sqrt(tmp), 10.0*X(1)/sqrt(tmp), 0.0,
43  0.0, 0.0, 1.0;
44  }
45  return J.copy();
46 }
virtual blitz::Array< double, 2 > jacobian()
The Jacobian matrix function.
virtual blitz::Array< double, 1 > residual()
The residual vector function.
const Unit J("J", N *m)
Apply value function to a blitz array.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:08