Coverage for docs/source/examples/external_sp.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"Can be found in gpkit/docs/source/examples/external_sp.py"
2import numpy as np
3from gpkit import Variable, Model
4from external_constraint import ExternalConstraint
6x = Variable("x")
7y = Variable("y")
9objective = y
11constraints = [ExternalConstraint(x, y),
12 x <= np.pi/2,
13 x >= np.pi/4,
14 ]
16m = Model(objective, constraints)
17print(m.localsolve(verbosity=0).summary())