sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
2.35k stars 642 forks source link

Export V/I #427

Closed mrquincle closed 4 years ago

mrquincle commented 4 years ago

Hi, we're working on load identification using V/I trajectories. It's cool how you can visualize all the different ones. For example, consider this set of loads (it's from a paper, I'll be able to get it for you if you're interested in it).

2-Figure1-1(2)

It is cool to try to create the different plots. The fun ones to try to create are the higher-order ones. Something like (e) but not exactly:

ac_and_dc_and_l_vs_c

We're subsequently running classifiers on those VI trajectories. What would we need to do to extract the data from the (falstad) simulator, to do so? Can we obtain it through the browser's console somehow?

Or even better. Is it a nice idea to have export functions for current/voltage data in the menu?

mrquincle commented 4 years ago

Ah, I found out I can export voltages via "Draw", "Outputs and Labels", "Add Data Export". I then can export voltage information, http://tinyurl.com/wawqn4v.

Can I export current data as well? Preferably synced. :-)

pfalstad commented 4 years ago

You just need to use a current controlled voltage source to convert the current to voltage:

http://tinyurl.com/u83gq83

mrquincle commented 4 years ago

Sweet!! That works splendidly! Let's see if I can bump the resolution on this thing.

original_data txt

mrquincle commented 4 years ago

Mmm... It is not possible to sync it somehow I guess?

pfalstad commented 4 years ago

Options->other options will let you set the time step size to a smaller value.

pfalstad commented 4 years ago

If you click reset first, then both data outputs will start from the same point...

mrquincle commented 4 years ago

It is fabulous!! Really great. http://tinyurl.com/vgfgs5f I set it at 1us and enlarged the buffer to around 100.000 data points. This is the result.

original_data txt

Thank you so much!

mrquincle commented 4 years ago

Starting with black dots, to show time progression...

original_data txt

Feel free to close this issue!

mrquincle commented 4 years ago

If you want to play with this yourself. Here's an R script: https://gist.github.com/mrquincle/e00ebd6034a4c565446c07480ab28af6

mrquincle commented 4 years ago

A very low-priority request would then be to perhaps allow also for an easier way to export voltage/current simultaneously (without adjusting the circuit, clicking restart, and right clicking different export labels, and hoping that you've synced data). I often downloaded either the same data, or not synced data, or made other dumb mistakes. :-)