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:
how can actual time take variable approach 0 (like sum of series?)
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
Post a Comment