Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

2016/3/16

SPI1Sage

SPI1
P=Primes()
P.next(10000)
10007
f(x)=exp(x)
f.taylor(x, 0, 5).show()

120

24

+ x + 1

f(x)=cos(x)
f.taylor(x, 10, 5).show()

(x 10)

sin (10) +

120

(x 10)

cos (10) +

24

(x 10)

sin (10)

(x 10)

cos (10) (x

f(x)=cos(x)
f.taylor(x, 10, 5).show()

(x 10)

sin (10) +

120

(x 10)

24

cos (10) +

(x 10)

sin (10)

(x 10)

cos (10) (x

P=MixedIntegerLinearProgram(maximization=True) #
#x = P.new_variable(real=True)
x = P.new_variable(binary=True) #
P.set_objective(x[0]+x[1]+x[2]+x[3]) #
P.add_constraint(x[0]+2*x[1]+3*x[2]+4*x[3] <= 10) #
P.solve() #
#
print P.get_values(x[0])
print P.get_values(x[1])
print P.get_values(x[2])
print P.get_values(x[3])
1.0
1.0
1.0
1.0
x0 + 2 * x1 + 3 * x2 + 4 * x3 = 10
x0 + x1 + x2 + x3 = 0/1

http://192.168.3.10:8080/home/admin/3/print

1/1

You might also like