Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with previous export lists #1

Closed
Krb686 opened this issue Dec 17, 2013 · 9 comments
Closed

Incompatibility with previous export lists #1

Krb686 opened this issue Dec 17, 2013 · 9 comments
Assignees

Comments

@Krb686
Copy link

Krb686 commented Dec 17, 2013

Just built this yesterday and tried to import a saved filed from Falstad's original. The circuit shows up, even functions correctly, but the scope displays don't work properly. I can click any point in the circuit that clearly has a changing voltage and the scope displays no voltage change at all, just a flat 0 line.

Something changed with the format for file importing in this version??

In the picture below, my mouse is hovered over the scope, highlighting the wire to left in blue that is is currently displaying. It's clearly green in the picture, and the text display on the scope even says 15V, but no waveform appears.

falstad_update_error

@ghost ghost assigned hausen Dec 17, 2013
@hausen
Copy link
Owner

hausen commented Dec 17, 2013

Could you please export the circuit and attach the generated file to this issue?

@Krb686
Copy link
Author

Krb686 commented Dec 17, 2013

@hausen
Copy link
Owner

hausen commented Dec 17, 2013

Thanks. I have confirmed that the scope works in Falstad's original, bot not in my fork. I'll debug it asap.

@Krb686
Copy link
Author

Krb686 commented Dec 17, 2013

Thanks in advance. Very appreciative of your fast response.

@hausen
Copy link
Owner

hausen commented Jan 8, 2014

Sorry for the delay. I have found one cause for the bug, but still could not find the root cause for it. It seems to be related to the way the wires are implemented in my version (wires with resistance), versus Falstad's original (ideal wires).

