ReFRACtor
meyer_nlls_problem.cc
Go to the documentation of this file.
1 #include "meyer_nlls_problem.h"
2 
3 
4 using namespace FullPhysics;
5 using namespace blitz;
6 
7 // See base class for description.
8 Array<double, 1> MeyerNLLSProblem::residual()
9 {
10  if(R.size() <= 0) {
11  assert_parameter_set_correctly();
12  increment_num_cost_evaluations();
13  R.resize(residual_size());
14 
15  Array<double, 1> y(residual_size());
16  y = 34780.0, 28610.0, 23650.0, 19630.0, 16370.0, 13720.0, 11540.0, 9744.0, 8261.0, 7030.0, 6005.0, 5147.0, 4427.0, 3820.0, 3307.0, 2872.0;
17  for(int i=0; i<residual_size(); i++)
18  R(i) = X(0) * exp( X(1)/((45.0 + 5.0*(i+1))+X(2)) ) - y(i);
19  }
20  return R.copy();
21 }
22 
23 // See base class for description.
24 Array<double, 2> MeyerNLLSProblem::jacobian()
25 {
26  if(J.size() <= 0) {
27  assert_parameter_set_correctly();
28  increment_num_der1_evaluations();
29  J.resize(residual_size(), parameter_size());
30 
31  for(int i=0; i<residual_size(); i++) {
32  double t = (45.0 + 5.0*(i+1));
33  double expf = exp( X(1)/(t+X(2)) );
34  J(i,0) = expf; J(i,1) = X(0)/(t+X(2))*expf; J(i,2) = -X(0)*X(1)/((t+X(2))*(t+X(2)))*expf;
35  }
36  }
37  return J.copy();
38 }
virtual blitz::Array< double, 2 > jacobian()
The Jacobian matrix 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
virtual blitz::Array< double, 1 > residual()
The residual vector function.

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