Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- import pandas as pd
- from scipy.integrate import odeint
- def f(y, t):
- y1, y2 = y
- return [np.sin(y2)**2 - y1 + 3 * t, y2**(2/3) + 1 / y1 - t]
- x = np.linspace(0, 16, 1000)
- y0 = np.array([2, 5])
- w = odeint(f, y0, x)
- y1 = w[:, 0]
- y2 = w[:, 1]
- plt.plot(x, y1, x, y2)
- plt.grid()
- plt.show()
- df = pd.DataFrame({'X': x, 'y1': y1, 'y2': y2})
- print(df.iloc[624:695])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement