You have a unit problem. Your w
is dimensionless, but you’re clipping between 0
and 1 * mV
which presumably evaluates to 1e-3
… which is exactly the range you’re getting, as far as I can see from your w/wmax plot.
@mstimberg, should clip()
do unit checks?