5

I was having a problem with one of my circuits in CircuitLab, and traced it down to my sources always enabled, even if I switch them off by connecting to an open switch. This seems to be so simple, but I can't figure out it.

Here is a simplified circuit showing the behavior. I have a 5 V voltage source V1 on the left, disconnected from ground because switch SW1 is open. I have a second 5 V voltage source V2 on the right, connected to ground because switch SW2 is closed.

enter image description here

When doing a DC simulation, I would expect node "off" to be 0 V, and node "on" to be 5 V. But they are both 5 V as shown in the simulation window. Why?

Circuit fantasist
  • 13,593
  • 1
  • 17
  • 48
tcrosley
  • 47,708
  • 5
  • 97
  • 161

2 Answers2

8

The system you have drawn actually has an in-determinant answer for what \$V_{off}\$ is with respect to ground because it is galvanically isolated from ground.

Having a perfect open circuit in the system is problematic in how many circuit simulators are implemented, so the way this is often handled is to use a very high (but finite) resistance to model open circuits. With this very high but finite resistance, the solution becomes \$V_{off} = 5V\$.

To test if CircuitLab does use a finite high resistance, I built a "voltage divider" circuit with an open switch and a very large resistance. The DC simulator tells me the output voltage is 333.33mV, which means that \$R_{open} = 5\cdot10^{14} \Omega\$

schematic

simulate this circuit – Schematic created using CircuitLab

helloworld922
  • 16,600
  • 10
  • 54
  • 87
  • I wasn't aware of the high-resistance used in circuit simulators to avoid floating circuits. I put a 100K resistance from both Voff and Von to ground, and the voltage for Voff then went very close to 0. – tcrosley Jun 27 '15 at 00:25
  • It is a common technique, but where it's actually used depends on the software and components. For example, LTSpice does not use high finite resistances between inductors with coupled inductances; you must manually specify the ground on both sides. – helloworld922 Jun 27 '15 at 00:33
  • +1 for figuring out what the open-circuit resistance actually is. – Adam Haun Jun 27 '15 at 00:59
1

With switch 1 open, \$V_{off}\$ is floating. In circuit theory, this means it doesn't have a well-defined voltage. In real life, it means the voltage is determined by stray capacitance and externally-produced electric fields.

I'm not sure how CircuitLab is implemented, but I suspect it starts the simulation with all nodes at 0 V by default.

Adam Haun
  • 21,331
  • 4
  • 50
  • 91