flopt
latest

Contents:

  • Installation
  • Tutorial
  • Case Studies
  • Solvers
    • Solver Selector
    • Iterative Search
    • Swarm Intelligence Search
    • Baysian Search
    • Evolution Search
    • Quadratic Programming Search
    • Linear Programming Search
    • non-Linear Programming Search
      • ScipySearch
        • ScipySearch
    • Quantum Annealing Search
  • API Reference
  • Internal Reference
  • Recipes
flopt
  • Solvers
  • non-Linear Programming Search
  • Edit on GitHub

non-Linear Programming Search

ScipySearch

Solver name is “Scipy”.

https://img.shields.io/badge/Variable-Number-blue.svghttps://img.shields.io/badge/Objective-any-orange.svghttps://img.shields.io/badge/Constraints-any-green.svg
class flopt.solvers.scipy_searches.ScipySearch[source]

scipy optimize minimize API Solver

Parameters:
  • n_max_retry (int) – maximum number of retries to success the search

  • n_trial (int) – number of trials in scipy solver

  • should_continue_searching (bool) – if it is true, the searches continue to timelimit

  • calculate_jac_hess (bool) – if it is true, jac and hess is calculated and pass them into the solver, if it is possible

Examples

import flopt

# Variables
a = flopt.Variable("a", lowBound=-2, upBound=1, cat="Integer")
b = flopt.Variable("b", lowBound=1, upBound=4, cat="Continuous")
c = flopt.Variable("c", lowBound=0, upBound=3, cat="Continuous")

# Problem
prob = flopt.Problem()
prob += a*a + a*b + b + c + 2
prob += a + b >= 2
prob += b - c == 3

prob.solve(solver="Scipy", msg=True)

print(flopt.Value([a, b, c]))
>>> [0, 2.9999999999999996, 0.0]

See also

scipy.optimize.minimize

Previous Next

© Copyright 2021, Nariaki Tateiwa. Revision ff418914.

Built with Sphinx using a theme provided by Read the Docs.