Ipopt  3.12.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MittelmannDistCntrlNeumB.hpp
Go to the documentation of this file.
1 // Copyright (C) 2005, 2006 International Business Machines and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // $Id: MittelmannDistCntrlNeumB.hpp 2005 2011-06-06 12:55:16Z stefan $
6 //
7 // Authors: Andreas Waechter IBM 2005-10-18
8 // based on MyNLP.hpp
9 
10 #ifndef __MITTELMANNDISTRCNTRLNEUMB_HPP__
11 #define __MITTELMANNDISTRCNTRLNEUMB_HPP__
12 
13 #include "IpTNLP.hpp"
14 #include "RegisteredTNLP.hpp"
15 
16 #ifdef HAVE_CONFIG_H
17 #include "config.h"
18 #else
19 #include "configall_system.h"
20 #endif
21 
22 #ifdef HAVE_CMATH
23 # include <cmath>
24 #else
25 # ifdef HAVE_MATH_H
26 # include <math.h>
27 # else
28 # error "don't have header file for math"
29 # endif
30 #endif
31 
32 #ifdef HAVE_CSTDIO
33 # include <cstdio>
34 #else
35 # ifdef HAVE_STDIO_H
36 # include <stdio.h>
37 # else
38 # error "don't have header file for stdio"
39 # endif
40 #endif
41 
42 using namespace Ipopt;
43 
51 {
52 public:
56 
59 
63  virtual bool get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
64  Index& nnz_h_lag, IndexStyleEnum& index_style);
65 
67  virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
68  Index m, Number* g_l, Number* g_u);
69 
71  virtual bool get_starting_point(Index n, bool init_x, Number* x,
72  bool init_z, Number* z_L, Number* z_U,
73  Index m, bool init_lambda,
74  Number* lambda);
75 
77  virtual bool eval_f(Index n, const Number* x, bool new_x, Number& obj_value);
78 
80  virtual bool eval_grad_f(Index n, const Number* x, bool new_x, Number* grad_f);
81 
83  virtual bool eval_g(Index n, const Number* x, bool new_x, Index m, Number* g);
84 
89  virtual bool eval_jac_g(Index n, const Number* x, bool new_x,
90  Index m, Index nele_jac, Index* iRow, Index *jCol,
91  Number* values);
92 
97  virtual bool eval_h(Index n, const Number* x, bool new_x,
98  Number obj_factor, Index m, const Number* lambda,
99  bool new_lambda, Index nele_hess, Index* iRow,
100  Index* jCol, Number* values);
101 
103 
105  virtual bool get_scaling_parameters(Number& obj_scaling,
106  bool& use_x_scaling, Index n,
107  Number* x_scaling,
108  bool& use_g_scaling, Index m,
109  Number* g_scaling);
110 
115  virtual void finalize_solution(SolverReturn status,
116  Index n, const Number* x, const Number* z_L, const Number* z_U,
117  Index m, const Number* g, const Number* lambda,
118  Number obj_value,
119  const IpoptData* ip_data,
122 
123 protected:
127  void SetBaseParameters(Index N, Number lb_y,
128  Number ub_y, Number lb_u, Number ub_u,
129  Number b_0j, Number b_1j, Number b_i0, Number b_i1,
130  Number u_init);
131 
135  virtual Number y_d_cont(Number x1, Number x2) const =0;
137  virtual Number fint_cont(Number x1, Number x2, Number y, Number u) const =0;
139  virtual Number fint_cont_dy(Number x1, Number x2, Number y, Number u) const =0;
141  virtual Number fint_cont_du(Number x1, Number x2, Number y, Number u) const =0;
143  virtual Number fint_cont_dydy(Number x1, Number x2, Number y, Number u) const =0;
146  virtual bool fint_cont_dydy_alwayszero() const =0;
148  virtual Number fint_cont_dudu(Number x1, Number x2, Number y, Number u) const =0;
151  virtual bool fint_cont_dudu_alwayszero() const =0;
153  virtual Number fint_cont_dydu(Number x1, Number x2, Number y, Number u) const =0;
156  virtual bool fint_cont_dydu_alwayszero() const =0;
158  virtual Number d_cont(Number x1, Number x2, Number y, Number u) const =0;
160  virtual Number d_cont_dy(Number x1, Number x2, Number y, Number u) const =0;
162  virtual Number d_cont_du(Number x1, Number x2, Number y, Number u) const =0;
164  virtual Number d_cont_dydy(Number x1, Number x2, Number y, Number u) const =0;
167  virtual bool d_cont_dydy_alwayszero() const =0;
169  virtual Number d_cont_dudu(Number x1, Number x2, Number y, Number u) const =0;
172  virtual bool d_cont_dudu_alwayszero() const =0;
174  virtual Number d_cont_dydu(Number x1, Number x2, Number y, Number u) const =0;
177  virtual bool d_cont_dydu_alwayszero() const =0;
179 
180 private:
195 
229 
234  inline Index y_index(Index i, Index j) const
235  {
236  return j + (N_+2)*i;
237  }
240  inline Index u_index(Index i, Index j) const
241  {
242  return (N_+2)*(N_+2) + (j-1) + (N_)*(i-1);
243  }
246  inline Index pde_index(Index i, Index j) const
247  {
248  return (j-1) + N_*(i-1);
249  }
251  inline Number x1_grid(Index i) const
252  {
253  return h_*(Number)i;
254  }
256  inline Number x2_grid(Index i) const
257  {
258  return h_*(Number)i;
259  }
261 };
262 
265 {
266 public:
268  :
269  pi_(4.*atan(1.)),
270  alpha_(0.001)
271  {}
272 
274  {}
275 
276  virtual bool InitializeProblem(Index N)
277  {
278  if (N<1) {
279  printf("N has to be at least 1.");
280  return false;
281  }
282  Number lb_y = -1e20;
283  Number ub_y = 0.371;
284  Number lb_u = -8.;
285  Number ub_u = 9.;
286  Number b_0j = 1.;
287  Number b_1j = 1.;
288  Number b_i0 = 1.;
289  Number b_i1 = 1.;
290  Number u_init = (ub_u + lb_u)/2.;
291 
292  SetBaseParameters(N, lb_y, ub_y, lb_u, ub_u, b_0j, b_1j, b_i0, b_i1, u_init);
293  return true;
294  }
295 protected:
297  virtual Number y_d_cont(Number x1, Number x2) const
298  {
299  return sin(2.*pi_*x1)*sin(2.*pi_*x2);
300  }
302  virtual Number fint_cont(Number x1, Number x2, Number y, Number u) const
303  {
304  Number diff_y = y-y_d_cont(x1,x2);
305  return 0.5*(diff_y*diff_y + alpha_*u*u);
306  }
308  virtual Number fint_cont_dy(Number x1, Number x2, Number y, Number u) const
309  {
310  return y-y_d_cont(x1,x2);
311  }
312 
314  virtual Number fint_cont_du(Number x1, Number x2, Number y, Number u) const
315  {
316  return alpha_*u;
317  }
319  virtual Number fint_cont_dydy(Number x1, Number x2, Number y, Number u) const
320  {
321  return 1.;
322  }
325  virtual bool fint_cont_dydy_alwayszero() const
326  {
327  return false;
328  }
330  virtual Number fint_cont_dudu(Number x1, Number x2, Number y, Number u) const
331  {
332  return alpha_;
333  }
336  virtual bool fint_cont_dudu_alwayszero() const
337  {
338  return false;
339  }
341  virtual Number fint_cont_dydu(Number x1, Number x2, Number y, Number u) const
342  {
343  return 0.;
344  }
347  virtual bool fint_cont_dydu_alwayszero() const
348  {
349  return true;
350  }
352  virtual Number d_cont(Number x1, Number x2, Number y, Number u) const
353  {
354  return -exp(y) - u;
355  }
357  virtual Number d_cont_dy(Number x1, Number x2, Number y, Number u) const
358  {
359  return -exp(y);
360  }
362  virtual Number d_cont_du(Number x1, Number x2, Number y, Number u) const
363  {
364  return -1.;
365  }
367  virtual Number d_cont_dydy(Number x1, Number x2, Number y, Number u) const
368  {
369  return -exp(y);
370  }
373  virtual bool d_cont_dydy_alwayszero() const
374  {
375  return false;
376  }
378  virtual Number d_cont_dudu(Number x1, Number x2, Number y, Number u) const
379  {
380  return 0.;
381  }
384  virtual bool d_cont_dudu_alwayszero() const
385  {
386  return true;
387  }
389  virtual Number d_cont_dydu(Number x1, Number x2, Number y, Number u) const
390  {
391  return 0.;
392  }
395  virtual bool d_cont_dydu_alwayszero() const
396  {
397  return true;
398  }
399 private:
405 
406  const Number pi_;
408  const Number alpha_;
409 };
410 
413 {
414 public:
416  :
417  pi_(4.*atan(1.))
418  {}
419 
421  {}
422 
423  virtual bool InitializeProblem(Index N)
424  {
425  if (N<1) {
426  printf("N has to be at least 1.");
427  return false;
428  }
429  Number lb_y = -1e20;
430  Number ub_y = 0.371;
431  Number lb_u = -8.;
432  Number ub_u = 9.;
433  Number b_0j = 1.;
434  Number b_1j = 1.;
435  Number b_i0 = 1.;
436  Number b_i1 = 1.;
437  Number u_init = (ub_u + lb_u)/2.;
438 
439  SetBaseParameters(N, lb_y, ub_y, lb_u, ub_u, b_0j, b_1j, b_i0, b_i1, u_init);
440  return true;
441  }
442 protected:
444  virtual Number y_d_cont(Number x1, Number x2) const
445  {
446  return sin(2.*pi_*x1)*sin(2.*pi_*x2);
447  }
449  virtual Number fint_cont(Number x1, Number x2, Number y, Number u) const
450  {
451  Number diff_y = y-y_d_cont(x1,x2);
452  return 0.5*diff_y*diff_y;
453  }
455  virtual Number fint_cont_dy(Number x1, Number x2, Number y, Number u) const
456  {
457  return y-y_d_cont(x1,x2);
458  }
459 
461  virtual Number fint_cont_du(Number x1, Number x2, Number y, Number u) const
462  {
463  return 0.;
464  }
466  virtual Number fint_cont_dydy(Number x1, Number x2, Number y, Number u) const
467  {
468  return 1.;
469  }
472  virtual bool fint_cont_dydy_alwayszero() const
473  {
474  return false;
475  }
477  virtual Number fint_cont_dudu(Number x1, Number x2, Number y, Number u) const
478  {
479  return 0.;
480  }
483  virtual bool fint_cont_dudu_alwayszero() const
484  {
485  return true;
486  }
488  virtual Number fint_cont_dydu(Number x1, Number x2, Number y, Number u) const
489  {
490  return 0.;
491  }
494  virtual bool fint_cont_dydu_alwayszero() const
495  {
496  return true;
497  }
499  virtual Number d_cont(Number x1, Number x2, Number y, Number u) const
500  {
501  return -exp(y) - u;
502  }
504  virtual Number d_cont_dy(Number x1, Number x2, Number y, Number u) const
505  {
506  return -exp(y);
507  }
509  virtual Number d_cont_du(Number x1, Number x2, Number y, Number u) const
510  {
511  return -1.;
512  }
514  virtual Number d_cont_dydy(Number x1, Number x2, Number y, Number u) const
515  {
516  return -exp(y);
517  }
520  virtual bool d_cont_dydy_alwayszero() const
521  {
522  return false;
523  }
525  virtual Number d_cont_dudu(Number x1, Number x2, Number y, Number u) const
526  {
527  return 0.;
528  }
531  virtual bool d_cont_dudu_alwayszero() const
532  {
533  return true;
534  }
536  virtual Number d_cont_dydu(Number x1, Number x2, Number y, Number u) const
537  {
538  return 0.;
539  }
542  virtual bool d_cont_dydu_alwayszero() const
543  {
544  return true;
545  }
546 private:
552 
553  const Number pi_;
554 };
555 
558 {
559 public:
561  :
562  pi_(4.*atan(1.)),
563  M_(1.),
564  K_(0.8),
565  b_(1.)
566  {}
567 
569  {}
570 
571  virtual bool InitializeProblem(Index N)
572  {
573  if (N<1) {
574  printf("N has to be at least 1.");
575  return false;
576  }
577  Number lb_y = 3.;//-1e20;
578  Number ub_y = 6.09;
579  Number lb_u = 1.4;
580  Number ub_u = 1.6;
581  Number b_0j = 1.;
582  Number b_1j = 0.;
583  Number b_i0 = 1.;
584  Number b_i1 = 0.;
585  Number u_init = (ub_u + lb_u)/2.;
586 
587  SetBaseParameters(N, lb_y, ub_y, lb_u, ub_u, b_0j, b_1j, b_i0, b_i1, u_init);
588  return true;
589  }
590 protected:
592  virtual Number y_d_cont(Number x1, Number x2) const
593  {
594  return 6.;
595  }
597  virtual Number fint_cont(Number x1, Number x2, Number y, Number u) const
598  {
599  return u*(M_*u - K_*y);
600  }
602  virtual Number fint_cont_dy(Number x1, Number x2, Number y, Number u) const
603  {
604  return -K_*u;
605  }
606 
608  virtual Number fint_cont_du(Number x1, Number x2, Number y, Number u) const
609  {
610  return 2.*M_*u - K_*y;
611  }
613  virtual Number fint_cont_dydy(Number x1, Number x2, Number y, Number u) const
614  {
615  return 0.;
616  }
619  virtual bool fint_cont_dydy_alwayszero() const
620  {
621  return true;
622  }
624  virtual Number fint_cont_dudu(Number x1, Number x2, Number y, Number u) const
625  {
626  return 2.*M_;
627  }
630  virtual bool fint_cont_dudu_alwayszero() const
631  {
632  return false;
633  }
635  virtual Number fint_cont_dydu(Number x1, Number x2, Number y, Number u) const
636  {
637  return -K_;
638  }
641  virtual bool fint_cont_dydu_alwayszero() const
642  {
643  return false;
644  }
646  virtual Number d_cont(Number x1, Number x2, Number y, Number u) const
647  {
648  return y*(u + b_*y - a(x1,x2));
649  }
651  virtual Number d_cont_dy(Number x1, Number x2, Number y, Number u) const
652  {
653  return (u + 2.*b_*y -a(x1,x2));
654  }
656  virtual Number d_cont_du(Number x1, Number x2, Number y, Number u) const
657  {
658  return y;
659  }
661  virtual Number d_cont_dydy(Number x1, Number x2, Number y, Number u) const
662  {
663  return 2.*b_;
664  }
667  virtual bool d_cont_dydy_alwayszero() const
668  {
669  return false;
670  }
672  virtual Number d_cont_dudu(Number x1, Number x2, Number y, Number u) const
673  {
674  return 0.;
675  }
678  virtual bool d_cont_dudu_alwayszero() const
679  {
680  return true;
681  }
683  virtual Number d_cont_dydu(Number x1, Number x2, Number y, Number u) const
684  {
685  return 1.;
686  }
689  virtual bool d_cont_dydu_alwayszero() const
690  {
691  return false;
692  }
693 private:
699 
700  const Number pi_;
701  /*@name constrants appearing in problem formulation */
703  const Number M_;
704  const Number K_;
705  const Number b_;
707  //* Auxiliary function for state equation */
708  inline Number a(Number x1, Number x2) const
709  {
710  return 7. + 4.*sin(2.*pi_*x1*x2);
711  }
712 };
713 
714 #endif
virtual bool InitializeProblem(Index N)
Initialize internal parameters, where N is a parameter determining the problme size.
const Number pi_
Value of pi (made available for convenience)
virtual bool d_cont_dydu_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
Number * x
Input: Starting point Output: Optimal solution.
virtual bool d_cont_dydy_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
Class for all IPOPT specific calculated quantities.
Number Number Index Number Number Index Index Index index_style
indexing style for iRow &amp; jCol, 0 for C style, 1 for Fortran style
Number b_1j_
Value of beta function (in Neumann boundary condition) for (1,x2) bounray.
virtual Number d_cont_dydu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t.
virtual Number d_cont(Number x1, Number x2, Number y, Number u) const
Forcing function for the elliptic equation.
Number Number Index m
Number of constraints.
Base class for distributed control problems with homogeneous Neumann boundary conditions, as formulated by Hans Mittelmann as Examples 4-6 in "Optimization Techniques for Solving Elliptic Control Problems with Control and State Constraints.
virtual bool d_cont_dudu_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
virtual Number d_cont_dydu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t.
virtual Number fint_cont_dy(Number x1, Number x2, Number y, Number u) const
First partial derivative of fint_cont w.r.t.
Number Number * g
Values of constraint at final point (output only - ignored if set to NULL)
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB Eval_Grad_F_CB Eval_Jac_G_CB Eval_H_CB eval_h
Callback function for evaluating Hessian of Lagrangian function.
virtual bool d_cont_dydy_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
virtual Number d_cont_dudu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t.
Number a(Number x1, Number x2) const
virtual Number d_cont(Number x1, Number x2, Number y, Number u) const
Forcing function for the elliptic equation.
virtual Number fint_cont(Number x1, Number x2, Number y, Number u) const
Integrant in objective function.
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
virtual bool InitializeProblem(Index N)
Initialize internal parameters, where N is a parameter determining the problme size.
Number ub_u_
overall upper bound on u
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB Eval_Grad_F_CB eval_grad_f
Callback function for evaluating gradient of objective function.
virtual Number fint_cont_du(Number x1, Number x2, Number y, Number u) const
First partial derivative of fint_cont w.r.t.
virtual Number fint_cont_dydy(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.
virtual Number d_cont_dudu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t.
Number x2_grid(Index i) const
Compute the grid coordinate for given index in x2 direction.
virtual Number fint_cont_du(Number x1, Number x2, Number y, Number u) const
First partial derivative of fint_cont w.r.t.
virtual bool fint_cont_dydy_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
virtual Number d_cont_dydy(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t y,y.
virtual Number fint_cont(Number x1, Number x2, Number y, Number u) const
Integrant in objective function.
virtual bool fint_cont_dudu_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
virtual bool fint_cont_dydy_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
virtual Number fint_cont_dydu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.
virtual bool InitializeProblem(Index N)
Initialize internal parameters, where N is a parameter determining the problme size.
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB Eval_Grad_F_CB Eval_Jac_G_CB eval_jac_g
Callback function for evaluating Jacobian of constraint functions.
virtual bool fint_cont_dudu_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
virtual Number d_cont_du(Number x1, Number x2, Number y, Number u) const
First partial derivative of forcing function w.r.t.
SolverReturn
enum for the return from the optimize algorithm (obviously we need to add more)
Definition: IpAlgTypes.hpp:22
Number b_i1_
Value of beta function (in Neumann boundary condition) for (x1,1) bounray.
virtual bool d_cont_dydy_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
Number ub_y_
overall upper bound on y
virtual Number d_cont_dydy(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t y,y.
virtual bool fint_cont_dydu_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
virtual Number fint_cont_dudu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.
Number Number Index Number Number Index nele_jac
Number of non-zero elements in constraint Jacobian.
Number u_init_
Initial value for the constrols u.
virtual Number d_cont_dy(Number x1, Number x2, Number y, Number u) const
First partial derivative of forcing function w.r.t.
virtual Number d_cont_dy(Number x1, Number x2, Number y, Number u) const
First partial derivative of forcing function w.r.t.
virtual Number fint_cont_dy(Number x1, Number x2, Number y, Number u) const
First partial derivative of fint_cont w.r.t.
virtual Number y_d_cont(Number x1, Number x2) const
Target profile function for y.
virtual Number fint_cont_dydy(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.
virtual bool fint_cont_dydu_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
Class implementating Example 6.
virtual Number d_cont_dydy(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t y,y.
Class to organize all the data required by the algorithm.
Definition: IpIpoptData.hpp:83
Number lb_y_
overall lower bound on y
virtual Number fint_cont_du(Number x1, Number x2, Number y, Number u) const
First partial derivative of fint_cont w.r.t.
const Number pi_
Value of pi (made available for convenience)
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB eval_g
Callback function for evaluating constraint functions.
Index N_
Number of mesh points in one dimension (excluding boundary)
virtual Number y_d_cont(Number x1, Number x2) const
Profile function for initial y.
virtual bool d_cont_dudu_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
virtual Number fint_cont_dudu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.
virtual Number fint_cont(Number x1, Number x2, Number y, Number u) const
Integrant in objective function.
virtual Number d_cont_dudu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t.
Number Number * x_scaling
const Number alpha_
Value for parameter alpha in objective functin.
virtual Number d_cont_dy(Number x1, Number x2, Number y, Number u) const
First partial derivative of forcing function w.r.t.
virtual Number d_cont_du(Number x1, Number x2, Number y, Number u) const
First partial derivative of forcing function w.r.t.
virtual bool d_cont_dydu_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
Number Number Index Number Number Index Index nele_hess
Number of non-zero elements in Hessian of Lagrangian.
virtual Number d_cont_dydu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of forcing function w.r.t.
Number * y_d_
Array for the target profile for y.
Class implemented the NLP discretization of.
virtual Number fint_cont_dudu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.
virtual Number fint_cont_dydy(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.
virtual bool d_cont_dydu_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
virtual bool fint_cont_dydy_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
Number b_i0_
Value of beta function (in Neumann boundary condition) for (x1,0) bounray.
virtual bool fint_cont_dydu_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
Class implementating Example 5.
Number x1_grid(Index i) const
Compute the grid coordinate for given index in x1 direction.
Number Number Number * g_scaling
IndexStyleEnum
overload this method to return the number of variables and constraints, and the number of non-zeros i...
Definition: IpTNLP.hpp:80
virtual Number fint_cont_dydu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.
virtual Number fint_cont_dy(Number x1, Number x2, Number y, Number u) const
First partial derivative of fint_cont w.r.t.
const Number pi_
Value of pi (made available for convenience)
virtual bool fint_cont_dudu_alwayszero() const
returns true if second partial derivative of fint_cont w.r.t.
Index y_index(Index i, Index j) const
Translation of mesh point indices to NLP variable indices for y(x_ij)
virtual bool d_cont_dudu_alwayszero() const
returns true if second partial derivative of d_cont w.r.t.
virtual Number y_d_cont(Number x1, Number x2) const
Target profile function for y.
Index u_index(Index i, Index j) const
Translation of mesh point indices to NLP variable indices for u(x_ij)
Number obj_scaling
Index pde_index(Index i, Index j) const
Translation of interior mesh point indices to the corresponding PDE constraint number.
Number b_0j_
Value of beta function (in Neumann boundary condition) for (0,x2) bounray.
Number Number Index Number Number Index Index Index Eval_F_CB eval_f
Callback function for evaluating objective function.
virtual Number d_cont_du(Number x1, Number x2, Number y, Number u) const
First partial derivative of forcing function w.r.t.
virtual Number d_cont(Number x1, Number x2, Number y, Number u) const
Forcing function for the elliptic equation.
Class implementating Example 4.
Number lb_u_
overall lower bound on u
virtual Number fint_cont_dydu(Number x1, Number x2, Number y, Number u) const
Second partial derivative of fint_cont w.r.t.