How can I solve the following ODE numerically using Python and Euler's method:

v' = 5 - 0.5v

Also, can anybody recommend a good book or website where I can learn solving differential equations using Python?

Recommended Answers

All 3 Replies

Well, that didn't teach me much. I think I need to add more information.

1. I need to plot the solutions as a function of time
2. The equation above was not completely correct:
v' = 5 - 0.5v^2 This makes it even harder...

So, here's my sequence of data with time (in seconds):
s = linspace(0, 12, 121) #(delta t is 0.1)

This is the plot:
plot (s, vt)

How do I get the data for vt?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.