Write code to simulate the following differential equation for x ranging from 0 to 5. Assume y = 0 when x = 0. Plot y vs. x usin
g Matplotlib. Give the plot a title and x and y axis labels. Also plot grid lines. Use a stepsize for x of 0.01. (4 points) dy/dx=(〖50x〗^2-10y)/3
1 answer:
Answer:
Check the explanation
Explanation:
from scipy.integrate import solve_ivp
import numpy as np
import matplotlib.pyplot as plt
def ode(x,y):
return (50*x**2-10*y)/3
t=np.arange(0,5.01,.01)
sol = solve_ivp(ode, [0, 5], [0], t_eval = t)
plt.plot(sol.t,sol.y.T)
plt.show()
plt.title('ode')
plt.ylabel('y')
plt.xlabel('x')
plt.grid()
You might be interested in
Insert Mode
[insert 20 characters]
Answer:
i think i might be the 3 answer
Explanation:
very independent : ) we use it for everything
The answer & explanation for this question is given in the attachment below.
Can you give me the link to an article about this so i may help?