I have a power electronic inverter, and I want to make the duty cycle of the PWM dependent on the ratio of "vout/vin", where vout is an AC power source.
Unfortunately, setting .param D= IF(V(vout)/V(vin) < 0.5, 1, 0) doesn't work. In fact, even just setting D to be a sine-wave source doesn't work.
Does this mean that LTSpice params need to be constant, and that a "control circuit" needs to be implemented to get something that can change on the fly?