Python
2018.4.6
code:plot001.py
import matplotlib.pyplot as plt
plt.plot( x, y )
plt.show()
code:plot002.py
import numpy as np
import matplotlib.pyplot as plt
x = np.random.randn(30)
y = np.sin(x) + np.random.randn(30)
plt.plot(x, y, "o")
plt.show()
code:ode010.py
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def func(v, t, p, r, b):
return [-p*v0+p*v1, -v0*v2+r*v0-v1, v0*v1-b*v2] p = 10
r = 28
b = 8/3
t = np.arange(0, 100, 0.01)
v = odeint(func, v0, t, args=(p, r, b))
fig = plt.figure()
ax = fig.gca(projection='3d')
plt.show()
code:ode_011.py
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
def func(x, t, a, b):
a = 1
b = 1
t = np.arange(0, 100, 0.01)
x = odeint(func, x0, t, args=(a,b) )
fig = plt.figure()
plt.xlim(-3, 3)
plt.ylim(-2, 5)
plt.show()
autograd