I can't reproduce your waveforms by recreating the exact schematic from your 1st picture. Have you modified some settings? I used a .step
to cycle between the values of 33p
(your value, black trace) and 33n
(blue trace) for C1
, mostly to show the differences, but also to show that it works (though not as you'd expect):

I am considering the deafult models from the default installation; if you modified, in any way, the models for the transistors, then the results of your simulation may be different. Also, there is no need to specify the number of periods for the PULSE()
source, unless you really need a certain number of them; 0 means the pulses repeat forever.
The "netlist" you provided does not help. As @SpehroPefhany mentioned in the comments, you need to copy-paste the contents of the .asc
file. This is a simple schematic, so it didn't take long to recreate, but if you had a larger one... Still, for the case where it would indeed not work, there are a few possible solutions.
The solver first will try to solve for the operation point, since you have provided no flags. This means that, when you hit "run", the circuit should have been running since the beginning of time, having had time to settle all the possible transients, to a specific operating point -- the one you see at the simulation start. For that to happen, inductors are considered short-circuits and capacitors open-circuits. What you show in your plot is the voltage across the capacitor starting at ~4.78 V. That makes sense if you consider the resistive divider formed by R[1:3]
, and the static resistances of the transistor polarized by those resistors.
If you want to see the "normal" behaviour (i.e. what you expect to see), you have to tell the solver, because it cannot read minds. You have a few choices:
Add the startup
flag: .tran 0.05 startup
. This makes DC sources to ramp up in a fraction of the total simulation time (10 us, IIRC). This way, the beginning of the simulation will see the supply voltage at t=0 as 0 V, thus the capacitor will also start from zero.
Add initial conditions. This will force the solver to consider a custom value for the voltage at that node. This can be done in two ways:
global condition, with a SPICE directive: .ic v(x)=<value>
(considering x
as the label for that node). For your case, <value>
can be 0.
local condition, by adding ic=<value>
to the capacitor, next to its value (also 0 for your case).
- Adding the
uic
flag. This forces the solver to avoid calculating the operation point, and start everything from zero. That is, it considers the beginning of time starts with your pressing "run". From that moment on, it will calculate and show all the values as they progress through the simulation. Use this option with care, since it can mean the difference between simulating for a minute vs an hour. In this case, it's a very simple circuit.
There may be other, more exotic ways, such as an actual circuitry (a VCSW, perhaps) that forces the capacitor to be shorted and opening up after the simulation is started, or adding a simple, minor pulsed current source that forces zero current prior to simulation and a very narrow pulse after, to kick-start the voltages (this is mostly used for oscillators, but it works here, too), but they'll only add extra burden to the matrix solver.
Now that you posted the code for the .asc
file, that gave me a good chuckle. My eyes must be getting worse than I thought, because you assigned 33<space>pF
as the value for the capacitor. I'm surprised you didn't say anything about the error log popping up, that would have simplified things greatly (not to mention it kinda screams about the cause of the error). The very first lines are:
Error on line 6 : c1 n004 0 33 pf
Unknown parameter "pf"
That <space>
doesn't belong between a numerical value and its metric prefix, because the parser will interpret that as two values, 33
and pF
. Since it doesn't recognize pF
as a keyword or a flag, and it can't evaluate it (not lastly because of the lack of curly braces or single quotes), it interprets only the first value, 33
, thus considering the capacitor as 33 Farad
, and complains about the rest in the error log. That's why you see an almost pure integrator behaviour there.
Whatever's written above still stands, though, with the addition that the circuit will function correctly without any of the settings, since V2
is actively contributing to the discharging of the capacitor. But you can see how, even in my picture, it starts from ~4.78 V, because of the explanation above.
BTW, there's nothing wrong by writing units (F
, uH
, kOhm
, etc), LTspice will ignore them, but it's useless, unless you like seeing the units.