SPICE: Linear Approximations.
I mentioned a few times that I use AIM-Spice and usually do only linear approximations, rather than full simulations using transistor models. One instance when I did use a model it gave a completely wrong answer, suggesting a common-emitter output impedance was not affected by the input source impedance. The equivalent circuit I show here does give the right answer (or at least less wrong). Here I explain how almost any circuit can be simulated using the voltage controlled voltage or current sources available in Spice. First is a single transistor, here are three diagrams, the standard NPN transistor symbol, then the equivalent circuit I used in my 'Beginner's Guide', then a Spice version with a voltage controlled current source G1.
Alternatively I could have called this method a 'small signal AC simulation'. The first two diagrams assume the typical Vbe = 0.6V, but for Fig.3 we ignore the DC bias and just consider the AC signal. Also, when using Fig.2 in my 'Beginner's Guide' I said the transistor symbol represents a simplified and idealised transistor with constant Vbe, but still with current gain hfe. In Fig.3 we have a problem how to represent the current gain, and this is the reason for an additional resistor Rbe which at low frequencies will take a current equivalent to the AC base current. For input AC voltage Vbe we know the emitter current will be Vbe.gm, that's just a definition of gm, and gm is easily calculated, it's Ie/25 where Ie is in mA. In fig.2 the equivalent internal emitter resistance Re = 1/gm is then 25/Ie, so for 1mA emitter current that resistance is 25 ohms. The base current Ib is Ie / hfe, and the signal voltage is the same as that across Re, so Rbe is higher than Re by a factor hfe. Therefore Rbe = hfe.Re.
In practice we usually don't know any of the resistor values with great accuracy, apart from Re, so we try to design circuits where the values are not critical, and our simulation may be accurate enough with very approximate 'typical' values, or left out entirely if it is known the effects are insignificant. For example if Fig.3 is driven from a signal source with 100R source impedance then it makes little difference whether Rbe is 10k or just left out. Similarly if the output drives a 1k impedance there is no need to include Rce if it is something like 100k, typical component tolerances may have more effect.
Cbe and rbb' form a low-pass filter which may be important, but data sheets rarely specify rbb'. Cbe is easier to determine, it is primarily 'diffusion capacitance' and can be calculated from fT, which usually is included in data sheets but often just a 'typical' value, something like 100MHz in a typical low power transistor. The value of fT varies with collector current, and at a given current Cbe is the capacitance with impedance magnitude equal to 1/gm at frequency fT.
For example if a transistor operating at 1mA has fT=100MHz then 1/gm = 25 ohms, and we can calculate the capacitance Cbe with impedance 25R at 100MHz, or just look at a reactance chart, and find a value close to 60pF. For a high power transistor example, if the current was 10A and fT was 3MHz then Cbe becomes 20uF. For high power applications Cbe can be alarmingly high.That's it, just put that equivalent circuit in the circuit diagram in place of each transistor. There are other alternatives and tricks to produce a complete amplifier simulation, but the general idea is just to substitute this sort of linear approximation for the active devices.
Here is an example, a simulation of the MJR7-Mk5 mosfet amplifier:
There appears to be an extra node no.12 with no purpose, however this is a convenient place to put a break in the feedback loop to check loop gain and phase. The link between nodes 12 and 13 is removed, then the input signal is applied at node 13, with a resistive source impedance added in its place at the amplifier input, and the loop gain and phase can then be detected at node 12.
The emitter follower and source follower stages are easier to construct with unity gain voltage controlled voltage sources E1, E2, E3, which need to be followed by at least a series resistance to represent their output impdance.Sometimes it is easier to investigate the result of changing some component if we use two copies of the Spice listing in one file, then two different results can be seen on one plot. Here is an example showing how the loop phase changes if the PNP input stage transistor (G2) is changed from fT 100MHz to 200MHz. This approach makes it easier to optimise the more critical component values. Here unity gain is around 3.5MHz and it can be seen the higher fT result shown in green gives a far higher phase margin at that frequency. All we are doing in this simulation is changing the capacitor between the inputs of G2, for fT=100MHz it is 300pF (red) and for fT=200MHz it is 150pF (green).
The phase actually looks wrong, it should start at -180deg at low frequency and fall towards -360deg at high frequencies, but AIMSpice insists on restricting phase between +180 and -180, so I added an inversion by making G3 = +0.2 to make it start at 0deg, so it represents 'excess phase lag' added to the 180 deg low frequency phase. The current sources can be confusing, the current 'output' is actually the current into the output rather than out, so G1 and G2 being inverting common-emitter need a +gm while G3 being a non-inverting common-base needs a -gm. The voltage sources are easier, E1 E2 E3 are just used as unity-gain buffers with infinite input impedance and zero output impedance, which is why we need to add series resistors to represent the actual output impedance, and maybe parallel input resistors if the finite input impedance has a significant effect, and maybe various capacitors to represent Cbe, Cbc, Cce if necessary. E2 and E3 are the lateral mosfets and the various resistors and capacitors around them are based on the properties found in the data sheets.