We like to build things using real parts. But we do think the more you can model using tools like LTSpice, the less time you can spend going down dead ends. If you need to model a common component like a resistor or even an active device, most simulators have great models and you can tweak them to have realistic parasitic effects. But what if the component you want isn’t in the library or doesn’t have the fidelity you want? [FesZ] wanted to model photovoltaic cells and had to build his own model. The resulting two videos are well worth watching.
Building your own models in Spice isn’t necessarily very difficult. However, knowing exactly what to add to model different real-world effects can be challenging. The videos do a good job of showing how to mutate a simple diode into one that produces current when exposed to light.
The key, it seems to us, is to not fall too far down the rabbit hole. The default models, for example, do a good job of modeling major effects but not getting bogged down with subtle details that don’t make much practical difference. You usually want to capture major effects in normal operating regimes. The fact that your resistor will blow open if you draw 30 amps through it isn’t really important for most simulations.
We’ve looked at building transformers in Spice before. We also enjoy modeling test setups with LTSpice.