CONOPT
Loading...
Searching...
No Matches

Functions

 tutorial2r.TutModelData.buildModel (self)
 adding the variables and constraints to the model
 
 tutorial2r.TutModelData.evaluateNonlinearTerm (self, x, rowno, ignerr, thread)
 callback method for evaluating the nonlinear terms in a given row
 
 tutorial2r.TutModelData.evaluateNonlinearJacobian (self, x, rowno, jacnum, ignerr, thread)
 callback method for evaluating the jacobian for the nonlinear terms in a given row
 
 tutorial2r.TutModelData.evaluateSDLagrangian (self, x, u, hessianrow, hessiancol)
 Computes and returns the numerical values of the Lagrangian of the Hessian.
 

Detailed Description

This is a revised version of Tutorial2 in which the production function is split into two equations using an intermediate variable.

The purpose is to make the expressions simpler, in particular the second order terms. The equation Row 2: Al*L**(-Rho) + Ak*K**(-Rho) + Ainp*Inp**(-Rho)) ** ( -1.d0/Rho ) - Out = 0 is replaced by Row 2 (new): Al*L**(-Rho) + Ak*K**(-Rho) + Ainp*Inp**(-Rho)) = Int Row 4 (new): Int**( -1.d0/Rho ) = Out where Int is a new variable.

For more information about the individual callbacks, please have a look at the source code.

Function Documentation

◆ buildModel()

tutorial2r.TutModelData.buildModel ( self)

adding the variables and constraints to the model

Definition at line 28 of file tutorial2r.py.

◆ evaluateNonlinearTerm()

tutorial2r.TutModelData.evaluateNonlinearTerm ( self,
x,
rowno,
ignerr,
thread )

callback method for evaluating the nonlinear terms in a given row

Parameters
xthe solution vector that needs to be evaluated.
rownothe number for the row in which the nonlinear term exists.
ignerra boolean to indicate whether the current point is safe or unsafe.
threadthe index of the thread from which this method is being called from.
Returns
the value of the nonlinear terms.

Notes: an error in the evaluation is reported by calling errorInEvaluation()

Definition at line 85 of file tutorial2r.py.

◆ evaluateNonlinearJacobian()

tutorial2r.TutModelData.evaluateNonlinearJacobian ( self,
x,
rowno,
jacnum,
ignerr,
thread )

callback method for evaluating the jacobian for the nonlinear terms in a given row

Parameters
xthe solution vector that needs to be evaluated.
rownothe number for the row in which the nonlinear term exists.
jacnumvector with a list of column numbers for the nonlinear nonzero Jacobian elements in the row.
ignerra boolean to indicate whether the current point is safe or unsafe.
threadthe index of the thread from which this method is being called from.
Returns
a vector the length of jacnum that contains the jacobian values for the referenced elements.

Notes: an error in the evaluation is reported by calling errorInEvaluation()

NOTE: The jacobian is returned as a list of length jacnum. In this example, the returned list is constructed using append. It is also possible to initially create a list of length jacnum containing only 0s, then update the values by the variable indices.

Definition at line 110 of file tutorial2r.py.

◆ evaluateSDLagrangian()

tutorial2r.TutModelData.evaluateSDLagrangian ( self,
x,
u,
hessianrow,
hessiancol )

Computes and returns the numerical values of the Lagrangian of the Hessian.

Parameters
xthe solution vector that needs to be evaluated.
uthe vector of weights on the individual constraints.
hessianrowvector of row numbers of the lower triangular part of the hessian.
hessiancolvector of column numbers of the lower triangular part of the hessian.

returns a vector for the values of the Lagrangian of the Hessian. The length of the vector is of size numHessianNonzeros().

Notes: an error in the evaluation is reported by calling errorInEvaluation()

Definition at line 139 of file tutorial2r.py.