Finding the Voltage source function when the function of voltage across inductor is given in SPICE

spice

My circuit contains a voltage source in series with an inductor and a resistor. I am given the voltage function across the inductor. How to I get the voltage function across the source from this using SPICE?
enter image description here

Here is a circuit diagram regarding the same. The voltage function across the inductor is given as:

1V for 0

0V otherwise

Best Answer

Firstly, for the given information, there isn't a unique solution. Recall that:

\$v_L(t) = L \dfrac{di_L(t)}{dt} \$

Thus, when the inductor voltage is zero, the inductor current is constant but, without further information, you don't know the value of this constant current.

Thus, \$v_s\$ is some constant value (the product of the constant inductor current and series resistance) at all times except when \$t=0\$ where it is 1V higher.

Secondly, and AFAIK, in SPICE, one specifies the voltage across a voltage source rather than solving for it.

Thirdly, for the specified inductor voltage, the change in inductor current is non-zero only for an infinitesimal time. I do not know how one would simulate* this in SPICE which necessarily has finite time steps.

*One could approximate this with a finite though extremely small duration pulse.