How to take the maximum and minimum values of inductor current with b source? Is it possible?

Hi,

test.qsch (7.7 KB)
Is it possible?

  1. How to take the maximum value of inductor current with b source? (like below red line)

  2. How to take the minimum value of inductor current with b source? (like below red line)

image

Looks like you need an envelope tracker, sorry I don’t know how to do that in spice but since there is the C code blocks maybe you can implement a DSP style envelope tracker.

At this moment I do not want to use code. So, only analog variant