xkcd Circuit Diagram... - Page 1
Forum section: electronics / general

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 04, 2017, 11:07:08 am
content: 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.htmlTim

author: JPortici
author_rank: Super Contributor
timestamp: January 04, 2017, 11:47:24 am
content: wonder if LEET ampere was intentional

author: Benta
author_rank: Super Contributor
timestamp: January 04, 2017, 12:04:31 pm
content: Best annotation:"Arduino, just for blog cred."

author: cvanc
author_rank: Frequent Contributor
timestamp: January 04, 2017, 12:46:19 pm
content: nicely done!

author: Kirr
author_rank: Regular Contributor
timestamp: January 05, 2017, 02:37:18 pm
content: 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 05, 2017, 07:05:23 pm
content: Quote from: Kirr on January 05, 2017, 02:37:18 pmYeah, 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:R1 1 2 1.0R2 1 5 1.0R3 1 6 1.0R4 1 3 1.0R5 2 4 1.0R6 2 9 1.0R7 2 5 1.0R8 6 3 1.0R9 3 12 1.0R10 4 7 1.0R11 7 6 1.0R12 6 12 1.0R13 5 10 1nR14 6 10 1.0R15 4 8 1.0R16 8 7 1.0R17 9 10 1.0R18 11 10 1.0R19 12 11 1.0R20 9 13 1.0R21 8 13 1.0R22 12 14 1.0R23 11 14 1.0R24 13 10 1.0R25 10 14 1.0R26 13 15 1.0R27 10 15 1.0R28 14 15 1.0R29 15 0 1nV1 1 15 1.0General syntax is:<Identifier> <Net1> <Net2> [Net3 [...NetN]] <Value>  \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  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.QuoteReally? 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...QuoteRead the mouseover text on that picture...Thanks!Tim

author: Kirr
author_rank: Regular Contributor
timestamp: January 06, 2017, 02:57:47 am
content: Quote from: T3sl4co1l on January 05, 2017, 07:05:23 pmYou're totally right, explaining parsing failures could and should be much improved.Quote from: T3sl4co1l on January 05, 2017, 07:05:23 pmNot 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!Quote from: T3sl4co1l on January 05, 2017, 07:05:23 pmThanks! This is very helpful. I'll see if I can add this format.Quote from: T3sl4co1l on January 05, 2017, 07:05:23 pmMust have been by lucky chance. (Especially if it was more-or-less rather than exactly same).Quote from: T3sl4co1l on January 05, 2017, 07:05:23 pmDraggability is the best part of it.I probably should write "Draggable" or something next to the graph.Quote from: T3sl4co1l on January 05, 2017, 07:05:23 pmYeah, 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!