Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Created June 27, 2018 23:53
Show Gist options
  • Save WillKoehrsen/770924cfe8c55787371ed219f48cd23b to your computer and use it in GitHub Desktop.
Save WillKoehrsen/770924cfe8c55787371ed219f48cd23b to your computer and use it in GitHub Desktop.
import numpy as np
def objective(x):
"""Objective function to minimize"""
# Create the polynomial object
f = np.poly1d([1, -2, -28, 28, 12, -26, 100])
# Return the value of the polynomial
return f(x) * 0.05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment