coding utf-8 import scipy import math import numpy as np import seabor

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# -*- coding: utf-8 -*-
import scipy
import math
import numpy as np
import seaborn as sns
%pylab inline
sns.set_style("whitegrid")
m, mu, g = 10, 0.7, 9.8
F = lambda a: mu*m*g / (math.cos(a) + mu*math.sin(a))
pylab.plot(np.arange(0, math.pi/2, 0.01), map(F, np.arange(0, math.pi/2, 0.01)))
res = scipy.optimize.minimize(F, 0.0, method='SLSQP')