Professional Documents
Culture Documents
1 Problem 1: Numpy NP Matplotlib - Pyplot PLT Sympy Chebpy Numpy
1 Problem 1: Numpy NP Matplotlib - Pyplot PLT Sympy Chebpy Numpy
February 2, 2021
%matplotlib inline
1 Problem 1
1.0329381949400263
fig, ax = plt.subplots(figsize=(12,6))
1
plt.plot(t, xx(t), label="$x(t)$")
plt.plot(r, [0 for _ in range(len(r))], 'ro')
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
plt.legend()
plt.grid()
plt.show()
10434.34685215483
[7]: x = Symbol('x')
V = exp(-x**2/100)*(x + 10*sin(pi*x))
X = diff(V)
print(X)
2
[8]: # final position and velocity as t goes to infinity
limX = limit(X, x, oo, '+').evalf()
limV = limit(V, x, oo, '+').evalf()
print("limit of x as t tends to infinity:", limX)
print("limit of v as t tends to infinity:", limV)
[ ]: