简体   繁体   中英

Plotting differential equation in python

I'm trying to plot the differential equation dh/dt = I(t) - f(h)*h(t), where f(h) can be modeled with f(h) = 1 - e^(-kh), with k being a constant. How can I go about this?

Using numpy (supports differential equations) alongside matplotlib , you should be able to achieve this. Numpy supports all sorts of mathematical functions , including trigonometric functions, derivitaves, integrals, etc. Once your equation is finalized, with all variables (set K equal to whatever, or solve for K using algebra), you can graph a mathematical function in Matplotlib - here is a guide . In short, solve the equation using numpy, then graph with matplotlib.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM