Simulation discrepancy in Qucs with 2N3904 transistor

I've been testing out a few circuit simulation applications and ran into an unusual issue with Qucs and the 2N3904 transistor. For a simple NPN transistor circuit with load resistor $$\R_L\$$, base resistor $$\R_B\$$, and pull-down resistor $$\R_P\$$, I'm seeing an inflection in the collector-to-emitter voltage $$\V_{CE}\$$ as I sweep $$\R_B\$$ through a range of values. It also reads much higher than it should, starting out around 0.4 V and increasing to nearly 5 V. In the screenshot below, you can see how $$\V_{CE}\$$ rises sharply and $$\I_C\$$ begins to decline when $$\R_B\$$ is around 4 kOhm.

When I simulate the same circuit in LTSpice, the results are more typical: $$\V_{CE}\$$ is less than 0.2 V while in saturation and there's a nice flat $$\I_C\$$ curve around 120 mA or so, which correlates to the supply voltage and load resistor.

I'm thinking there must be an incorrect parameter in the 2N3904 component in Qucs that is throwing things off. I've tried to compare the parameters between the different software packages, but haven't had much luck (some of the data sheets don't even have all of those parameters listed). Interestingly, if I try to substitute a 2N2222, the inflection is gone, but I think $$\V_{CE}\$$ is still too high since the transistor should be in saturation.

Am I doing something wrong, or is my Qucs configured incorrectly? I'm trying to evaluate a variety of simulation packages and I really like Qucs, but I want to be sure the simulation results are going to be accurate going forward. Thanks for the help.

• In your first graphic, your x-axis is labeled "R3" but there's no "R3" in any of your schematics. Are you sure you're sweeping what you think you're sweeping? – The Photon Nov 20 '18 at 22:37
• @ThePhoton Good catch. I actually renamed the resistors just prior to posting my question, so I must have missed updating the chart axes. This was just a typo; the plots are actually sweeping the proper values. Thanks! – higrafey Nov 20 '18 at 23:09

The hFE of the 2N3904 is typically around 40-50 at 110mA Ic and Vce = 1V, according to this datasheet and this datasheet.

Your Qucs simulation shows 2.2mA base current with Vce = 1V and Ic = 110mA, so hFE is about 50, which does not seem unreasonable.

The LTSpice simulation seems a bit more dubious, for that part number, at least based on the above datasheets. I believe you're probably using the Philips model in LTspice, which seems to have an unusually high hFE at 110mA for a crappy 2N3904. The 2N3904_Cordell model has lower hFE, at high current anyway. You're really out at the edge of where people would use a 2N3904 anyway, so I'm not sure it's even that useful a comparison. Try at 5 or 10mA Ic and see what the differences are.

You should be able to compare the model parameters to see what the differences are. You're changing two things at once (model and simulator) so you're not really comparing simulators.

I believe that both are based on Berkeley SPICE 3.x so the simulation results should be similar, all other things being equal (and there are many options with each).

• Interesting. I'll look into the parameters a bit more and maybe try to post some other simulations to nail this down. FWIW, I also ran the simulation through CircuitLab and the results were closer to the SPICE model. I couldn't do a parameter sweep, so I manually ran DC analyses to ballpark some points. I'm not sure what simulation package CircuitLab is based on, though. – higrafey Nov 20 '18 at 23:13
• The LTspice simulator was originally based years ago on Berkeley SPICE 3F4/5. But I gather it underwent a full re-write to improve performance, fix bugs, add other convergence methods, and to run industry standard semiconductor (used by IC FABs) and behavioral models. Digital simulation (and co-simulation) was also added. But none of that means it shouldn't produce similar results, given the same model to operate on. I'd guess the models being used are different in some significant ways. It would not surprise me at all to find that LTspice's (sub)-standard 2N3904 model is deficient here. – jonk Nov 21 '18 at 0:50
• For the above plots, I was using the Philips/NXP model in LTspice for the 2N3904. When I tried the Cordell model and reduced Ic down to 10 mA, the output was much closer to the Qucs analysis. Interestingly, I tried to "fix" the Philips model by copying the parameters from Qucs, but it didn't make much of a difference. The Cordell model has quite a few additional parameters compared to the Philips one, so I have to assume it provides a more complete simulation. Out of curiosity, where do these values come from? Are there any resources out there to verify the accuracy of the component models? – higrafey Nov 27 '18 at 0:27
• @jonk Thanks for providing some history on the connection between LTspice and Berkeley SPICE! – higrafey Nov 27 '18 at 0:27