public
Created

fmin_cobyla is returning nan

  • Download Gist
scipy_fmin_cobyla_test.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 2 15:43:21 2011
 
@author: gustavo
"""
 
from scipy.optimize import fmin_cobyla
import numpy as np
 
def objective(x):
print x
return np.inf
 
def constraint1(x):
return 0
xstar = fmin_cobyla(func=objective, x0=1,cons=[constraint1])
print xstar

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.