Ipopt 3.12.10

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MittelmannParaCntrl.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: MittelmannParaCntrl.hpp 2005 2011-06-06 12:55:16Z stefan $
6 //
7 // Authors: Andreas Waechter IBM 2005-10-18
8
9 #ifndef __MITTELMANNPARACNTRL_HPP__
10 #define __MITTELMANNPARACNTRL_HPP__
11
12 #include "RegisteredTNLP.hpp"
13
14 #ifdef HAVE_CONFIG_H
15 #include "config.h"
16 #else
17 #include "configall_system.h"
18 #endif
19
20 #ifdef HAVE_CMATH
21 # include <cmath>
22 #else
23 # ifdef HAVE_MATH_H
24 # include <math.h>
25 # else
26 # error "don't have header file for math"
27 # endif
28 #endif
29
30 using namespace Ipopt;
31
37 template<class T>
38 class MittelmannParaCntrlBase : public RegisteredTNLP
39 {
40 public:
42 MittelmannParaCntrlBase();
43
45 virtual ~MittelmannParaCntrlBase();
46
50 virtual bool get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
51 Index& nnz_h_lag, IndexStyleEnum& index_style);
52
54 virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
55 Index m, Number* g_l, Number* g_u);
56
58 virtual bool get_starting_point(Index n, bool init_x, Number* x,
59 bool init_z, Number* z_L, Number* z_U,
60 Index m, bool init_lambda,
61 Number* lambda);
62
64 virtual bool eval_f(Index n, const Number* x, bool new_x, Number& obj_value);
65
67 virtual bool eval_grad_f(Index n, const Number* x, bool new_x, Number* grad_f);
68
70 virtual bool eval_g(Index n, const Number* x, bool new_x, Index m, Number* g);
71
76 virtual bool eval_jac_g(Index n, const Number* x, bool new_x,
77 Index m, Index nele_jac, Index* iRow, Index *jCol,
78 Number* values);
79
84 virtual bool eval_h(Index n, const Number* x, bool new_x,
85 Number obj_factor, Index m, const Number* lambda,
86 bool new_lambda, Index nele_hess, Index* iRow,
87 Index* jCol, Number* values);
88
90
92 virtual bool get_scaling_parameters(Number& obj_scaling,
93 bool& use_x_scaling, Index n,
94 Number* x_scaling,
95 bool& use_g_scaling, Index m,
96 Number* g_scaling);
97
102 virtual void finalize_solution(SolverReturn status,
103 Index n, const Number* x, const Number* z_L, const Number* z_U,
104 Index m, const Number* g, const Number* lambda,
105 Number obj_value,
106 const IpoptData* ip_data,
107 IpoptCalculatedQuantities* ip_cq);
109
110 virtual bool InitializeProblem(Index N);
111
112 private:
124 MittelmannParaCntrlBase(const MittelmannParaCntrlBase<T>&);
125 MittelmannParaCntrlBase& operator=(const MittelmannParaCntrlBase<T>&);
127
131 Number T_;
133 Number l_;
135 Index Nt_;
137 Index Nx_;
139 Number dt_;
141 Number dx_;
143 Number lb_y_;
145 Number ub_y_;
147 Number lb_u_;
149 Number ub_u_;
152 Number alpha_;
154 Number beta_;
156 Number* y_T_;
158 Number* a_y_;
160 Number* a_u_;
162
167 inline Index y_index(Index jx, Index it) const
168 {
169 return jx + (Nx_+1)*it;
170 }
171 inline Index u_index(Index it) const
172 {
173 return (Nt_+1)*(Nx_+1) + it - 1;
174 }
176 inline Number t_grid(Index i) const
177 {
178 return dt_*(Number)i;
179 }
181 inline Number x_grid(Index j) const
182 {
183 return dx_*(Number)j;
184 }
186 };
187
188 template <class T>
189 MittelmannParaCntrlBase<T>::MittelmannParaCntrlBase()
190 :
191 y_T_(NULL),
192 a_y_(NULL),
193 a_u_(NULL)
194 {}
195
196 template <class T>
197 MittelmannParaCntrlBase<T>::~MittelmannParaCntrlBase()
198 {
199 delete [] y_T_;
200 delete [] a_y_;
201 delete [] a_u_;
202 }
203
204 template <class T>
205 bool MittelmannParaCntrlBase<T>::
206 InitializeProblem(Index N)
207 {
208 typename T::ProblemSpecs p;
209
210 if (N<1) {
211 printf("N has to be at least 1.");
212 return false;
213 }
214
215 T_ = p.T();
216 l_ = p.l();
217 Nt_ = N;
218 Nx_ = N;
219 dt_ = T_/Nt_;
220 dx_ = l_/Nx_;
221 lb_y_ = p.lb_y();
222 ub_y_ = p.ub_y();
223 lb_u_ = p.lb_u();
224 ub_u_ = p.ub_u();
225 alpha_ = p.alpha();
226 beta_ = p.beta();
227
228 y_T_ = new Number[Nx_+1];
229 for (Index j=0; j<=Nx_; j++) {
230 y_T_[j] = p.y_T(x_grid(j));
231 }
232 a_y_ = new Number[Nt_];
233 for (Index i=1; i<=Nt_; i++) {
234 a_y_[i-1] = p.a_y(t_grid(i));
235 }
236 a_u_ = new Number[Nt_];
237 for (Index i=1; i<=Nt_; i++) {
238 a_u_[i-1] = p.a_u(t_grid(i));
239 }
240
241 return true;
242 }
243
244 template <class T>
245 bool MittelmannParaCntrlBase<T>::
246 get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
247 Index& nnz_h_lag, IndexStyleEnum& index_style)
248 {
249 typename T::ProblemSpecs p;
250
251 n = (Nt_+1)*(Nx_+1) + Nt_;
252
253 m = Nt_*(Nx_-1) + Nt_ + Nt_;
254
255 nnz_jac_g = 6*Nt_*(Nx_-1) + 3*Nt_ + 4*Nt_;
256
257 nnz_h_lag = Nx_+1 + Nt_;
258 if (!p.phi_dydy_always_zero()) {
259 nnz_h_lag += Nt_;
260 }
261
262 index_style = C_STYLE;
263
264 return true;
265 }
266
267 template <class T>
268 bool MittelmannParaCntrlBase<T>::
269 get_bounds_info(Index n, Number* x_l, Number* x_u,
270 Index m, Number* g_l, Number* g_u)
271 {
272 typename T::ProblemSpecs p;
273
274 // Set overall bounds on the variables
275 for (Index jx=0; jx<=Nx_; jx++) {
276 for (Index it=1; it<=Nt_; it++) {
277 Index iy = y_index(jx,it);
278 x_l[iy] = lb_y_;
279 x_u[iy] = ub_y_;
280 }
281 }
282 for (Index i=1; i<=Nt_; i++) {
283 Index iu = u_index(i);
284 x_l[iu] = lb_u_;
285 x_u[iu] = ub_u_;
286 }
287
288 /*
289 // Boundary condition for t=0
290 for (Index it=0; it<=Nt_; it++) {
291 Index iy = y_index(0,it);
292 x_u[iy] = x_l[iy] = p.a(t_grid(it));
293 }
294 */
295 // Boundary condition for t=0
296 for (Index jx=0; jx<=Nx_; jx++) {
297 Index iy = y_index(jx,0);
298 x_u[iy] = x_l[iy] = p.a(x_grid(jx));
299 }
300
301 // all discretized PDE constraints have right hand side zero
302 for (Index i=0; i<Nt_*(Nx_-1) + Nt_; i++) {
303 g_l[i] = 0.;
304 g_u[i] = 0.;
305 }
306
307 // but we put b on the right hand side for the x=L boundary condition
308 for (Index i=0; i<Nt_; i++) {
309 g_l[Nt_*(Nx_-1) + Nt_ + i]
310 = g_u[Nt_*(Nx_-1) + Nt_ + i]
311 = p.b(t_grid(i+1));
312 }
313
314 return true;
315 }
316
317 template <class T>
318 bool MittelmannParaCntrlBase<T>::
319 get_starting_point(Index n, bool init_x, Number* x,
320 bool init_z, Number* z_L, Number* z_U,
321 Index m, bool init_lambda,
322 Number* lambda)
323 {
324 DBG_ASSERT(init_x==true && init_z==false && init_lambda==false);
325
326 // Set starting point for y
327 for (Index jx=0; jx<=Nx_; jx++) {
328 for (Index it=0; it<=Nt_; it++) {
329 x[y_index(jx,it)] = 0.;
330 }
331 }
332 // for u
333 for (Index i=1; i<=Nt_; i++) {
334 x[u_index(i)] = (ub_u_+lb_u_)/2.;
335 }
336
337 /*
338 // DELETEME
339 for (Index i=0; i<n; i++) {
340 x[i] += 0.01*i;
341 }
342 */
343
344 return true;
345 }
346
347 template <class T>
348 bool MittelmannParaCntrlBase<T>::
349 get_scaling_parameters(Number& obj_scaling,
350 bool& use_x_scaling,
351 Index n, Number* x_scaling,
352 bool& use_g_scaling,
353 Index m, Number* g_scaling)
354 {
355 obj_scaling = 1./Min(dx_,dt_);
356 use_x_scaling = false;
357 use_g_scaling = false;
358 return true;
359 }
360
361 template <class T>
362 bool MittelmannParaCntrlBase<T>::
363 eval_f(Index n, const Number* x,
364 bool new_x, Number& obj_value)
365 {
366 // Deviation of y from target
367 Number a = x[y_index(0,Nt_)] - y_T_[0];
368 Number sum = 0.5*a*a;
369 for (Index jx=1; jx<Nx_; jx++) {
370 a = x[y_index(jx,Nt_)] - y_T_[jx];
371 sum += a*a;
372 }
373 a = x[y_index(Nx_,Nt_)] - y_T_[Nx_];
374 sum += 0.5*a*a;
375 obj_value = 0.5*dx_*sum;
376
377 // smoothing for control
378 if (alpha_!=.0) {
379 sum = 0.5*x[u_index(Nt_)]*x[u_index(Nt_)];
380 for (Index it=1; it < Nt_; it++) {
381 sum += x[u_index(it)]*x[u_index(it)];
382 }
383 obj_value += 0.5*alpha_*dt_*sum;
384 }
385
386 // third term
387 sum = 0.;
388 for (Index it=1; it<Nt_; it++) {
389 sum += a_y_[it-1]*x[y_index(Nx_,it)] + a_u_[it-1]*x[u_index(it)];
390 }
391 sum += 0.5*(a_y_[Nt_-1]*x[y_index(Nx_,Nt_)] + a_u_[Nt_-1]*x[u_index(Nt_)]);
392 obj_value += dt_*sum;
393
394 return true;
395 }
396
397 template <class T>
398 bool MittelmannParaCntrlBase<T>::
399 eval_grad_f(Index n, const Number* x, bool new_x, Number* grad_f)
400 {
401 // First set all y entries to zero
402 for (Index jx=0; jx<=Nx_; jx++) {
403 for (Index it=0; it<=Nt_; it++) {
404 grad_f[y_index(jx,it)] = 0.;
405 }
406 }
407
408 // y entries from y target
409 grad_f[y_index(0,Nt_)] = 0.5*dx_*(x[y_index(0,Nt_)] - y_T_[0]);
410 for (Index jx=1; jx<Nx_; jx++) {
411 grad_f[y_index(jx,Nt_)] = dx_*(x[y_index(jx,Nt_)] - y_T_[jx]);
412 }
413 grad_f[y_index(Nx_,Nt_)] = 0.5*dx_*(x[y_index(Nx_,Nt_)] - y_T_[Nx_]);
414
415 // y entries from thrid term
416 for (Index it=1; it<Nt_; it++) {
417 grad_f[y_index(Nx_,it)] = dt_*a_y_[it-1];
418 }
419 grad_f[y_index(Nx_,Nt_)] += 0.5*dt_*a_y_[Nt_-1];
420
421 // u entries from smoothing and third term
422 for (Index it=1; it<Nt_; it++) {
423 grad_f[u_index(it)] = alpha_*dt_*x[u_index(it)] + dt_*a_u_[it-1];
424 }
425 grad_f[u_index(Nt_)] = 0.5*dt_*(alpha_*x[u_index(Nt_)] + a_u_[Nt_-1]);
426
427 return true;
428 }
429
430 template <class T>
431 bool MittelmannParaCntrlBase<T>::
432 eval_g(Index n, const Number* x, bool new_x, Index m, Number* g)
433 {
434 typename T::ProblemSpecs p;
435
436 Index ig=0;
437
438 Number f = 1./(2.*dx_*dx_);
439 for (Index jx=1; jx<Nx_; jx++) {
440 for (Index it=0; it<Nt_; it++) {
441 g[ig] = (x[y_index(jx,it)]-x[y_index(jx,it+1)])/dt_
442 + f*(x[y_index(jx-1,it)] - 2.*x[y_index(jx,it)]
443 + x[y_index(jx+1,it)] + x[y_index(jx-1,it+1)]
444 - 2.*x[y_index(jx,it+1)] + x[y_index(jx+1,it+1)]);
445 ig++;
446 }
447 }
448
449 for (Index it=1; it<=Nt_; it++) {
450 g[ig] = (x[y_index(2,it)] - 4.*x[y_index(1,it)] + 3.*x[y_index(0,it)]);
451 ig++;
452 }
453
454 f = 1./(2.*dx_);
455 for (Index it=1; it<=Nt_; it++) {
456 g[ig] =
457 f*(x[y_index(Nx_-2,it)] - 4.*x[y_index(Nx_-1,it)]
458 + 3.*x[y_index(Nx_,it)]) + beta_*x[y_index(Nx_,it)]
459 - x[u_index(it)] + p.phi(x[y_index(Nx_,it)]);
460 ig++;
461 }
462
463 DBG_ASSERT(ig == m);
464
465 return true;
466 }
467
468 template <class T>
469 bool MittelmannParaCntrlBase<T>::
470 eval_jac_g(Index n, const Number* x, bool new_x,
471 Index m, Index nele_jac, Index* iRow, Index *jCol,
472 Number* values)
473 {
474 typename T::ProblemSpecs p;
475
476 Index ijac = 0;
477
478 if (values == NULL) {
479 Index ig = 0;
480 for (Index jx=1; jx<Nx_; jx++) {
481 for (Index it=0; it<Nt_; it++) {
482 iRow[ijac] = ig;
483 jCol[ijac] = y_index(jx-1,it);
484 ijac++;
485 iRow[ijac] = ig;
486 jCol[ijac] = y_index(jx,it);
487 ijac++;
488 iRow[ijac] = ig;
489 jCol[ijac] = y_index(jx+1,it);
490 ijac++;
491 iRow[ijac] = ig;
492 jCol[ijac] = y_index(jx-1,it+1);
493 ijac++;
494 iRow[ijac] = ig;
495 jCol[ijac] = y_index(jx,it+1);
496 ijac++;
497 iRow[ijac] = ig;
498 jCol[ijac] = y_index(jx+1,it+1);
499 ijac++;
500
501 ig++;
502 }
503 }
504
505 for (Index it=1; it<=Nt_; it++) {
506 iRow[ijac] = ig;
507 jCol[ijac] = y_index(0,it);
508 ijac++;
509 iRow[ijac] = ig;
510 jCol[ijac] = y_index(1,it);
511 ijac++;
512 iRow[ijac] = ig;
513 jCol[ijac] = y_index(2,it);
514 ijac++;
515
516 ig++;
517 }
518
519 for (Index it=1; it<=Nt_; it++) {
520 iRow[ijac] = ig;
521 jCol[ijac] = y_index(Nx_-2,it);
522 ijac++;
523 iRow[ijac] = ig;
524 jCol[ijac] = y_index(Nx_-1,it);
525 ijac++;
526 iRow[ijac] = ig;
527 jCol[ijac] = y_index(Nx_,it);
528 ijac++;
529 iRow[ijac] = ig;
530 jCol[ijac] = u_index(it);
531 ijac++;
532
533 ig++;
534 }
535 DBG_ASSERT(ig == m);
536 }
537 else {
538 Number f = 1./(2.*dx_*dx_);
539 Number f2 = 1./dt_;
540 for (Index jx=1; jx<Nx_; jx++) {
541 for (Index it=0; it<Nt_; it++) {
542 values[ijac++] = f;
543 values[ijac++] = f2 - 2.*f;
544 values[ijac++] = f;
545 values[ijac++] = f;
546 values[ijac++] = -f2 - 2.*f;
547 values[ijac++] = f;
548 }
549 }
550
551 for (Index it=1; it<=Nt_; it++) {
552 values[ijac++] = 3.;
553 values[ijac++] = -4.;
554 values[ijac++] = 1.;
555 }
556
557 f = 1./(2.*dx_);
558 for (Index it=1; it<=Nt_; it++) {
559 values[ijac++] = f;
560 values[ijac++] = -4.*f;
561 values[ijac++] = 3.*f + beta_ + p.phi_dy(x[y_index(Nx_,it)]);
562 values[ijac++] = -1.;
563 }
564
565 }
566
567 return true;
568 }
569
570 template <class T>
571 bool MittelmannParaCntrlBase<T>::
572 eval_h(Index n, const Number* x, bool new_x,
573 Number obj_factor, Index m, const Number* lambda,
574 bool new_lambda, Index nele_hess, Index* iRow,
575 Index* jCol, Number* values)
576 {
577 typename T::ProblemSpecs p;
578
579 Index ihes = 0;
580
581 if (values == NULL) {
582 // y values from objective
583 for (Index jx=0; jx<= Nx_; jx++) {
584 iRow[ihes] = y_index(jx,Nt_);
585 jCol[ihes] = y_index(jx,Nt_);
586 ihes++;
587 }
588 // u from objective
589 for (Index it=1; it<=Nt_; it++) {
590 iRow[ihes] = u_index(it);
591 jCol[ihes] = u_index(it);
592 ihes++;
593 }
594
595 // constraint
596 if (!p.phi_dydy_always_zero()) {
597 for (Index it=1; it<=Nt_; it++) {
598 iRow[ihes] = y_index(Nx_,it);
599 jCol[ihes] = y_index(Nx_,it);
600 ihes++;
601 }
602 }
603 }
604 else {
605 // y values from objective
606 values[ihes++] = obj_factor*0.5*dx_;
607 for (Index jx=1; jx<Nx_; jx++) {
608 values[ihes++] = obj_factor*dx_;
609 }
610 values[ihes++] = obj_factor*0.5*dx_;
611 // u from objective
612 for (Index it=1; it<Nt_; it++) {
613 values[ihes++] = obj_factor*alpha_*dt_;
614 }
615 values[ihes++] = obj_factor*0.5*alpha_*dt_;
616
617 // constrainT
618 if (!p.phi_dydy_always_zero()) {
619 Index ig = (Nx_-1)*Nt_ + Nt_;
620 for (Index it=1; it<=Nt_; it++) {
621 values[ihes++] = lambda[ig++]*p.phi_dydy(x[y_index(Nx_,it)]);
622 }
623 }
624 }
625
626 DBG_ASSERT(ihes==nele_hess);
627
628 return true;
629 }
630
631 template <class T>
632 void MittelmannParaCntrlBase<T>::
633 finalize_solution(SolverReturn status,
634 Index n, const Number* x, const Number* z_L,
635 const Number* z_U,
636 Index m, const Number* g, const Number* lambda,
637 Number obj_value,
638 const IpoptData* ip_data,
639 IpoptCalculatedQuantities* ip_cq)
640 {}
641
642 class MittelmannParaCntrl5_1
643 {
644 public:
645 class ProblemSpecs
646 {
647 public:
648 ProblemSpecs ()
649 :
650 pi_(4.*atan(1.)),
651 exp13_(exp(1./3.)),
652 exp23_(exp(2./3.)),
653 exp1_(exp(1.)),
654 expm1_(exp(-1.)),
655 sqrt2_(sqrt(2.))
656 {}
657 Number T()
658 {
659 return 1.;
660 }
661 Number l()
662 {
663 return pi_/4.;
664 }
665 Number lb_y()
666 {
667 return -1e20;
668 }
669 Number ub_y()
670 {
671 return 1e20;
672 }
673 Number lb_u()
674 {
675 return 0.;
676 }
677 Number ub_u()
678 {
679 return 1.;
680 }
681 Number alpha()
682 {
683 return sqrt2_/2.*(exp23_-exp13_);
684 }
685 Number beta()
686 {
687 return 1.;
688 }
689 inline Number y_T(Number x)
690 {
691 return (exp1_ + expm1_)*cos(x);
692 }
693 inline Number a(Number x)
694 {
695 return cos(x);
696 }
697 inline Number a_y(Number t)
698 {
699 return -exp(-2.*t);
700 }
701 inline Number a_u(Number t)
702 {
703 return sqrt2_/2.*exp13_;
704 }
705 inline Number b(Number t)
706 {
707 return exp(-4.*t)/4.
708 - Min(1.,Max(0.,(exp(t)-exp13_)/(exp23_-exp13_)));
709 }
710 inline Number phi(Number y)
711 {
712 return y*pow(fabs(y),3);
713 }
714 inline Number phi_dy(Number y)
715 {
716 return 4.*pow(fabs(y),3);
717 }
718 inline Number phi_dydy(Number y)
719 {
720 return 12.*y*y;
721 }
722 inline bool phi_dydy_always_zero()
723 {
724 return false;
725 }
726 private:
727 const Number pi_;
728 const Number exp13_;
729 const Number exp23_;
730 const Number exp1_;
731 const Number expm1_;
732 const Number sqrt2_;
733 };
734 };
735
736 class MittelmannParaCntrl5_2_1
737 {
738 public:
739 class ProblemSpecs
740 {
741 public:
742 ProblemSpecs ()
743 {}
744 Number T()
745 {
746 return 1.58;
747 }
748 Number l()
749 {
750 return 1.;
751 }
752 Number lb_y()
753 {
754 return -1e20;
755 }
756 Number ub_y()
757 {
758 return 1e20;
759 }
760 Number lb_u()
761 {
762 return -1.;
763 }
764 Number ub_u()
765 {
766 return 1.;
767 }
768 Number alpha()
769 {
770 return 0.001;
771 }
772 Number beta()
773 {
774 return 1.;
775 }
776 inline Number y_T(Number x)
777 {
778 return .5*(1.-x*x);
779 }
780 inline Number a(Number x)
781 {
782 return 0.;
783 }
784 inline Number a_y(Number t)
785 {
786 return 0.;
787 }
788 inline Number a_u(Number t)
789 {
790 return 0.;
791 }
792 inline Number b(Number t)
793 {
794 return 0.;
795 }
796 inline Number phi(Number y)
797 {
798 return 0.;
799 }
800 inline Number phi_dy(Number y)
801 {
802 return 0.;
803 }
804 inline Number phi_dydy(Number y)
805 {
806 DBG_ASSERT(false);
807 return 0.;
808 }
809 inline bool phi_dydy_always_zero()
810 {
811 return true;
812 }
813 };
814 };
815
816 class MittelmannParaCntrl5_2_2
817 {
818 public:
819 class ProblemSpecs
820 {
821 public:
822 ProblemSpecs ()
823 {}
824 Number T()
825 {
826 return 1.58;
827 }
828 Number l()
829 {
830 return 1.;
831 }
832 Number lb_y()
833 {
834 return -1e20;
835 }
836 Number ub_y()
837 {
838 return 1e20;
839 }
840 Number lb_u()
841 {
842 return -1.;
843 }
844 Number ub_u()
845 {
846 return 1.;
847 }
848 Number alpha()
849 {
850 return 0.001;
851 }
852 Number beta()
853 {
854 return 0.;
855 }
856 inline Number y_T(Number x)
857 {
858 return .5*(1.-x*x);
859 }
860 inline Number a(Number x)
861 {
862 return 0.;
863 }
864 inline Number a_y(Number t)
865 {
866 return 0.;
867 }
868 inline Number a_u(Number t)
869 {
870 return 0.;
871 }
872 inline Number b(Number t)
873 {
874 return 0.;
875 }
876 inline Number phi(Number y)
877 {
878 return y*y;
879 }
880 inline Number phi_dy(Number y)
881 {
882 return 2.*y;
883 }
884 inline Number phi_dydy(Number y)
885 {
886 return 2.;
887 }
888 inline bool phi_dydy_always_zero()
889 {
890 return false;
891 }
892 };
893 };
894
895 class MittelmannParaCntrl5_2_3
896 {
897 public:
898 class ProblemSpecs
899 {
900 public:
901 ProblemSpecs ()
902 {}
903 Number T()
904 {
905 return 1.58;
906 }
907 Number l()
908 {
909 return 1.;
910 }
911 Number lb_y()
912 {
913 return 0.;
914 }
915 Number ub_y()
916 {
917 return 0.675;
918 }
919 Number lb_u()
920 {
921 return -1.;
922 }
923 Number ub_u()
924 {
925 return 1.;
926 }
927 Number alpha()
928 {
929 return 0.001;
930 }
931 Number beta()
932 {
933 return 0.;
934 }
935 inline Number y_T(Number x)
936 {
937 return .5*(1.-x*x);
938 }
939 inline Number a(Number x)
940 {
941 return 0.;
942 }
943 inline Number a_y(Number t)
944 {
945 return 0.;
946 }
947 inline Number a_u(Number t)
948 {
949 return 0.;
950 }
951 inline Number b(Number t)
952 {
953 return 0.;
954 }
955 inline Number phi(Number y)
956 {
957 return y*y;
958 }
959 inline Number phi_dy(Number y)
960 {
961 return 2.*y;
962 }
963 inline Number phi_dydy(Number y)
964 {
965 return 2.;
966 }
967 inline bool phi_dydy_always_zero()
968 {
969 return false;
970 }
971 };
972 };
973
974 class MittelmannParaCntrl5_try
975 {
976 public:
977 class ProblemSpecs
978 {
979 public:
980 ProblemSpecs ()
981 :
982 pi_(4.*atan(1.)),
983 exp13_(exp(1./3.)),
984 exp23_(exp(2./3.)),
985 exp1_(exp(1.)),
986 expm1_(exp(-1.)),
987 sqrt2_(sqrt(2.))
988 {}
989 Number T()
990 {
991 return 1.;
992 }
993 Number l()
994 {
995 return pi_/4.;
996 }
997 Number lb_y()
998 {
999 return -1e20;
1000 }
1001 Number ub_y()
1002 {
1003 return 1e20;
1004 }
1005 Number lb_u()
1006 {
1007 return 0.;
1008 }
1009 Number ub_u()
1010 {
1011 return 1.;
1012 }
1013 Number alpha()
1014 {
1015 return sqrt2_/2.*(exp23_-exp13_);
1016 }
1017 Number beta()
1018 {
1019 return 1.;
1020 }
1021 inline Number y_T(Number x)
1022 {
1023 return (exp1_ + expm1_)*cos(x);
1024 }
1025 inline Number a(Number x)
1026 {
1027 return cos(x);
1028 }
1029 inline Number a_y(Number t)
1030 {
1031 return -exp(-2.*t);
1032 }
1033 inline Number a_u(Number t)
1034 {
1035 return sqrt2_/2.*exp13_;
1036 }
1037 inline Number b(Number t)
1038 {
1039 return exp(-4.*t)/4.
1040 - Min(1.,Max(0.,(exp(t)-exp13_)/(exp23_-exp13_)));
1041 }
1042 inline Number phi(Number y)
1043 {
1044 return -y*sin(y/10.);
1045 }
1046 inline Number phi_dy(Number y)
1047 {
1048 return -y*cos(y/10.)/10. - sin(y/10.);
1049 }
1050 inline Number phi_dydy(Number y)
1051 {
1052 return y*sin(y/10.)/100.;
1053 }
1054 inline bool phi_dydy_always_zero()
1055 {
1056 return false;
1057 }
1058 private:
1059 const Number pi_;
1060 const Number exp13_;
1061 const Number exp23_;
1062 const Number exp1_;
1063 const Number expm1_;
1064 const Number sqrt2_;
1065 };
1066 };
1067
1068 #endif
MittelmannParaCntrlBase::get_bounds_info
virtual bool get_bounds_info(Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
Method to return the bounds for my problem.
Definition: MittelmannParaCntrl.hpp:269
MittelmannParaCntrl5_2_2::ProblemSpecs::alpha
Number alpha()
Definition: MittelmannParaCntrl.hpp:848
MittelmannParaCntrl5_2_3::ProblemSpecs::beta
Number beta()
Definition: MittelmannParaCntrl.hpp:931
MittelmannParaCntrl5_1::ProblemSpecs
Definition: MittelmannParaCntrl.hpp:645
MittelmannParaCntrl5_2_2::ProblemSpecs::y_T
Number y_T(Number x)
Definition: MittelmannParaCntrl.hpp:856
MittelmannParaCntrl5_2_3::ProblemSpecs::lb_y
Number lb_y()
Definition: MittelmannParaCntrl.hpp:911
MittelmannParaCntrlBase::lb_u_
Number lb_u_
overall lower bound on u
Definition: MittelmannParaCntrl.hpp:147
MittelmannParaCntrl5_try::ProblemSpecs::sqrt2_
const Number sqrt2_
Definition: MittelmannParaCntrl.hpp:1064
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
MittelmannParaCntrl5_2_1
Definition: MittelmannParaCntrl.hpp:736
MittelmannParaCntrl5_1::ProblemSpecs::T
Number T()
Definition: MittelmannParaCntrl.hpp:657
MittelmannParaCntrl5_2_2::ProblemSpecs::phi_dy
Number phi_dy(Number y)
Definition: MittelmannParaCntrl.hpp:880
MittelmannParaCntrl5_try::ProblemSpecs::alpha
Number alpha()
Definition: MittelmannParaCntrl.hpp:1013
MittelmannParaCntrl5_2_1::ProblemSpecs::a
Number a(Number x)
Definition: MittelmannParaCntrl.hpp:780
Ipopt::Max
Index Max(Index a, Index b)
Definition: IpUtils.hpp:19
Ipopt::IpoptCalculatedQuantities
Class for all IPOPT specific calculated quantities.
Definition: IpIpoptCalculatedQuantities.hpp:81
MittelmannParaCntrl5_2_3::ProblemSpecs
Definition: MittelmannParaCntrl.hpp:898
index_style
Number Number Index Number Number Index Index Index index_style
indexing style for iRow &amp; jCol, 0 for C style, 1 for Fortran style
Definition: IpStdCInterface.h:137
MittelmannParaCntrl5_2_2::ProblemSpecs::lb_y
Number lb_y()
Definition: MittelmannParaCntrl.hpp:832
MittelmannParaCntrl5_2_1::ProblemSpecs::T
Number T()
Definition: MittelmannParaCntrl.hpp:744
MittelmannParaCntrlBase::ub_u_
Number ub_u_
overall upper bound on u
Definition: MittelmannParaCntrl.hpp:149
MittelmannParaCntrl5_1::ProblemSpecs::lb_y
Number lb_y()
Definition: MittelmannParaCntrl.hpp:665
MittelmannParaCntrlBase::get_starting_point
virtual bool get_starting_point(Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda)
Method to return the starting point for the algorithm.
Definition: MittelmannParaCntrl.hpp:319
MittelmannParaCntrl5_2_3::ProblemSpecs::phi_dydy
Number phi_dydy(Number y)
Definition: MittelmannParaCntrl.hpp:963
MittelmannParaCntrl5_1::ProblemSpecs::exp23_
const Number exp23_
Definition: MittelmannParaCntrl.hpp:729
MittelmannParaCntrl5_try::ProblemSpecs::a_u
Number a_u(Number t)
Definition: MittelmannParaCntrl.hpp:1033
MittelmannParaCntrl5_try::ProblemSpecs::T
Number T()
Definition: MittelmannParaCntrl.hpp:989
m
Number Number Index m
Number of constraints.
Definition: IpStdCInterface.h:137
MittelmannParaCntrl5_1::ProblemSpecs::a
Number a(Number x)
Definition: MittelmannParaCntrl.hpp:693
MittelmannParaCntrlBase::a_u_
Number * a_u_
Array for weighting function a_u in objective.
Definition: MittelmannParaCntrl.hpp:160
MittelmannParaCntrl5_1::ProblemSpecs::a_u
Number a_u(Number t)
Definition: MittelmannParaCntrl.hpp:701
MittelmannParaCntrl5_2_1::ProblemSpecs::a_u
Number a_u(Number t)
Definition: MittelmannParaCntrl.hpp:788
MittelmannParaCntrl5_try::ProblemSpecs::a_y
Number a_y(Number t)
Definition: MittelmannParaCntrl.hpp:1029
MittelmannParaCntrlBase::y_T_
Number * y_T_
Array for the target profile for y in objective.
Definition: MittelmannParaCntrl.hpp:156
MittelmannParaCntrl5_2_1::ProblemSpecs::beta
Number beta()
Definition: MittelmannParaCntrl.hpp:772
MittelmannParaCntrl5_2_1::ProblemSpecs
Definition: MittelmannParaCntrl.hpp:739
MittelmannParaCntrlBase::a_y_
Number * a_y_
Array for weighting function a_y in objective.
Definition: MittelmannParaCntrl.hpp:158
MittelmannParaCntrlBase::x_grid
Number x_grid(Index j) const
Compute the grid coordinate for given index in x direction.
Definition: MittelmannParaCntrl.hpp:181
g
Number Number * g
Values of constraint at final point (output only - ignored if set to NULL)
Definition: IpStdCInterface.h:238
MittelmannParaCntrl5_2_2::ProblemSpecs::T
Number T()
Definition: MittelmannParaCntrl.hpp:824
eval_h
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.
Definition: IpStdCInterface.h:137
MittelmannParaCntrl5_try
Definition: MittelmannParaCntrl.hpp:974
MittelmannParaCntrl5_1::ProblemSpecs::phi_dydy
Number phi_dydy(Number y)
Definition: MittelmannParaCntrl.hpp:718
MittelmannParaCntrl5_2_2::ProblemSpecs::b
Number b(Number t)
Definition: MittelmannParaCntrl.hpp:872
MittelmannParaCntrl5_2_3::ProblemSpecs::b
Number b(Number t)
Definition: MittelmannParaCntrl.hpp:951
MittelmannParaCntrl5_1::ProblemSpecs::y_T
Number y_T(Number x)
Definition: MittelmannParaCntrl.hpp:689
MittelmannParaCntrl5_try::ProblemSpecs::exp1_
const Number exp1_
Definition: MittelmannParaCntrl.hpp:1062
MittelmannParaCntrlBase::eval_jac_g
virtual bool eval_jac_g(Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
Method to return: 1) The structure of the jacobian (if &quot;values&quot; is NULL) 2) The values of the jacobia...
Definition: MittelmannParaCntrl.hpp:470
MittelmannParaCntrl5_try::ProblemSpecs::y_T
Number y_T(Number x)
Definition: MittelmannParaCntrl.hpp:1021
Ipopt::Number
double Number
Type of all numbers.
Definition: IpTypes.hpp:17
MittelmannParaCntrl5_2_2::ProblemSpecs::ub_y
Number ub_y()
Definition: MittelmannParaCntrl.hpp:836
MittelmannParaCntrlBase::MittelmannParaCntrlBase
MittelmannParaCntrlBase()
Constructor.
Definition: MittelmannParaCntrl.hpp:189
MittelmannParaCntrl5_try::ProblemSpecs::phi_dy
Number phi_dy(Number y)
Definition: MittelmannParaCntrl.hpp:1046
MittelmannParaCntrl5_try::ProblemSpecs::a
Number a(Number x)
Definition: MittelmannParaCntrl.hpp:1025
MittelmannParaCntrl5_try::ProblemSpecs::lb_u
Number lb_u()
Definition: MittelmannParaCntrl.hpp:1005
MittelmannParaCntrl5_1::ProblemSpecs::ub_y
Number ub_y()
Definition: MittelmannParaCntrl.hpp:669
eval_grad_f
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.
Definition: IpStdCInterface.h:137
MittelmannParaCntrl5_2_3::ProblemSpecs::y_T
Number y_T(Number x)
Definition: MittelmannParaCntrl.hpp:935
MittelmannParaCntrl5_1::ProblemSpecs::beta
Number beta()
Definition: MittelmannParaCntrl.hpp:685
MittelmannParaCntrl5_1::ProblemSpecs::alpha
Number alpha()
Definition: MittelmannParaCntrl.hpp:681
MittelmannParaCntrlBase::eval_grad_f
virtual bool eval_grad_f(Index n, const Number *x, bool new_x, Number *grad_f)
Method to return the gradient of the objective.
Definition: MittelmannParaCntrl.hpp:399
MittelmannParaCntrl5_2_3::ProblemSpecs::ub_y
Number ub_y()
Definition: MittelmannParaCntrl.hpp:915
MittelmannParaCntrlBase::get_nlp_info
virtual bool get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style)
Method to return some info about the nlp.
Definition: MittelmannParaCntrl.hpp:246
MittelmannParaCntrl5_2_2::ProblemSpecs::l
Number l()
Definition: MittelmannParaCntrl.hpp:828
MittelmannParaCntrlBase::dx_
Number dx_
Step size in x direction.
Definition: MittelmannParaCntrl.hpp:141
MittelmannParaCntrlBase::Nx_
Index Nx_
Number of mesh points in x direction.
Definition: MittelmannParaCntrl.hpp:137
MittelmannParaCntrl5_try::ProblemSpecs::phi
Number phi(Number y)
Definition: MittelmannParaCntrl.hpp:1042
MittelmannParaCntrl5_try::ProblemSpecs
Definition: MittelmannParaCntrl.hpp:977
MittelmannParaCntrl5_1::ProblemSpecs::phi
Number phi(Number y)
Definition: MittelmannParaCntrl.hpp:710
MittelmannParaCntrl5_1::ProblemSpecs::phi_dydy_always_zero
bool phi_dydy_always_zero()
Definition: MittelmannParaCntrl.hpp:722
MittelmannParaCntrl5_2_3::ProblemSpecs::phi
Number phi(Number y)
Definition: MittelmannParaCntrl.hpp:955
MittelmannParaCntrl5_try::ProblemSpecs::lb_y
Number lb_y()
Definition: MittelmannParaCntrl.hpp:997
MittelmannParaCntrl5_try::ProblemSpecs::phi_dydy_always_zero
bool phi_dydy_always_zero()
Definition: MittelmannParaCntrl.hpp:1054
MittelmannParaCntrl5_2_2::ProblemSpecs::ProblemSpecs
ProblemSpecs()
Definition: MittelmannParaCntrl.hpp:822
MittelmannParaCntrl5_2_1::ProblemSpecs::phi_dydy_always_zero
bool phi_dydy_always_zero()
Definition: MittelmannParaCntrl.hpp:809
MittelmannParaCntrl5_2_2::ProblemSpecs::phi
Number phi(Number y)
Definition: MittelmannParaCntrl.hpp:876
MittelmannParaCntrl5_1
Definition: MittelmannParaCntrl.hpp:642
MittelmannParaCntrl5_1::ProblemSpecs::b
Number b(Number t)
Definition: MittelmannParaCntrl.hpp:705
MittelmannParaCntrl5_2_3::ProblemSpecs::a
Number a(Number x)
Definition: MittelmannParaCntrl.hpp:939
eval_jac_g
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.
Definition: IpStdCInterface.h:137
MittelmannParaCntrl5_2_1::ProblemSpecs::y_T
Number y_T(Number x)
Definition: MittelmannParaCntrl.hpp:776
Ipopt::SolverReturn
SolverReturn
enum for the return from the optimize algorithm (obviously we need to add more)
Definition: IpAlgTypes.hpp:22
MittelmannParaCntrl5_2_1::ProblemSpecs::phi_dy
Number phi_dy(Number y)
Definition: MittelmannParaCntrl.hpp:800
MittelmannParaCntrl5_2_1::ProblemSpecs::phi_dydy
Number phi_dydy(Number y)
Definition: MittelmannParaCntrl.hpp:804
RegisteredTNLP.hpp
nele_jac
Number Number Index Number Number Index nele_jac
Number of non-zero elements in constraint Jacobian.
Definition: IpStdCInterface.h:137
MittelmannParaCntrl5_2_1::ProblemSpecs::alpha
Number alpha()
Definition: MittelmannParaCntrl.hpp:768
MittelmannParaCntrlBase::u_index
Index u_index(Index it) const
Definition: MittelmannParaCntrl.hpp:171
MittelmannParaCntrl5_1::ProblemSpecs::ProblemSpecs
ProblemSpecs()
Definition: MittelmannParaCntrl.hpp:648
MittelmannParaCntrl5_2_2::ProblemSpecs::lb_u
Number lb_u()
Definition: MittelmannParaCntrl.hpp:840
MittelmannParaCntrl5_2_1::ProblemSpecs::lb_y
Number lb_y()
Definition: MittelmannParaCntrl.hpp:752
MittelmannParaCntrl5_try::ProblemSpecs::ub_u
Number ub_u()
Definition: MittelmannParaCntrl.hpp:1009
MittelmannParaCntrl5_try::ProblemSpecs::pi_
const Number pi_
Definition: MittelmannParaCntrl.hpp:1059
MittelmannParaCntrlBase::eval_h
virtual bool eval_h(Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values)
Method to return: 1) The structure of the hessian of the lagrangian (if &quot;values&quot; is NULL) 2) The valu...
Definition: MittelmannParaCntrl.hpp:572
Ipopt::Min
Index Min(Index a, Index b)
Definition: IpUtils.hpp:38
MittelmannParaCntrl5_2_2::ProblemSpecs::phi_dydy
Number phi_dydy(Number y)
Definition: MittelmannParaCntrl.hpp:884
MittelmannParaCntrl5_2_1::ProblemSpecs::ProblemSpecs
ProblemSpecs()
Definition: MittelmannParaCntrl.hpp:742
MittelmannParaCntrl5_1::ProblemSpecs::l
Number l()
Definition: MittelmannParaCntrl.hpp:661
Ipopt::IpoptData
Class to organize all the data required by the algorithm.
Definition: IpIpoptData.hpp:83
MittelmannParaCntrl5_2_1::ProblemSpecs::ub_y
Number ub_y()
Definition: MittelmannParaCntrl.hpp:756
MittelmannParaCntrl5_try::ProblemSpecs::exp13_
const Number exp13_
Definition: MittelmannParaCntrl.hpp:1060
eval_g
Number Number Index Number Number Index Index Index Eval_F_CB Eval_G_CB eval_g
Callback function for evaluating constraint functions.
Definition: IpStdCInterface.h:137
MittelmannParaCntrl5_1::ProblemSpecs::sqrt2_
const Number sqrt2_
Definition: MittelmannParaCntrl.hpp:732
MittelmannParaCntrl5_2_1::ProblemSpecs::l
Number l()
Definition: MittelmannParaCntrl.hpp:748
MittelmannParaCntrl5_2_3::ProblemSpecs::phi_dy
Number phi_dy(Number y)
Definition: MittelmannParaCntrl.hpp:959
Ipopt::Index
int Index
Type of all indices of vectors, matrices etc.
Definition: IpTypes.hpp:19
MittelmannParaCntrl5_2_1::ProblemSpecs::lb_u
Number lb_u()
Definition: MittelmannParaCntrl.hpp:760
MittelmannParaCntrlBase::y_index
Index y_index(Index jx, Index it) const
Translation of mesh point indices to NLP variable indices for y(x_ij)
Definition: MittelmannParaCntrl.hpp:167
MittelmannParaCntrl5_2_3::ProblemSpecs::lb_u
Number lb_u()
Definition: MittelmannParaCntrl.hpp:919
MittelmannParaCntrl5_2_1::ProblemSpecs::a_y
Number a_y(Number t)
Definition: MittelmannParaCntrl.hpp:784
MittelmannParaCntrlBase::get_scaling_parameters
virtual bool get_scaling_parameters(Number &obj_scaling, bool &use_x_scaling, Index n, Number *x_scaling, bool &use_g_scaling, Index m, Number *g_scaling)
Method for returning scaling parameters.
Definition: MittelmannParaCntrl.hpp:349
MittelmannParaCntrl5_2_2::ProblemSpecs::beta
Number beta()
Definition: MittelmannParaCntrl.hpp:852
MittelmannParaCntrlBase::finalize_solution
virtual void finalize_solution(SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)
This method is called after the optimization, and could write an output file with the optimal profile...
Definition: MittelmannParaCntrl.hpp:633
DBG_ASSERT
#define DBG_ASSERT(test)
Definition: IpDebug.hpp:38
MittelmannParaCntrlBase::~MittelmannParaCntrlBase
virtual ~MittelmannParaCntrlBase()
Default destructor.
Definition: MittelmannParaCntrl.hpp:197
MittelmannParaCntrl5_2_3::ProblemSpecs::ub_u
Number ub_u()
Definition: MittelmannParaCntrl.hpp:923
x_scaling
Number Number * x_scaling
Definition: IpStdCInterface.h:210
MittelmannParaCntrl5_1::ProblemSpecs::lb_u
Number lb_u()
Definition: MittelmannParaCntrl.hpp:673
MittelmannParaCntrl5_2_2::ProblemSpecs::phi_dydy_always_zero
bool phi_dydy_always_zero()
Definition: MittelmannParaCntrl.hpp:888
MittelmannParaCntrl5_2_3::ProblemSpecs::phi_dydy_always_zero
bool phi_dydy_always_zero()
Definition: MittelmannParaCntrl.hpp:967
MittelmannParaCntrl5_try::ProblemSpecs::phi_dydy
Number phi_dydy(Number y)
Definition: MittelmannParaCntrl.hpp:1050
MittelmannParaCntrl5_try::ProblemSpecs::ub_y
Number ub_y()
Definition: MittelmannParaCntrl.hpp:1001
nele_hess
Number Number Index Number Number Index Index nele_hess
Number of non-zero elements in Hessian of Lagrangian.
Definition: IpStdCInterface.h:137
RegisteredTNLP
Class implemented the NLP discretization of.
Definition: RegisteredTNLP.hpp:20
MittelmannParaCntrl5_2_3::ProblemSpecs::alpha
Number alpha()
Definition: MittelmannParaCntrl.hpp:927
MittelmannParaCntrl5_try::ProblemSpecs::l
Number l()
Definition: MittelmannParaCntrl.hpp:993
MittelmannParaCntrl5_2_3
Definition: MittelmannParaCntrl.hpp:895
MittelmannParaCntrl5_2_1::ProblemSpecs::b
Number b(Number t)
Definition: MittelmannParaCntrl.hpp:792
MittelmannParaCntrlBase::t_grid
Number t_grid(Index i) const
Compute the grid coordinate for given index in t direction.
Definition: MittelmannParaCntrl.hpp:176
MittelmannParaCntrlBase::l_
Number l_
Upper bound on x.
Definition: MittelmannParaCntrl.hpp:133
MittelmannParaCntrl5_2_3::ProblemSpecs::ProblemSpecs
ProblemSpecs()
Definition: MittelmannParaCntrl.hpp:901
MittelmannParaCntrl5_2_2::ProblemSpecs
Definition: MittelmannParaCntrl.hpp:819
g_scaling
Number Number Number * g_scaling
Definition: IpStdCInterface.h:210
MittelmannParaCntrl5_2_1::ProblemSpecs::ub_u
Number ub_u()
Definition: MittelmannParaCntrl.hpp:764
MittelmannParaCntrlBase::beta_
Number beta_
Weighting parameter in PDE.
Definition: MittelmannParaCntrl.hpp:154
MittelmannParaCntrl5_1::ProblemSpecs::pi_
const Number pi_
Definition: MittelmannParaCntrl.hpp:727
MittelmannParaCntrl5_2_2
Definition: MittelmannParaCntrl.hpp:816
MittelmannParaCntrl5_2_3::ProblemSpecs::l
Number l()
Definition: MittelmannParaCntrl.hpp:907
MittelmannParaCntrl5_try::ProblemSpecs::exp23_
const Number exp23_
Definition: MittelmannParaCntrl.hpp:1061
Ipopt::TNLP::IndexStyleEnum
IndexStyleEnum
overload this method to return the number of variables and constraints, and the number of non-zeros i...
Definition: IpTNLP.hpp:80
MittelmannParaCntrlBase::InitializeProblem
virtual bool InitializeProblem(Index N)
Initialize internal parameters, where N is a parameter determining the problme size.
Definition: MittelmannParaCntrl.hpp:206
MittelmannParaCntrl5_1::ProblemSpecs::phi_dy
Number phi_dy(Number y)
Definition: MittelmannParaCntrl.hpp:714
MittelmannParaCntrl5_2_1::ProblemSpecs::phi
Number phi(Number y)
Definition: MittelmannParaCntrl.hpp:796
MittelmannParaCntrl5_2_3::ProblemSpecs::a_y
Number a_y(Number t)
Definition: MittelmannParaCntrl.hpp:943
MittelmannParaCntrlBase::ub_y_
Number ub_y_
overall upper bound on y
Definition: MittelmannParaCntrl.hpp:145
MittelmannParaCntrl5_1::ProblemSpecs::expm1_
const Number expm1_
Definition: MittelmannParaCntrl.hpp:731
MittelmannParaCntrl5_2_2::ProblemSpecs::a_u
Number a_u(Number t)
Definition: MittelmannParaCntrl.hpp:868
MittelmannParaCntrl5_2_3::ProblemSpecs::a_u
Number a_u(Number t)
Definition: MittelmannParaCntrl.hpp:947
MittelmannParaCntrl5_2_2::ProblemSpecs::a
Number a(Number x)
Definition: MittelmannParaCntrl.hpp:860
MittelmannParaCntrlBase
Base class for parabolic and elliptic control problems, as formulated by Hans Mittelmann as problem (...
Definition: MittelmannParaCntrl.hpp:38
MittelmannParaCntrlBase::T_
Number T_
Upper bound on t.
Definition: MittelmannParaCntrl.hpp:131
MittelmannParaCntrl5_1::ProblemSpecs::a_y
Number a_y(Number t)
Definition: MittelmannParaCntrl.hpp:697
MittelmannParaCntrlBase::alpha_
Number alpha_
Weighting parameter for the control target deviation functional in the objective. ...
Definition: MittelmannParaCntrl.hpp:152
MittelmannParaCntrlBase::eval_g
virtual bool eval_g(Index n, const Number *x, bool new_x, Index m, Number *g)
Method to return the constraint residuals.
Definition: MittelmannParaCntrl.hpp:432
MittelmannParaCntrl5_try::ProblemSpecs::expm1_
const Number expm1_
Definition: MittelmannParaCntrl.hpp:1063
MittelmannParaCntrl5_try::ProblemSpecs::ProblemSpecs
ProblemSpecs()
Definition: MittelmannParaCntrl.hpp:980
MittelmannParaCntrl5_try::ProblemSpecs::b
Number b(Number t)
Definition: MittelmannParaCntrl.hpp:1037
MittelmannParaCntrl5_1::ProblemSpecs::exp13_
const Number exp13_
Definition: MittelmannParaCntrl.hpp:728
MittelmannParaCntrlBase::eval_f
virtual bool eval_f(Index n, const Number *x, bool new_x, Number &obj_value)
Method to return the objective value.
Definition: MittelmannParaCntrl.hpp:363
MittelmannParaCntrl5_try::ProblemSpecs::beta
Number beta()
Definition: MittelmannParaCntrl.hpp:1017
MittelmannParaCntrlBase::Nt_
Index Nt_
Number of mesh points in t direction.
Definition: MittelmannParaCntrl.hpp:135
obj_scaling
Number obj_scaling
Definition: IpStdCInterface.h:210
eval_f
Number Number Index Number Number Index Index Index Eval_F_CB eval_f
Callback function for evaluating objective function.
Definition: IpStdCInterface.h:137
MittelmannParaCntrlBase::dt_
Number dt_
Step size in t direction.
Definition: MittelmannParaCntrl.hpp:139
MittelmannParaCntrl5_2_2::ProblemSpecs::ub_u
Number ub_u()
Definition: MittelmannParaCntrl.hpp:844
MittelmannParaCntrl5_1::ProblemSpecs::exp1_
const Number exp1_
Definition: MittelmannParaCntrl.hpp:730
MittelmannParaCntrl5_2_3::ProblemSpecs::T
Number T()
Definition: MittelmannParaCntrl.hpp:903
MittelmannParaCntrl5_2_2::ProblemSpecs::a_y
Number a_y(Number t)
Definition: MittelmannParaCntrl.hpp:864
MittelmannParaCntrl5_1::ProblemSpecs::ub_u
Number ub_u()
Definition: MittelmannParaCntrl.hpp:677
MittelmannParaCntrlBase::lb_y_
Number lb_y_
overall lower bound on y
Definition: MittelmannParaCntrl.hpp:143