Cite Us
pyOpt

Previous topic

Code Structure

Next topic

Optimizer

Optimization

class pyOpt_optimization.Optimization(name, obj_fun, var_set=None, obj_set=None, con_set=None, use_groups=False, *args, **kwargs)

Optimization Problem Class

Optimization Problem Class Initialization

Arguments:

  • name -> STR: Solution name
  • opt_func -> FUNC: Objective function

Keyword arguments:

  • var_set -> INST: Variable set, Default = None
  • obj_set -> INST: Objective set, Default = None
  • con_set -> INST: Constraints set, Default = None
  • use_groups -> BOOL: Use of group identifiers flag, Default = False

Documentation last updated: May. 23, 2011 - Ruben E. Perez

ListAttributes()

Print Structured Attributes List

Documentation last updated: March. 24, 2008 - Ruben E. Perez

addCon(*args, **kwargs)

Add Constraint into Constraints Set

Documentation last updated: March. 27, 2008 - Ruben E. Perez

addConGroup(name, ncons, type='i', **kwargs)

Add a Group of Constraints into Constraints Set

Arguments:

  • name -> STR: Constraint group name
  • ncons -> INT: Number of constraints in group

Keyword arguments:

  • type -> STR: Constraint type (‘i’-inequality, ‘e’-equality), Default = ‘i’

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

addObj(*args, **kwargs)

Add Objective into Objectives Set

Documentation last updated: March. 27, 2008 - Ruben E. Perez

addSol(*args, **kwargs)

Add Solution into Solution Set

Documentation last updated: May. 07, 2008 - Ruben E. Perez

addVar(*args, **kwargs)

Add Variable into Variables Set

Documentation last updated: March. 27, 2008 - Ruben E. Perez

addVarGroup(name, nvars, type='c', value=0.0, **kwargs)

Add a Group of Variables into Variables Set

Arguments:

  • name -> STR: Variable Group Name
  • nvars -> INT: Number of variables in group

Keyword arguments:

  • type -> STR: Variable type (‘c’-continuous, ‘i’-integer, ‘d’-discrete), Default = ‘c’
  • value ->INT/FLOAT: Variable starting value, Default = 0.0

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

delCon(i)

Delete Constraint i from Constraints Set

Arguments:

  • i -> INT: Constraint index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

delObj(i)

Delete Objective i from Objectives Set

Arguments:

  • i -> INT: Objective index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

delSol(i)

Delete i Solution from Solutions Set

Arguments:

  • i -> INT: Solution index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

delVar(i)

Delete Variable i from Variables Set

Arguments:

  • i -> INT: Variable index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

delVarGroup(name)

Delete Variable Group name from Variables Set

Arguments:

  • name -> STR: Variable group name

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

firstavailableindex(set)

List First Unused Index from Variable Objects List

Arguments:

  • set -> LIST: Set to find frist available index of

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

getCon(i)

Get Constraint i from Constraint Set

Arguments:

  • i -> INT: Constraint index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

getConSet()

Get Constraints Set

Documentation last updated: March. 27, 2008 - Ruben E. Perez

getObj(i)

Get Objective i from Objectives Set

Arguments:

  • i -> INT: Objective index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

getObjSet()

Get Objectives Set

Documentation last updated: March. 27, 2008 - Ruben E. Perez

getSol(i)

Get Solution i from Solution Set

Arguments:

  • i -> INT: Solution index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

getSolSet()

Get Solutions Set

Documentation last updated: May. 07, 2008 - Ruben E. Perez

getVar(i)

Get Variable i from Variables Set

Arguments:

  • i -> INT: Variable index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

getVarGroups()

Get Variables Groups Set

Documentation last updated: June. 25, 2009 - Ruben E. Perez

getVarSet()

Get Variables Set

Documentation last updated: March. 27, 2008 - Ruben E. Perez

setCon(i, *args, **kwargs)

Set Constraint i into Constraints Set

Arguments:

  • i -> INT: Constraint index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

setObj(i, *args, **kwargs)

Set Objective i into Objectives Set

Arguments:

  • i -> INT: Objective index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

setSol(i, *args, **kwargs)

Set Solution i into Solution Set

Arguments:

  • i -> INT: Solution index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

setVar(i, *args, **kwargs)

Set Variable i into Variables Set

Arguments:

  • i -> INT: Variable index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

solution(i)

Get Solution from Solution Set

Arguments:

  • i -> INT: Solution index

Documentation last updated: Feb. 07, 2011 - Peter W. Jansen

write2file(outfile='', disp_sols=False, **kwargs)

Write Structured Optimization Problem to file

Keyword arguments:

  • outfile -> STR/INST: File name or file instance, Default = ‘’
  • disp_sols -> BOOL: Display solutions flag, Default = False.
  • solutions -> LIST: List of solution indexes.

Documentation last updated: May. 9, 2008 - Peter W. Jansen

class pyOpt_optimization.Solution(optimizer, name, obj_fun, opt_time, opt_evals, opt_inform, var_set=None, obj_set=None, con_set=None, options_set=None, myrank=0, *args, **kwargs)

Bases: pyOpt_optimization.Optimization

Optimization Solution Class

Solution Class Initialization

Arguments:

  • optimizer -> STR: Optimizer name
  • name -> STR: Optimization problem name
  • opt_time -> FLOAT: Solution total time
  • opt_evals -> INT: Number of function evaluations

Keyword arguments:

  • var_set -> INST: Variable set, Default = {}
  • obj_set -> INST: Objective set, Default = {}
  • con_set -> INST: Constraints set, Default = {}
  • options_set -> Options used for solution, Default = {}
  • myrank -> INT: Process identification for MPI evaluations, Default = 0

Documentation last updated: Feb. 03, 2011 - Peter W. Jansen

write2file(outfile)

Write Structured Solution to file

Arguments:

  • outfile -> STR: Output file name

Documentation last updated: May. 9, 2008 - Peter W. Jansen