Transformer with hysteresis in LTspice
I found a great article at this site to model transformers. It explains
"The work of Hsu, Middlebrook and Cuk 2 develops the relationship of leakage inductance, showing that relatively simple measurements of input inductance with shorted outputs yield the necessary model information."
They developed this for IsSpice, but it could be applied anywhere. Here is the spice code for a saturable core (just in case the link goes down) Here is an included picture of the model This is a graph of a modeled core:
And here is the reference for the paper the article was based on: TRANSFORMER MODELING AND DESIGN FOR LEAKAGE CONTROL Shi Ping Hsu, R.D. Middlebrook and Slobodan Cuk, Power conversion International, pg. 68, Feb, 1982