Hacker News new | past | comments | ask | show | jobs | submit login
Math, Physics, and Engineering Applets (falstad.com)
133 points by timokoesters 8 months ago | hide | past | favorite | 22 comments



Looks like he used swingjs[0] to port the applets to javascript since it hasn't been possible to run Java applets in a Chrome since v45 circa 2015. Always nice to see web 1 code live on.

[0] https://chemapps.stolaf.edu/swingjs/site/swingjs/examples/


Was hoping someone would comment on that -- he said it so casually, like he just had to the add the "-script"! So glad that you closed the loop. I was looking at what it would look like to setup an AI pipeline to port them to modern responsive typescript + three.js code, but now that I look, it appears that these aren't open source...?


at least the circuit simulator applet is licensed under the gnu gpl


I loaded one of the pages up for fun expecting an error message. My mind was blown when I saw a loading screen and then the applet load. Pretty awesome. I've got to try swingjs with some applets I wrote decades ago.


Falstad circuit simulator, the app(let) that carried thousands of EE students through college, when they should have been writing Spice. (I'm guilty as charged)

I have no idea who this Paul Falstad fella is, but I do owe a big thank you to him!


Well, he's the author of Zsh, for one ...


Must be one of them fabled 10x engineers.


you'd be amazed what you can achieve if you release your software under a free license


holy shit, i had no idea


I didn't expect this to "just work", but it does for me. I don't remember getting java installed. I'm running firefox nightly on windows.


Seems to be a Java -> JS compat layer, like Ruffle.js is for Flash I guess: https://news.ycombinator.com/item?id=39470724


Looking at it closer, many (all?) of these are GWT apps, not applets. GWT was "The React" of 2006.


The 2D Vector fields one crashed on me


Fun! This is the kind of thing I got back into programming for around 2010. Just to toot my own (and my former employer's) horn, I worked on a bunch of the underlying models behind the Concord Consortium activities here: https://learn.concord.org/

They're aimed more at middle and high school, are "curriculum aligned" and developed into classroom-ready form by professional educators, and then Concord researches how well they work in actual classrooms.

We had been using a Java app (and applet) called Molecular Workbench for some of these, but in 2012 we got a Google.org grant to reimplement the same concept but natively running in browsers.


what do the models do, and how are they similar to or different from falstad's applets?


It's very cool. But also, I am surprised that java applets are still working nowadays. I am using safari and I didn't have to install anything.

I honestly thought that java applets was something from the past. I was also surprised by their responsiveness. It's been a while since I saw one running, and I remember them as something clunky and slow.


FTA:

> These are some educational applets I wrote to help visualize various concepts in math, physics, and engineering. They were originally written in Java, but they've mostly been converted to Javascript, so you should be able to view them without a Java-capable browser.


i've been doing a lot of small circuit simulations in paul falstad's circuit.js lately

i've learned a lot of interesting things:

- it's free software under the gnu gpl

- you can download the repo and run the javascript locally when you're offline. for this purpose the 'export as text' file menu option is useful; it gives you a textual representation of the circuit you can copy and paste, so you aren't dependent on tinyurl.com to get your circuit back. like spice, it ignores leading whitespace, which is super convenient if you keep your notes in markdown

- you can set the background to white (under options)

- the list of available devices isn't extensive but it does include a tl431

- the svg export (file menu) is great for including in a web page, but it only includes 'undocked' scopes, and the data that's plotted in them may not be the same as what you see

- the simulations are generally in good agreement with the ngspice simulations i've done, but you have to use a smaller timestep than spice usually chooses (i guess because of the lower order of integration), and unless it's much smaller, it can still have some numerical stability problems

- they run slower than spice, but often the faster feedback loop for interactivity makes up for it

- you can simulate an avr in it at the instruction level with avr8js: https://hackaday.com/2021/06/11/circuit-vr-arduino-virtually... which i don't know how to do in ngspice or any other spice

— ⁂ —

i have some questions, maybe someone knows the answers:

- is there a way to convert spice netlists into circuit.js designs? because that would be pretty useful, especially if i could, say, import a spice model of a 7805 as a subcircuit

- is there a way to convert circuit.js designs into spice netlists? because i feel like the schematic view is a lot clearer than the textual netlist

- is there a way to import and/or export to kicad?

- is there a way to do monte carlo simulation in circuit.js? or at least sensitivity analysis?

— ⁂ —

here are some circuits i've put together in circuit.js this week: http://tinyurl.com/27m6usjw http://tinyurl.com/23u2y4w8 http://tinyurl.com/2cf5kgxc http://tinyurl.com/23qvuylw http://tinyurl.com/27agyg4q http://tinyurl.com/2bssxwjq and last week: http://tinyurl.com/2889h6o8 http://tinyurl.com/2a8by2mq (happy to explain any of these if anyone is curious)


It has apparently been longer since I was a TA for an electronics class in college than I realized. I appear to have lost most of that knowledge. I would love a one-sentence explanation of what each of these circuits you put together are meant to demonstrate, if you're up for it.


in many cases i wasn't trying to demonstrate things but trying to find things out

http://tinyurl.com/27m6usjw rc-filtering a (badly simulated) rc-filtered gpio pin to observe the v-i curve of a diode over the relevant range to measure its temperature

http://tinyurl.com/23u2y4w8 checking an input-protection design sketch for a 500kbps open-drain communications bus to make sure it doesn't degrade the signal too much

http://tinyurl.com/2cf5kgxc adaptor for probing a logic circuit with your cellphone's headphone jack without risk of blowing up your phone or loading down the circuit (though probably just a resistor would be fine for this actually)

http://tinyurl.com/23qvuylw simple linear circuit to supply 5 volts at up to 100 milliamps that won't burn up or drag your power rail down to ground if you short-circuit it, or if you accidentally connect a conflicting voltage source to it

http://tinyurl.com/27agyg4q placing a diode-connected transistor used as a temperature probe in between two rc-filtered gpio pins in order to be able to measure its v-i curve repeatedly at different voltage levels to cancel out possible nonlinearity in the adc you're using to measure it

http://tinyurl.com/2bssxwjq 5-volt linear voltage regulator limited to 150 milliamps with only three transistors and four resistors, eliminating the requirement in the original circuit (from the tektronix 576 curve tracer) for a precisely regulated -12.5 volt rail, but sacrificing some output impedance

http://tinyurl.com/2889h6o8 running several individually switchable devices, including one using a high-precision tl431-based 5-volt regulator, from a 100-milliamp linear regulated current supply over a high-resistance wire, whose unknown temperature-varying voltage drop doesn't affect the current regulator at all, unlike the conventional constant-voltage type of power supply

http://tinyurl.com/2a8by2mq walt jung's gled431, an ultra-low-noise non-temperature-compensated 2.5-volt voltage reference circuit using the forward drop of a lite-on green led as the reference voltage

you could maybe complain a bit that these are a little repetitive, since three of them center around variations on the same standard linear current-source circuit, but it wasn't at all obvious to me how to adapt it to those three cases

overwhelmingly more details in log.md in

    git clone http://canonical.org/~kragen/sw/leatherdrink.git


Retro Ciechanowski


cool




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: