I cannot reproduce the OP's problem, and despite that the variations on David G. Stork's and Chris Degnan fixes are limited and trivial, I will make some comments on potential issues in the code. These issues may in fact be a problem in the OP's notebook (but not in the code per se), which I will explain.
The body of a Manipulate
is wrapped in Dynamic[]
and depends on all the symbols (that are not System`
functions) in the code. In the OP's case, the dependencies include these Global`
variables:
tepsr, tepsi, upper, lower, epsi
Any time one of these changes, the whole body will be recalculated. If there are other Dynamic[]
things going on in the notebook that depend on these variables, odd things can happen (infinite loops, slow response, the kernel message the OP is getting, and so forth).
Further there may be some (hidden) system parameters that the Manipulate
may depend on, especially if there is a plot in the output.
And, of course, the body depends on the localized Manipulate
variables, but these are usually less problematic (or if they are, the problem usually can be understood in terms of the code in the body).
The option TrackedSymbols
is the usual way to control dependencies in complicated situations, such as in this question. Another consideration is to localize variables, so that the Manipulate
has as few global side effects and dependencies as possible.
In the OP's code, it is not clear whether tepsr
and tepsi
need to be saved in a global variable. They can be recovered from upper
and lower
if necessary, and in this case, the extra expense of recomputing them would be minimal. So in the example below, I show one way of localizing them with With
. The other "fix" is to set the tracked symbols to be just the Manipulate
control variables. There is a short-hand for this, TrackedSymbols -> True
.
I've followed the same path as Chris in putting the button's intended actions in the button itself. Having the button set a flag that causes the whole body to be reevaluated should usually be avoided, since it causes (potentially lots of) other computations that are unnecessary.
Finally, I show a variation on the presentation of the output elements, putting the button in the plot label; Chris and David show reasonable alternatives as well.
upper = 0;
lower = 0;
Manipulate[
With[
{tepsr = {1, 2, 3, 4, 5, 6, 7, 8, 9}[[1 + low ;; 9 - hig]],
tepsi = {9, 8, 7, 6, 5, 4, 3, 2, 1}[[1 + low ;; 9 - hig]]},
ListLogLinearPlot[
{tepsr, tepsi} ,
PlotLabel -> Button["Set",
upper = hig;
lower = low;
epsi = Interpolation[tepsi]]
]
],
{{low, 0}, 0, 3, 1}, {{hig, 0}, 0, 3, 1},
TrackedSymbols :> True]
Set
button in your display field is beyond me. $\endgroup$