Do I have to clear all my definitions whenever I experiment with different parameter values for my model? For example, I have a simple model as follows:
w[t_]:=w[t]=w[t-1]+h
w[0]=0
h = 5
I want to do:
Table[w[t], {t, 0, 10}]
with varying h. But every time I change h, I have to clear the definitions with
Clear["Global`*"]
Otherwise, the result for w[t] remains the same. This practice is ok with this simple model. But when the model is pretty big, it really is time-consuming. I was expecting to get a new result directly by changing h. Any helpful comments in this direction?
Dynamic
allow for post hoc update of variables -- though it may make it considerably slower to run. $\endgroup$