Hot-keys on this page
r m x p 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/sin_approx_example.py"
2import numpy as np
3from gpkit import Variable, Model
6x = Variable("x")
7y = Variable("y")
9objective = y
11constraints = [y >= x,
12 x <= np.pi/2,
13 x >= np.pi/4,
14 ]
16m = Model(objective, constraints)
17print(m.solve(verbosity=0).summary())