Author Topic: xkcd Circuit Diagram...  (Read 3002 times)

0 Members and 1 Guest are viewing this topic.

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
xkcd Circuit Diagram...
« on: January 04, 2017, 11:07:08 am »
In case you haven't seen it before:
http://xkcd.com/730/

Wondering what that jumble of resistors is?
https://www.seventransistorlabs.com/Articles/xkcd.html

::) ;D

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3538
  • Country: it
Re: xkcd Circuit Diagram...
« Reply #1 on: January 04, 2017, 11:47:24 am »
wonder if LEET ampere was intentional :D
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6279
  • Country: de
Re: xkcd Circuit Diagram...
« Reply #2 on: January 04, 2017, 12:04:31 pm »
Best annotation:
"Arduino, just for blog cred."

 

Offline cvanc

  • Frequent Contributor
  • **
  • Posts: 675
  • Country: us
Re: xkcd Circuit Diagram...
« Reply #3 on: January 04, 2017, 12:46:19 pm »
 :-DD :-DD :-DD

nicely done!
 

Offline Kirr

  • Regular Contributor
  • *
  • Posts: 66
  • Country: jp
Re: xkcd Circuit Diagram...
« Reply #4 on: January 05, 2017, 02:37:18 pm »
Hi Tim! I'm glad you had fun toying with my solver!

About the netlist format: As you can imagine I am not familiar with SPICE or other circuit software so I picked the simplest suitable format I could think of. Do you think that adding an option for some other input format would be a good idea?

About the visualization looking different between runs: Actually it's not due to input format, but simply it's random each run anyway. Even identically input will result in different visualizations. (Often some dragging around is required before the graph makes sense).

I have a further quiz... I've seen somewhere a theory saying that Randall (comic author) intentionally made the network to have the conductance (reciprocal or resistance) of 1.337 Mho. Question is: what other networks have 1.337 Mho total conductance, and whether any simpler networks can give a more accurate approximation.

EDIT: Just noticed it's also mentioned by JPortici.
« Last Edit: January 05, 2017, 02:50:15 pm by Kirr »
 

Offline T3sl4co1lTopic starter

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: xkcd Circuit Diagram...
« Reply #5 on: January 05, 2017, 07:05:23 pm »
About the netlist format: As you can imagine I am not familiar with SPICE or other circuit software so I picked the simplest suitable format I could think of. Do you think that adding an option for some other input format would be a good idea?

Yeah, the most frustrating thing is not knowing how my input has failed: "unable to parse", really?  Documenting the format, and failing gracefully (if nothing else, telling the user exactly what they've done, and not done, and how to fix it), are critical to good design!

The same goes for the resistor value page; the input fields aren't well documented and I always seem to fumble around a bit, remembering which is which and what they do...



I'd love a netlist format -- here's the XSPICE version of the schematic in question:

Code: [Select]
R1 1 2 1.0
R2 1 5 1.0
R3 1 6 1.0
R4 1 3 1.0
R5 2 4 1.0
R6 2 9 1.0
R7 2 5 1.0
R8 6 3 1.0
R9 3 12 1.0
R10 4 7 1.0
R11 7 6 1.0
R12 6 12 1.0
R13 5 10 1n
R14 6 10 1.0
R15 4 8 1.0
R16 8 7 1.0
R17 9 10 1.0
R18 11 10 1.0
R19 12 11 1.0
R20 9 13 1.0
R21 8 13 1.0
R22 12 14 1.0
R23 11 14 1.0
R24 13 10 1.0
R25 10 14 1.0
R26 13 15 1.0
R27 10 15 1.0
R28 14 15 1.0
R29 15 0 1n
V1 1 15 1.0

General syntax is:
<Identifier> <Net1> <Net2> [Net3 [...NetN]] <Value> [ModelName] \n

<Identifier> starts with a letter that denotes what type of component it is: R for resistor, C for capacitor, Q for BJT, X for subcircuit, etc.

You won't need to use <Identifier> (aside from accepting resistors, and perhaps ignoring other types?), though if the graph can have its edges labeled by two parameters (name and value), it should be added -- yay for disambiguation!

For resistors only, there are only two pins, of course, so only two net names are expected.

You'd ignore the [ModelName] field; that's used to show resistor tempco, transistor type, stuff like that.

Statements are on a per-line basis.  If the next line starts with a "+", it's a continuation line, so should be collapsed with the previous line.

Fully parsing all valid netlists is a complex process (you have to preprocess, build a namespace, then for each statement, count the tokens and match up keywords in the namespace..), but just using a much more simplified subset of that would be very nice I think.

Like I said in the article, the existing parser basically does it, but it's out of order, so requires some editing.

Quote
About the visualization looking different between runs: Actually it's not due to input format, but simply it's random each run anyway. Even identically input will result in different visualizations. (Often some dragging around is required before the graph makes sense).

Really?  I thought I ran it twice on identical data and saw more-or-less the same thing.

Dragging?  YOU CAN DRAG THINGS?

I didn't even try...

Quote
I have a further quiz... I've seen somewhere a theory saying that Randall (comic author) intentionally made the network to have the conductance (reciprocal or resistance) of 1.337 Mho. Question is: what other networks have 1.337 Mho total conductance, and whether any simpler networks can give a more accurate approximation.

EDIT: Just noticed it's also mentioned by JPortici.

Read the mouseover text on that picture... ;)

Thanks!

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Kirr

  • Regular Contributor
  • *
  • Posts: 66
  • Country: jp
Re: xkcd Circuit Diagram...
« Reply #6 on: January 06, 2017, 02:57:47 am »
Yeah, the most frustrating thing is not knowing how my input has failed: "unable to parse", really?  Documenting the format, and failing gracefully (if nothing else, telling the user exactly what they've done, and not done, and how to fix it), are critical to good design!
You're totally right, explaining parsing failures could and should be much improved.

The same goes for the resistor value page; the input fields aren't well documented and I always seem to fumble around a bit, remembering which is which and what they do...
Not totally sure what you mean here, I guess the help page. If you notice that some value is not recognized, that you think should be recognized, I'd appreciate if you let me know.

As an aside, it's by pure chance that I noticed this thread. In case you encounter any issues with the solver, there is a much greater chance of me fixing it if you let me know about the issue. I'll really appreciate any such bug reports or improvement requests!

I'd love a netlist format -- here's the XSPICE version of the schematic in question:
...
Thanks! This is very helpful. I'll see if I can add this format.

Really?  I thought I ran it twice on identical data and saw more-or-less the same thing.
Must have been by lucky chance. (Especially if it was more-or-less rather than exactly same).

Dragging?  YOU CAN DRAG THINGS?

I didn't even try...
Draggability is the best part of it. 8) I probably should write "Draggable" or something next to the graph. :)

Read the mouseover text on that picture... ;)
Yeah, but it depends on how much trust you put in that text. Without having any further inside info, I think this author's comment does not completely rule out the possibility of the network being purposely designed that way. :)

Thanks for great feedback!


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf