Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scipy.optimize import fmin_cobyla
- from math import sqrt
- def f(x):
- return x[0]*x[1]**2+1
- def contrainte1(x):
- return 2 - (x[0] + x[1]**2)
- def contrainte2(x):
- return x[0]
- def contrainte3(x):
- return x[1]
- fmin_cobyla(f, [0.0, 0.1], [contrainte1, contrainte2, contrainte3], rhoend=1e-7)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement