CONOPT
Loading...
Searching...
No Matches
pindyck.f90
Go to the documentation of this file.
1!> @file pindyck.f90
2!! @ingroup FORT1THREAD_EXAMPLES
3!!
4!!
5!! This is a CONOPT implementation of the Pindyck model from the
6!! GAMS model library. The GAMS model follows as documentation:
7!!
8!! @verbatim
9!! $Ontext
10!!
11!! This model finds the optimal pricing and extraction of oil for
12!! the opec cartel.
13!!
14!! Reference: Pindyck R S, Gains to Producers from the
15!! Cartelization of Exhaustible Resources, Review of
16!! Economics and Statistics, Volume 60, pp 238-251, 1978.
17!!
18!! $Offtext
19!!
20!! Sets t overall time horizon / 1974*1990 /
21!! to(t) optimization period / 1975*1990 /
22!!
23!! Parameter demand(t) equilibrium world demand for fixed prices;
24!! demand(to) = 1. + 2.3*1.015**(ord(to)-1);
25!!
26!! Variables p(t) world price of oil
27!! td(t) total demand for oil
28!! s(t) supply of oil by non-opec contries
29!! cs(t) cummulative supply by non-opec contries
30!! d(t) demand for opec-oil
31!! r(t) opec reserves
32!! rev(t) revenues in each period
33!! profit
34!!
35!! Positive Variables p,td,s,cs,d,r
36!!
37!! Equations tdeq(t) total demand equation
38!! seq(t) supply equation for non-opec contries
39!! cseq(t) accounting equation for cummulative supply
40!! deq(t) demand equation for opec
41!! req(t) accounting equation for opec reserves
42!! drev(t) yearly objective function value
43!! tprofit total objective function;
44!!
45!! $Double
46!!
47!! tdeq(t-1).. td(t) =e= 0.87*td(t-1) - 0.13*p(t) + demand(t);
48!! seq(t-1).. s(t) =e= 0.75*s(t-1) + (1.1+0.1*p(t))*1.02**(-cs(t)/7);
49!! cseq(t-1).. cs(t) =e= cs(t-1) + s(t);
50!! deq(to).. d(to) =e= td(to) - s(to);
51!! req(t-1).. r(t) =e= r(t-1) - d(t);
52!! drev(to).. rev(to) =e= d(to)*(p(to)-250/r(to));
53!! tprofit.. profit =e= sum(to,rev(to)*1.05**(1-ord(to)));
54!!
55!! $Single
56!!
57!! *
58!! * fixed initial conditions
59!! *
60!! td.fx('1974') = 18; s.fx ('1974') = 6.5;
61!! r.fx ('1974') = 500; cs.fx('1974') = 0.0;
62!!
63!! td.l(to) = 18; s.l(to)= 7; cs.l(to) = 7*ord(to);
64!! d.l (to) = td.l(to)-s.l(to); p.l(to) = 14;
65!!
66!! Loop(t$to(t), r.l(t) = r.l(t-1)-d.l(t) );
67!!
68!! Display td.l, s.l, cs.l, d.l, r.l;
69!!
70!! Model robert / all /; Solve robert maximizing profit using nlp;
71!! @endverbatim
72!!
73!!
74!!
75!! For more information about the individual callbacks, please have a look at the source code.
76
77
78!> Main program. A simple setup and call of CONOPT
79!!
80Program pindyck
81 Use proginfo
82 Use coidef
83 Use data_t
84 Implicit none
85!
86! Declare the user callback routines as Integer, External:
87!
88 Integer, External :: pin_readmatrix ! Mandatory Matrix definition routine defined below
89 Integer, External :: pin_fdeval ! Function and Derivative evaluation routine
90 ! needed a nonlinear model.
91 Integer, External :: std_status ! Standard callback for displaying solution status
92 Integer, External :: pin_solution ! Specialized callback for displaying solution values
93 Integer, External :: std_message ! Standard callback for managing messages
94 Integer, External :: std_errmsg ! Standard callback for managing error messages
95#if defined(itl)
96!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_ReadMatrix
97!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_FDEval
98!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Status
99!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_Solution
100!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Message
101!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_ErrMsg
102#endif
103!
104! Control vector
105!
106 INTEGER :: numcallback
107 INTEGER, Dimension(:), Pointer :: cntvect
108 INTEGER :: coi_error
109!
110! Other variables
111!
112 INTEGER :: major, minor, patch
113
114 call startup
115!
116! Create and initialize a Control Vector
117!
118 numcallback = coidef_size()
119 Allocate( cntvect(numcallback) )
120 coi_error = coidef_inifort( cntvect )
121
122! Write which version of CONOPT we are using.
123
124 call coiget_version( major, minor, patch )
125 write(*,"('Solving Pindyck Model using CONOPT version ',i2,'.',i2,'.',i2)") major, minor, patch
126!
127! Define the number of time periods, T.
128!
129 t = 16
130!
131! Tell CONOPT about the size of the model by populating the Control Vector:
132!
133! Number of variables (excl. slacks): 7 per period
134!
135 coi_error = max( coi_error, coidef_numvar( cntvect, 7 * t ) )
136!
137! Number of equations: 1 objective + 6 per period
138!
139 coi_error = max( coi_error, coidef_numcon( cntvect, 1 + 6 * t ) )
140!
141! Number of nonzeros in the Jacobian. See the counting in ReadMatrix below:
142! For each period there is 1 in the objective, 16 for unlagged
143! variables and 4 for lagged variables.
144!
145 coi_error = max( coi_error, coidef_numnz( cntvect, 17 * t + 4 * (t-1) ) )
146!
147! Number of nonlinear nonzeros. 5 unlagged for each period.
148!
149 coi_error = max( coi_error, coidef_numnlnz( cntvect, 5 * t ) )
150!
151! Direction: +1 = maximization.
152!
153 coi_error = max( coi_error, coidef_optdir( cntvect, 1 ) )
154!
155! Objective: Constraint no 1
156!
157 coi_error = max( coi_error, coidef_objcon( cntvect, 1 ) )
158!
159! Define an options file
160!
161 coi_error = max( coi_error, coidef_optfile( cntvect, 'pindyck.opt' ) )
162!
163! Tell CONOPT about the callback routines:
164!
165 coi_error = max( coi_error, coidef_readmatrix( cntvect, pin_readmatrix ) )
166 coi_error = max( coi_error, coidef_fdeval( cntvect, pin_fdeval ) )
167 coi_error = max( coi_error, coidef_status( cntvect, std_status ) )
168 coi_error = max( coi_error, coidef_solution( cntvect, pin_solution ) )
169 coi_error = max( coi_error, coidef_message( cntvect, std_message ) )
170 coi_error = max( coi_error, coidef_errmsg( cntvect, std_errmsg ) )
171
172#if defined(LICENSE_INT_1) && defined(LICENSE_INT_2) && defined(LICENSE_INT_3) && defined(LICENSE_TEXT)
173 coi_error = max( coi_error, coidef_license( cntvect, license_int_1, license_int_2, license_int_3, license_text) )
174#endif
175
176 If ( coi_error .ne. 0 ) THEN
177 write(*,*)
178 write(*,*) '**** Fatal Error while loading CONOPT Callback routines.'
179 write(*,*)
180 call flog( "Skipping Solve due to setup errors", 1 )
181 ENDIF
182!
183! Save the solution so we can check the duals:
184!
185 do_allocate = .true.
186!
187! Start CONOPT:
188!
189 coi_error = coi_solve( cntvect )
190
191 write(*,*)
192 write(*,*) 'End of Pindyck Model. Return code=',coi_error
193
194 If ( coi_error /= 0 ) then
195 call flog( "Errors encountered during solution", 1 )
196 elseif ( stacalls == 0 .or. solcalls == 0 ) then
197 call flog( "Status or Solution routine was not called", 1 )
198 elseif ( sstat /= 1 .or. mstat /= 2 ) then
199 call flog( "Solver and Model Status was not as expected (1,2)", 1 )
200 elseif ( abs( obj-1170.4863d0 ) > 0.0001d0 ) then
201 call flog( "Incorrect objective returned", 1 )
202 Else
203 Call checkdual( 'Pindyck', maximize )
204 endif
205
206 if ( coi_free(cntvect) /= 0 ) call flog( "Error while freeing control vector",1)
207
208 call flog( "Successful Solve", 0 )
209
210end Program pindyck
211!
212! =====================================================================
213! Define information about the model structure
214!
215
216!> Define information about the model
217!!
218!! @include{doc} readMatrix_params.dox
219Integer Function pin_readmatrix( lower, curr, upper, vsta, type, rhs, esta, &
220 colsta, rowno, value, nlflag, n, m, nz, usrmem )
221#if defined(itl)
222!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_ReadMatrix
223#endif
224 Use data_t
225 implicit none
226 integer, intent (in) :: n ! number of variables
227 integer, intent (in) :: m ! number of constraints
228 integer, intent (in) :: nz ! number of nonzeros
229 real*8, intent (in out), dimension(n) :: lower ! vector of lower bounds
230 real*8, intent (in out), dimension(n) :: curr ! vector of initial values
231 real*8, intent (in out), dimension(n) :: upper ! vector of upper bounds
232 integer, intent (in out), dimension(n) :: vsta ! vector of initial variable status
233 ! (not defined here)
234 integer, intent (out), dimension(m) :: type ! vector of equation types
235 integer, intent (in out), dimension(m) :: esta ! vector of initial equation status
236 ! (not defined here)
237 real*8, intent (in out), dimension(m) :: rhs ! vector of right hand sides
238 integer, intent (in out), dimension(n+1) :: colsta ! vector with start of column indices
239 integer, intent (out), dimension(nz) :: rowno ! vector of row numbers
240 integer, intent (in out), dimension(nz) :: nlflag ! vector of nonlinearity flags
241 real*8, intent (in out), dimension(nz) :: value ! vector of matrix values
242 real*8 usrmem(*) ! optional user memory
243
244 Integer :: it, is, i, icol, iz
245!
246! Define the information for the columns.
247!
248! We should not supply status information, vsta.
249!
250! We order the variables as follows:
251! td, cs, s, d, r, p, and rev. All variables for period 1 appears
252! first followed by all variables for period 2 etc.
253!
254! td, cs, s, and d have lower bounds of 0, r and p have lower
255! bounds of 1, and rev has no lower bound.
256! All have infinite upper bounds (default).
257! The initial value of td is 18, s is 7, cs is 7*t, d is td-s,
258! p is 14, and r is r(t-1)-d. No initial value for rev.
259!
260 do it = 1, t
261 is = 7*(it-1)
262 lower(is+1) = 0.d0
263 lower(is+2) = 0.d0
264 lower(is+3) = 0.d0
265 lower(is+4) = 0.d0
266 lower(is+5) = 1.d0
267 lower(is+6) = 1.d0
268 curr(is+1) = 18.d0
269 curr(is+2) = 7.d0*it
270 curr(is+3) = 7.d0
271 curr(is+4) = curr(is+1) - curr(is+3)
272 if ( it .gt. 1 ) then
273 curr(is+5) = curr(is+5-7) - curr(is+4)
274 else
275 curr(is+5) = 500.d0 - curr(is+4)
276 endif
277 curr(is+6) = 14.d0
278 enddo
279!
280! Define the information for the rows
281!
282! We order the constraints as follows: The objective is first,
283! followed by tddef, sdef, csdef, ddef, rdef, and revdef for
284! the first period, the same for the second period, etc.
285!
286! The objective is a nonbinding constraint:
287!
288 type(1) = 3
289!
290! All others are equalities:
291!
292 do i = 2, m
293 type(i) = 0
294 enddo
295!
296! Right hand sides: In all periods except the first, only tddef
297! has a nonzero right hand side of 1+2.3*1.015**(t-1).
298! In the initial period there are contributions from lagged
299! variables in the constraints that have lagged variables.
300!
301 do it = 1, t
302 is = 1 + 6*(it-1)
303 rhs(is+1) = 1.d0+2.3d0*1.015d0**(it-1)
304 enddo
305!
306! tddef: + 0.87*td(0)
307!
308 rhs(2) = rhs(2) + 0.87d0*18.d0
309!
310! sdef: +0.75*s(0)
311!
312 rhs(3) = 0.75d0*6.5d0
313!
314! csdef: +1*cs(0)
315!
316 rhs(4) = 0.d0
317!
318! rdef: +1*r(0)
319!
320 rhs(6) = 500.d0
321!
322! Define the structure and content of the Jacobian:
323! To help define the Jacobian pattern and values it can be useful to
324! make a picture of the Jacobian. We describe the variables for one
325! period and the constraints they are part of:
326!
327! td cs s d r p rev
328! Obj (1+r)**(1-t)
329! Period t:
330! tddef 1.0 0.13
331! sdef NL 1.0 NL
332! csdef 1.0 -1.0
333! ddef -1.0 1.0 1.0
334! rdef 1.0 1.0
335! revdef NL NL NL 1.0
336! Period t+1:
337! tddef -0.87
338! sdef -0.75
339! csdef -1.0
340! ddef
341! rdef -1.0
342! revdef
343!
344! The Jacobian has to be sorted column-wise so we will just define
345! the elements column by column according to the table above:
346!
347 iz = 1
348 icol = 1
349 do it = 1, t
350!
351! is points to the position before the first equation for the period
352!
353 is = 1 + 6*(it-1)
354!
355! Column td:
356!
357 colsta(icol) = iz
358 icol = icol + 1
359 rowno(iz) = is+1
360 value(iz) = +1.d0
361 nlflag(iz) = 0
362 iz = iz + 1
363 rowno(iz) = is+4
364 value(iz) = -1.d0
365 nlflag(iz) = 0
366 iz = iz + 1
367 if ( it .lt. t ) then
368 rowno(iz) = is+7
369 value(iz) = -0.87d0
370 nlflag(iz) = 0
371 iz = iz + 1
372 endif
373!
374! Column cs
375!
376 colsta(icol) = iz
377 icol = icol + 1
378 rowno(iz) = is+2
379 nlflag(iz) = 1
380 iz = iz + 1
381 rowno(iz) = is+3
382 value(iz) = +1.d0
383 nlflag(iz) = 0
384 iz = iz + 1
385 if ( it .lt. t ) then
386 rowno(iz) = is+9
387 value(iz) = -1.d0
388 nlflag(iz) = 0
389 iz = iz + 1
390 endif
391!
392! Column s
393!
394 colsta(icol) = iz
395 icol = icol + 1
396 rowno(iz) = is+2
397 value(iz) = +1.d0
398 nlflag(iz) = 0
399 iz = iz + 1
400 rowno(iz) = is+3
401 value(iz) = -1.d0
402 nlflag(iz) = 0
403 iz = iz + 1
404 rowno(iz) = is+4
405 value(iz) = +1.d0
406 nlflag(iz) = 0
407 iz = iz + 1
408 if ( it .lt. t ) then
409 rowno(iz) = is+8
410 value(iz) = -0.75d0
411 nlflag(iz) = 0
412 iz = iz + 1
413 endif
414!
415! Column d:
416!
417 colsta(icol) = iz
418 icol = icol + 1
419 rowno(iz) = is+4
420 value(iz) = +1.d0
421 nlflag(iz) = 0
422 iz = iz + 1
423 rowno(iz) = is+5
424 value(iz) = +1.d0
425 nlflag(iz) = 0
426 iz = iz + 1
427 rowno(iz) = is+6
428 nlflag(iz) = 1
429 iz = iz + 1
430!
431! Column r:
432!
433 colsta(icol) = iz
434 icol = icol + 1
435 rowno(iz) = is+5
436 value(iz) = +1.d0
437 nlflag(iz) = 0
438 iz = iz + 1
439 rowno(iz) = is+6
440 nlflag(iz) = 1
441 iz = iz + 1
442 if ( it .lt. t ) then
443 rowno(iz) = is+11
444 value(iz) = -1.d0
445 nlflag(iz) = 0
446 iz = iz + 1
447 endif
448!
449! Column p:
450!
451 colsta(icol) = iz
452 icol = icol + 1
453 rowno(iz) = is+1
454 value(iz) = +0.13d0
455 nlflag(iz) = 0
456 iz = iz + 1
457 rowno(iz) = is+2
458 nlflag(iz) = 1
459 iz = iz + 1
460 rowno(iz) = is+6
461 nlflag(iz) = 1
462 iz = iz + 1
463!
464! Column rev:
465!
466 colsta(icol) = iz
467 icol = icol + 1
468 rowno(iz) = +1
469 value(iz) = 1.05d0**(1-it)
470 nlflag(iz) = 0
471 iz = iz + 1
472 rowno(iz) = is+6
473 value(iz) = 1.d0
474 nlflag(iz) = 0
475 iz = iz + 1
476 enddo
477 colsta(icol) = iz
478
480
481end Function pin_readmatrix
482!
483! =====================================================================
484! Compute nonlinear terms and non-constant Jacobian elements
485!
486
487!> Compute nonlinear terms and non-constant Jacobian elements
488!!
489!! @include{doc} fdeval_params.dox
490Integer Function pin_fdeval( x, g, jac, rowno, jcnm, mode, ignerr, errcnt, &
491 n, nz, thread, usrmem )
492#if defined(itl)
493!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_FDEval
494#endif
495 Use data_t
496 implicit none
497 integer, intent (in) :: n ! number of variables
498 integer, intent (in) :: rowno ! number of the row to be evaluated
499 integer, intent (in) :: nz ! number of nonzeros in this row
500 real*8, intent (in), dimension(n) :: x ! vector of current solution values
501 real*8, intent (in out) :: g ! constraint value
502 real*8, intent (in out), dimension(n) :: jac ! vector of derivatives for current constraint
503 integer, intent (in), dimension(nz) :: jcnm ! list of variables that appear nonlinearly
504 ! in this row. Ffor information only.
505 integer, intent (in) :: mode ! evaluation mode: 1 = function value
506 ! 2 = derivatives, 3 = both
507 integer, intent (in) :: ignerr ! if 1 then errors can be ignored as long
508 ! as errcnt is incremented
509 integer, intent (in out) :: errcnt ! error counter to be incremented in case
510 ! of function evaluation errors.
511 integer, intent (in) :: thread
512 real*8 usrmem(*) ! optional user memory
513
514 integer it, is
515 real*8 h1, h2
516!
517! Compute the number of the period
518!
519 pin_fdeval = 0
520 it = (rowno+4) / 6
521 is = 7*(it-1)
522 if ( rowno == (it-1)*6+3 ) then
523!
524! sdef equation. Nonlinear term = -(1.1+0.1*p)*1.02**(-cs/7)
525!
526 h1 = (1.1d0+0.1d0*x(is+6))
527 h2 = 1.02d0**(-x(is+2)/7.d0)
528 if ( mode == 1 .or. mode == 3 ) then
529 g = -h1*h2
530 endif
531 if ( mode == 2 .or. mode == 3 ) then
532 jac(is+2) = h1*h2*log(1.02d0)/7.d0
533 jac(is+6) = -h2*0.1d0
534 endif
535 elseif ( rowno == (it-1)*6+7 ) then
536!
537! revdef equation. Nonlinear term = -d*(p-250/r)
538!
539 if ( mode == 1 .or. mode == 3 ) then
540 g = -x(is+4)*(x(is+6)-250.d0/x(is+5))
541 endif
542 if ( mode == 2 .or. mode == 3 ) then
543 jac(is+4) = -(x(is+6)-250.d0/x(is+5))
544 jac(is+5) = -x(is+4)*250d0/x(is+5)**2
545 jac(is+6) = -x(is+4)
546 endif
547 else
548!
549! Error - this equation is not nonlinear
550!
551 write(*,*)
552 write(*,*) 'Error. FDEval called with rowno=',rowno
553 write(*,*)
554 pin_fdeval = 1
555 endif
556
557end Function pin_fdeval
558
559Integer Function pin_solution( XVAL, XMAR, XBAS, XSTA, YVAL, YMAR, YBAS, YSTA, N, M, USRMEM )
560#if defined(itl)
561!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_Solution
562#endif
563!
564! Specialized solution callback routine with names for variables and constraints
565!
566 Use proginfo
567 Use data_t
568 IMPLICIT NONE
569 INTEGER, Intent(IN) :: n, m
570 INTEGER, Intent(IN), Dimension(N) :: xbas, xsta
571 INTEGER, Intent(IN), Dimension(M) :: ybas, ysta
572 real*8, Intent(IN), Dimension(N) :: xval, xmar
573 real*8, Intent(IN), Dimension(M) :: yval, ymar
574 real*8, Intent(IN OUT) :: usrmem(*)
575 character*6, parameter, dimension(7) :: vname = (/'td ','cs ','s ','d ','r ','p ','rev '/)
576 character*6, parameter, dimension(6) :: ename = (/'tddef ','sdef ','csdef ','ddef ','rdef ','revdef'/)
577
578 INTEGER :: i, it, i1
579 CHARACTER*5, Parameter, Dimension(4) :: stat = (/ 'Lower','Upper','Basic','Super' /)
580
581 WRITE(10,"(/' Variable Solution value Reduced cost B-stat'/)")
582 i = 0
583 do it = 1, t
584 DO i1 = 1, 7
585 i = i + 1
586 WRITE(10,"(1X,A6,i2,1p,E20.6,E16.6,4X,A5 )") vname(i1), it, xval(i), xmar(i), stat(1+xbas(i))
587 ENDDO
588 enddo
589
590 WRITE(10,"(/' Constrnt Activity level Marginal cost B-stat'/)")
591 i = 1
592 WRITE(10,"(1x,'Objective',1P,E19.6,E16.6,4X,A5 )") yval(i), ymar(i), stat(1+ybas(i))
593 do it = 1, t
594 do i1 = 1, 6
595 i = i + 1
596 WRITE(10,"(1x,A6,i2,1P,E20.6,E16.6,4X,A5 )") ename(i1),it, yval(i), ymar(i), stat(1+ybas(i))
597 enddo
598 ENDDO
599
600 solcalls = solcalls + 1
601 pin_solution = 0
602
603END Function pin_solution
integer function std_status(modsta, solsta, iter, objval, usrmem)
Definition comdecl.f90:82
subroutine checkdual(case, minmax)
Definition comdecl.f90:365
integer function std_message(smsg, dmsg, nmsg, llen, usrmem, msgv)
Definition comdecl.f90:203
integer function std_errmsg(rowno, colno, posno, msglen, usrmem, msg)
Definition comdecl.f90:248
integer function pin_fdeval(x, g, jac, rowno, jcnm, mode, ignerr, errcnt, n, nz, thread, usrmem)
Compute nonlinear terms and non-constant Jacobian elements.
Definition fvboth.f90:436
integer function pin_readmatrix(lower, curr, upper, vsta, type, rhs, esta, colsta, rowno, value, nlflag, n, m, nz, usrmem)
Define information about the model.
Definition fvboth.f90:165
integer function pin_solution(xval, xmar, xbas, xsta, yval, ymar, ybas, ysta, n, m, usrmem)
Definition fvboth.f90:545
integer function coidef_fdeval(cntvect, coi_fdeval)
define callback routine for performing function and derivative evaluations.
integer function coidef_errmsg(cntvect, coi_errmsg)
define callback routine for returning error messages for row, column or Jacobian elements.
integer function coidef_message(cntvect, coi_message)
define callback routine for handling messages returned during the solution process.
integer function coidef_readmatrix(cntvect, coi_readmatrix)
define callback routine for providing the matrix data to CONOPT.
integer function coidef_status(cntvect, coi_status)
define callback routine for returning the completion status.
integer function coidef_solution(cntvect, coi_solution)
define callback routine for returning the final solution values.
integer function coidef_optfile(cntvect, optfile)
define callback routine for defining an options file.
integer function coidef_license(cntvect, licint1, licint2, licint3, licstring)
define the License Information.
Definition coistart.f90:680
integer function coidef_numvar(cntvect, numvar)
defines the number of variables in the model.
Definition coistart.f90:358
integer function coidef_objcon(cntvect, objcon)
defines the Objective Constraint.
Definition coistart.f90:629
integer function coidef_numnz(cntvect, numnz)
defines the number of nonzero elements in the Jacobian.
Definition coistart.f90:437
integer function coidef_optdir(cntvect, optdir)
defines the Optimization Direction.
Definition coistart.f90:552
integer function coidef_numnlnz(cntvect, numnlnz)
defines the Number of Nonlinear Nonzeros.
Definition coistart.f90:476
integer function coidef_numcon(cntvect, numcon)
defines the number of constraints in the model.
Definition coistart.f90:398
integer function coidef_size()
returns the size the Control Vector must have, measured in standard Integer units.
Definition coistart.f90:176
integer function coidef_inifort(cntvect)
initialisation method for Fortran applications.
Definition coistart.f90:314
subroutine coiget_version(major, minor, patch)
returns the version number. It can be used to ensure that the modeler is linked to the correct versio...
Definition coistart.f90:67
integer function coi_solve(cntvect)
method for starting the solving process of CONOPT.
Definition coistart.f90:14
real *8 obj
Definition comdecl.f90:10
integer solcalls
Definition comdecl.f90:9
integer sstat
Definition comdecl.f90:12
integer stacalls
Definition comdecl.f90:8
subroutine flog(msg, code)
Definition comdecl.f90:56
logical do_allocate
Definition comdecl.f90:21
integer, parameter maximize
Definition comdecl.f90:25
integer mstat
Definition comdecl.f90:11
subroutine startup
Definition comdecl.f90:35
program pindyck
Main program. A simple setup and call of CONOPT.
Definition pindyck.f90:80