4 ms·
Electr, a language for electronic formulas
- nyir 11y agoThat has probably a lot of overlap with Frink https://futureboy.us/frinkdocs/ https://futureboy.us/frinkdocs/, though after a quick try the output could be nicer, e.g. like described in this document.
- davelnewton 11y agoThat was my first thought as well; Frink, if it doesn't have this stuff, probably could.
- lkdjiin 11y agoThanks for pointing this one. I don't think java is the right tool for what I have in mind (because of the JVM overhead) but I'll definitely try Frink.
- scotty79 11y agoWe could reimplement it in js to freely mix and match with other js based languages.
- 0h139 11y agoAs a student, I've found the TI-Nspire CAS software to work pretty well with units, but of course it's not free. https://education.ti.com/en/us/products/computer_software/ti-nspire-software/ti-nspire-student-software/tabs/overview https://education.ti.com/en/us/products/computer_software/ti...
- gbl08ma 11y agoSorry for the accidental downvote, I actually wanted to upvote :(
- compumike 11y agoNot command line (or open source), but we've built most of this capability and more into CircuitLab https://www.circuitlab.com/ https://www.circuitlab.com/ (disclosure: I'm one of the developers) -- we have to manage units, metric prefixes, all sorts of arbitrary expressions https://www.circuitlab.com/docs/expressions/ https://www.circuitlab.com/docs/expressions/ , real and frequency domain, etc. We also have schematic-wide parameters, the ability to define functions of those parameters to set component values, and/or to set real-time arbitrary behavioral voltages and currents within the circuit graph, etc. On top of that, iteratively solved non-linear feedback systems, Laplace-domain filter notation.... It gets complicated fast! One of the cool things about understanding circuits and simulation is that you can use the same concepts and tools to model non-electronics-domain problems: thermal systems, mechanical systems, etc. You can combine these, too: for a simple non-confidential example, we recently did modeling of the fusing of tin whiskers, which involves solving the electrical and thermodynamic properties at the same time.
- yigitdemirag 11y ago(not-related) I'm happy that you show my twitter post on your homepage. I do love using circuitlab.
- compumike 11y agoAwesome -- thanks so much for that! It always makes it a happy day in the office when we hear from happy users :)
- ChuckMcM 11y agoI was going to mention you guys, its a pretty straight forward system. There has been some other work on notational representation of electronics as part of the SPICE work that Berkley did. Also AT&T did some work there, the BLADES papers (http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=31523&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D31523 http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=31523&...) and others have that. Hardward description languages (HDL's) often include an internal way of expressing various things as well. From a purely hobby based approach building something which was a calculator with a resistor, capacitor, and inductor key might be useful. All though if you add two resistors and an inductor what you really want is the frequency response of the RL circuit not the parasitic resistance of the coil added to the resistors.
- bariumbitmap 11y agoInteresting idea, particularly the prompting for uknown quantities, but GNU units already does a pretty good job of this. https://en.wikipedia.org/wiki/GNU_Units https://en.wikipedia.org/wiki/GNU_Units Calculations aren't quite as short as "1mA 3K", but pretty close to it. You have: 1mA 3kohm You want: V * 3 / 0.33333333 It has long and short SI prefixes, scientific notation, implicit multiplication, and a history dating back to Unix itself. By the way, one of the example calculations (calculation of 205 Hz) is too high by a factor 10. You have: 1 / (2 pi 0.5microF sqrt(11kohm 22kohm)) You want: Hz * 20.461734 / 0.048871712
- lkdjiin 11y agoThanks, I should check GNU Units… (and the calculation is now fixed on Github)
- csn 11y agoWhy can't Electr detect unit K form "10K + 200"? It's the only unit present in the equation. Why kilo-ohms are denoted with "K" while milliamperes are using the proper SI unit "mA"? Why not to use "Ω" and "kΩ"? We have that symbol in high ASCII. Probably just my ignorance of programming language design speaking but I really have to ask.
- mallin 11y agoIn practical engineering (on circuit diagrams, bills of materials, etc), you almost never see the "Ω" symbol. "K" is used for kΩ, "M" for MΩ, and "R" for Ω (as in 330R is a 330Ω resistor). It's nothing to do with programming language design.
- lkdjiin 11y agoLike said before it has nothing to do with language design. That said, I like the idea of having Ω, √, etc. But I'm afraid that our keyboards/editors/terminals are still not good to type that kind of characters quickly. But maybe I could use R or Ω, K or KΩ, why not… And yes I think you're right, I could infer that 10K + 200 is 10.2K, like 3V times 2 is 6V, etc
- leni536 11y agoNice idea. Unit handling can be hard though, there are several problems that you can bump into: - It's not always evident what unit you want show after a calculation. (As/Vm or C/Vm, kV/m or V/mm) - You should handle fractional power of units (like V/sqrt(Hz)) I recently discovered orpie and that one has unit handling. It has electrical (and all sort of physical) units and handles both of this problems fairly well. For the calculation result's unit it uses the one that comes evidently from the source terms (1kV* 0.5mA=0.5kV* mA), then the user can convert it to other equivalent units or to SI base units. It's an RPN calculator so one has to get the hang of it. Edit: Oh, electric engineers like to think of "rad" as a unit (like in rad/s and Hz). I think it's impossible to handle it well.
- lkdjiin 11y agoThanks for the advices ;)
- galkk 11y agoVery strange that nobody mentioned relative mainstream language that has the same feature: F# http://fsharpforfunandprofit.com/posts/units-of-measure/ http://fsharpforfunandprofit.com/posts/units-of-measure/
- scotty79 11y agoI wonder why Frink isn't more popular: https://futureboy.us/frinkdocs/ https://futureboy.us/frinkdocs/ ... and why in general programmers like to think about bare numbers and love to differentiate them into floats and ints of various length (like it's the 90-ies) but don't care if they are volts or meters.