The most interesting part of it is that, if one replaces every wire with a 1 pΩ resistor (that's a pico-ohm, it should have no effect whatsoever!) in your circuit, the scopes display only a flat line in both my version and Falstad's original. Check it out: http://textuploader.com/1rec

I will provide a workaround for it in my version, adding an option for switching between ideal and realistic behavior for wires. Anyway, I think you should also alert Paul Falstad of this strange behavior.

@hausen hausen closed this as completed in dc72112 Jan 9, 2014
@hausen
Copy link
Owner

hausen commented Jan 9, 2014

In the 'options' menu entry, there is now an 'ideal wires' checkbox, which is unchecked by default (i. e. the wires behave a bit more like real conductors, unlike in the original). If you check it, and optionally push the 'reset' button, you circuit behaves just as in the original simulator.

I am also reporting this issue upstream to Paul Falstad, so that he may check why the simulation fails if the wires are replaced by low-value resistors.

Thanks for reporting this issue.

@hausen
Copy link
Owner

hausen commented Jan 9, 2014

Just for completion, and in case the link expires, here is the file that started it all,

$ 1 1.0E-7 0.15814360605671443 30 5.0 43
a 96 336 176 336 0 15.0 -15.0 1000000.0
r 96 448 176 448 0 10000.0
w 176 336 176 448 0
w 176 256 176 336 0
w 96 240 96 320 0
w 96 352 96 448 0
r 96 448 32 448 0 1000.0
c 96 240 32 240 0 1.0E-5 1.287133362856366
w 32 240 32 448 0
g 32 448 32 528 0
a 720 368 816 368 0 15.0 -15.0 1000000.0
w 720 272 720 352 0
w 816 272 816 368 0
g 720 384 720 416 0
a 1168 480 1328 480 0 15.0 -15.0 1000000.0
r 1136 432 1136 496 0 1000.0
w 1488 432 1488 128 0
w 912 368 1168 368 0
w 1168 368 1168 464 0
w 1136 496 1168 496 0
r 1136 496 1136 576 0 12000.0
w 96 240 128 240 0
R 1136 432 1136 384 0 0 40.0 15.0 0.0 0.0 0.5
R 1136 576 1136 640 0 0 40.0 -15.0 0.0 0.0 0.5
c 816 368 880 368 0 1.0E-6 0.3892987477057748
r 880 368 880 448 0 10000.0
g 880 448 880 480 0
w 880 368 880 240 0
a 928 464 1008 464 0 15.0 -15.0 1000000.0
w 928 448 928 400 0
w 928 400 1008 400 0
w 1008 400 1008 464 0
d 1008 464 1056 464 1 0.805904783
c 1056 464 1104 464 0 9.999999999999999E-6 14.297944459122704
w 880 368 912 368 0
w 912 368 912 480 0
w 912 480 928 480 0
g 1104 528 1104 576 0
w 1104 464 1104 528 0
a 928 576 784 576 0 15.0 -15.0 1000000.0
r 784 528 928 528 0 100000.0
r 928 560 992 560 0 100000.0
r 928 592 1008 592 0 100000.0
r 928 592 928 656 0 100000.0
w 784 528 784 576 0
w 928 528 928 560 0
g 928 656 928 688 0
R 992 560 1024 560 0 0 40.0 11.3 0.0 0.0 0.5
w 1056 464 1056 592 0
w 1056 592 1008 592 0
w 720 272 720 144 0
c 816 272 720 272 0 3.0000000000000004E-8 -14.278116127615958
w 672 352 720 352 0
174 128 240 224 256 0 1000.0 0.005 Resistance
w 176 336 240 336 0
w 240 336 240 96 0
w 336 336 368 336 0
r 336 336 240 336 0 29000.0
r 336 336 336 416 0 1000.0
g 336 416 336 464 0
a 368 352 480 352 1 15.0 -15.0 1000000.0
w 368 368 368 416 0
w 368 416 480 416 0
w 480 416 480 352 0
r 480 416 480 496 0 10000.0
g 480 496 480 528 0
w 480 352 480 96 0
f 544 272 592 272 0 0.0
f 544 432 592 432 1 -0.0
w 512 352 512 240 0
w 592 240 592 256 0
w 480 352 512 352 0
w 592 240 512 240 0
w 672 544 672 448 0
w 672 448 672 352 0
w 512 352 512 400 0
w 512 400 592 400 0
w 592 400 592 416 0
w 624 352 624 288 0
w 624 288 592 288 0
w 624 352 624 448 0
w 624 448 592 448 0
w 624 352 672 352 0
172 544 272 528 272 0 6 5.0 5.0 -5.0 0.0 0.5 Voltage
172 544 432 528 432 0 6 -5.0 5.0 -5.0 0.0 0.5 Voltage
a 1008 256 1136 256 0 15.0 -15.0 1000000.0
g 1008 272 1008 304 0
c 1008 208 1136 208 0 1.0000000000000001E-7 6.044696951586495
w 1008 208 1008 240 0
w 1136 208 1136 256 0
r 880 240 1008 240 0 1000.0
w 1136 256 1200 256 0
c 1200 256 1248 256 0 1.0E-5 -6.707051829363764
r 1248 256 1248 336 0 100.0
g 1248 336 1248 368 0
w 1248 256 1248 96 0
o 27 4 0 298 17.498005798264096 0.01093625362391506 0 -1
o 95 2 0 299 2.3384026197294445 9.765625E-55 1 -1

@Krb686
Copy link
Author

Krb686 commented Jan 10, 2014

Okay thanks for the updates. I've been looking into this a bit more as well and have noticed something interesting that might be the cause of the problem. It may not be a bug at all.

In Falstad's version, it seems that when you try to display an "ideal" wire on the oscilloscope, it automatically assumes you are referencing the wire to ground since there is obviously no voltage drop across the wire. That's why it works properly. In your edited version of the circuit with 1p resistors, it still works properly in Falstad's version. The reason why you don't see anything on the scope is because with resistors, Falstad's displays the voltage across the resistor, but there is no drop across the resistor since it's the input to the op-amp.

I haven't gotten a chance to look at your version again yet, but I imagine that because your version simulates more realistic wires with some resistance rather than ideal is the source of the problem, in other words it isn't a bug at all. If your version treats wires as very small resistors, it won't show anything on the scope in that circuit since there is no voltage drop across the wire.

@Krb686
Copy link
Author

Krb686 commented Jan 10, 2014

For instance, take a look at this circuit. In Falstad's version the scope displays at 5V because it must be assuming you want to reference the wire to ground (0V).

I imagine that in your version, the scope will still show this as 0V for this simple circuit because it is treating the wire as a small resistor, thus showing the voltage drop ACROSS the wire, which is correctly 0.

$ 1 5.0E-6 10.20027730826997 50 5.0 43
R 352 224 208 224 0 0 40.0 5.0 0.0 0.0 0.5
w 352 224 352 288 0
o 1 64 0 35 5.0 9.765625E-5 0 -1

I am not sure how you would want to go about solving this if this is the source of the issue. I think most of the time if people, myself included, want to display the voltage of a wire we automatically want it in reference to 0V, like Falstad's version because I can't see much reason for wanting to know the negligible voltage drop across a wire. That might potentially be a pain in the ass for you to code though, since you'd have to change it so the wires still behave as small resistors but don't show voltage across them like regular resistors in the oscilloscope.

I suppose the workaround for myself and others would be to place very large resistors to ground wherever we want to know the voltage, but that could get annoying have lots of extra resistors.

Even better though might be to have the option to choose voltage across wire or with reference to ground for each wire in a right-click properties box, but again could be a pain to code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants