This circuit has floating nodes in LT Spice

acgroundltspicespicetransformer

enter image description here

This is the circuit I'm working on. This circuit probably doesn't work as intended to begin with, but that's not the point.

LT Spice keeps complaining that it doesn't have a reference to ground. I get an error that says "This circuit has floating nodes."

I found this but that didn't solve my problem.

It would be one thing to just connect a ground somewhere, but that will ruin the validity of my circuit.

The voltage source defined as MAINS in this circuit is just that…a simulation of the mains. It is a 60Hz sine wave with an amplitude of 120V. If I add a ground to it, I won't get the negative part of my wave!

The resistor connected to the voltage source is there to prevent another error being thrown about having inductors in parallel with the voltage source.

How can I keep this circuit equivalent to the real world so that I can simulate without losing half my wave from my MAINS voltage source?

Best Answer

In LTSpice, every node needs a path to GND. Just tack a GND node to both your primary and secondary side (drawn in CircuitLab for simplicity):

schematic

simulate this circuit – Schematic created using CircuitLab