10 #ifndef __MITTELMANNBNDRYCNTRLDIRI_HPP__
11 #define __MITTELMANNBNDRYCNTRLDIRI_HPP__
18 #include "configall_system.h"
27 # error "don't have header file for math"
37 # error "don't have header file for stdio"
41 using namespace Ipopt;
72 virtual bool get_starting_point(
Index n,
bool init_x,
Number*
x,
74 Index m,
bool init_lambda,
107 bool& use_x_scaling,
Index n,
109 bool& use_g_scaling,
Index m,
191 return (j-1) + N_*(i-1);
219 printf(
"N has to be at least 1.");
228 SetBaseParameters(N, alpha, lb_y, ub_y, lb_u, ub_u, d_const);
235 return 3. + 5.*(x1*(x1-1.)*x2*(x2-1.));
258 printf(
"N has to be at least 1.");
267 SetBaseParameters(N, alpha, lb_y, ub_y, lb_u, ub_u, d_const);
274 return 3. + 5.*(x1*(x1-1.)*x2*(x2-1.));
297 printf(
"N has to be at least 1.");
306 SetBaseParameters(N, alpha, lb_y, ub_y, lb_u, ub_u, d_const);
313 return 3. + 5.*(x1*(x1-1.)*x2*(x2-1.));
336 printf(
"N has to be at least 1.");
345 SetBaseParameters(N, alpha, lb_y, ub_y, lb_u, ub_u, d_const);
352 return 3. + 5.*(x1*(x1-1.)*x2*(x2-1.));
Number * x
Input: Starting point Output: Optimal solution.
virtual ~MittelmannBndryCntrlDiri3()
Class for all IPOPT specific calculated quantities.
Number Number Index Number Number Index Index Index index_style
indexing style for iRow & jCol, 0 for C style, 1 for Fortran style
Class implementating Example 3.
Number Number Index m
Number of constraints.
Class implementating Example 1.
Index y_index(Index i, Index j) const
Translation of mesh point indices to NLP variable indices for y(x_ij)
Index N_
Number of mesh points in one dimension (excluding boundary)
Index pde_index(Index i, Index j) const
Translation of interior mesh point indices to the corresponding PDE constraint number.
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 ~MittelmannBndryCntrlDiri4()
double Number
Type of all numbers.
virtual ~MittelmannBndryCntrlDiri1()
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.
Class implementating Example 4.
Class implementating Example 2.
virtual Number y_d_cont(Number x1, Number x2) const
Target profile function for y.
Number x2_grid(Index i) const
Compute the grid coordinate for given index in x2 direction.
virtual Number y_d_cont(Number x1, Number x2) const
Target profile function for y.
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.
Number ub_u_
overall upper bound on u
Number d_const_
Constant value of d appearing in elliptical equation.
SolverReturn
enum for the return from the optimize algorithm (obviously we need to add more)
MittelmannBndryCntrlDiri2()
Number Number Index Number Number Index nele_jac
Number of non-zero elements in constraint Jacobian.
Number ub_y_
overall upper bound on y
Number lb_u_
overall lower bound on u
MittelmannBndryCntrlDiri1()
virtual Number y_d_cont(Number x1, Number x2) const
Target profile function for y.
virtual bool InitializeProblem(Index N)
Initialize internal parameters, where N is a parameter determining the problme size.
Class to organize all the data required by the algorithm.
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB eval_g
Callback function for evaluating constraint functions.
virtual Number y_d_cont(Number x1, Number x2) const
Target profile function for y.
int Index
Type of all indices of vectors, matrices etc.
Number alpha_
Weighting parameter for the control target deviation functional in the objective. ...
Number Number * x_scaling
Number Number Index Number Number Index Index nele_hess
Number of non-zero elements in Hessian of Lagrangian.
MittelmannBndryCntrlDiri4()
Base class for boundary control problems with Dirichlet boundary conditions, as formulated by Hans Mi...
virtual bool InitializeProblem(Index N)
Initialize internal parameters, where N is a parameter determining the problme size.
MittelmannBndryCntrlDiri3()
Class implemented the NLP discretization of.
Number * y_d_
Array for the target profile for y.
Number Number Number * g_scaling
IndexStyleEnum
overload this method to return the number of variables and constraints, and the number of non-zeros i...
Number lb_y_
overall lower bound on y
virtual bool InitializeProblem(Index N)
Initialize internal parameters, where N is a parameter determining the problme size.
virtual bool InitializeProblem(Index N)
Initialize internal parameters, where N is a parameter determining the problme size.
virtual ~MittelmannBndryCntrlDiri2()
Number Number Index Number Number Index Index Index Eval_F_CB eval_f
Callback function for evaluating objective function.
Number x1_grid(Index i) const
Compute the grid coordinate for given index in x1 direction.