May-11-2017, 05:27 PM

Hello, I have an equation and need to plot a graph using the Euler method, the code looks like this:

10(105 + log(900)) -5*t = S^2 /2 +20S +20log(S)

So when t = 0, S = 30. So I need to plot the values of S as the time increase.

Any help how to solve the equation?? In fact, I need anything that use the euler method that allows me to plot the graph.

Thanks in advance!

h = 0.01 x = [0.0] y = [0] n = int(30/h) def f(y,x): Â Â eq = #something Â Â Â return #something for i in range (0,n): Â Â xn = (i+1)*h Â Â yn = y[i] + f(y[i],x[i])*h Â Â x.append(xn) Â Â y.append(yn) Â Â #print (x[i],y[i]) Â Â Â Â Â Â plt.plot(x,y) plt.xlabel("Time(t)") plt.ylabel("Concentration(Cs)") plt.title("Concentration by Time") plt.show()But I have an equation, this one:

10(105 + log(900)) -5*t = S^2 /2 +20S +20log(S)

So when t = 0, S = 30. So I need to plot the values of S as the time increase.

Any help how to solve the equation?? In fact, I need anything that use the euler method that allows me to plot the graph.

Thanks in advance!