numpy - Exponential Decay timing and display loop with Python -


i'm trying model variable decaying exponentially initial value 0 on time, , display on screen approaches 0. time takes variable approach 0 try initial value set, time /actually/ takes lot longer.

my questions thus:

  1. how can actual time take variable approach 0 (like sum of series?)

  2. is there better way model kind of thing (exponential decay/thermal convection) using scipy or numpy or that, not using while loop? (this important later on integrate current pygame project)

here code have far. works, doesn't give me need. math or logic error?

import math  heatgenper = 50 coolrate = 0.36320474 heattime = math.log(heatgenper)/coolrate print("heat cool {} 1 in {:.2f} seconds".format(heatgenper,heattime))  fps = 60 while heatgenper >=0.999:     heattime = math.log(heatgenper)/coolrate     print("heat cool {} 1 in {:.2f} seconds".format(heatgenper,heattime))     coolsec = (heatgenper-1)/heattime     coolframe = coolsec/fps     heatgenper -=coolframe 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -