Code Monkey home page Code Monkey logo

circuit-simulator's People

Contributors

hausen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

circuit-simulator's Issues

Non-ideal Wires cause Singular Matrix error

I think Non-ideal Wires in your version are causing some strange Singular Matrix errors.
It does not happen in Falstad's original version.
Two wires NOT in circuit, but connected to each other, will cause error.
Like this one.
$ 1 5.0E-6 382.76258214399064 43 5.0 43
v 80 240 176 240 0 0 40.0 10.0 0.0 0.0 0.5
s 64 128 144 128 0 0 false
s 176 112 256 112 0 0 false
s 176 240 272 240 0 0 false
r 496 272 576 272 0 100.0
r 496 192 576 192 0 100.0
w 80 240 112 352 0
w 336 192 416 272 0
w 272 240 336 192 0
w 416 192 496 192 0
w 416 272 496 272 0
w 336 192 416 192 0
w 496 192 496 144 0
w 384 64 464 64 0
w 576 144 576 192 0
w 576 192 576 272 0
w 576 272 576 336 0
w 112 352 576 336 0
w 496 272 496 224 0
w 464 64 576 64 0
w 608 224 608 272 0
w 608 272 576 272 0

And this one too.
$ 1 5.0E-6 382.76258214399064 43 5.0 43
v 48 144 144 144 0 0 40.0 10.0 0.0 0.0 0.5
s 176 96 240 96 0 1 false
s 272 128 352 128 0 1 false
s 272 48 352 48 0 1 false
w 528 192 624 192 0
w 240 96 272 128 0
w 480 96 464 160 0
w 176 96 144 144 0
w 448 272 80 256 0
r 384 160 464 160 0 100.0
r 400 96 480 96 0 100.0
w 48 144 80 256 0
w 448 272 464 160 0
w 80 416 224 480 0
w 272 48 240 96 0

Please help if you could, I am trying to use this simulator in an educational product.
Thanks.
Bin

Doesn't seem to work in macOS

I have downloaded the last .dmg and tried it on my MacBook Pro ....

Model Name: MacBook Pro
Processor Name: Dual-Core Intel Core i5
Processor Speed: 2.8 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 3 MB
Hyper-Threading Technology: Enabled
Memory: 8 GB
OS: Big Sur 11.5.2

The nwjs.app just doesn't open any windows when run.

Any guidance anyone?
2021-09-13_19-47-37

Incompatibility with previous export lists

Just built this yesterday and tried to import a saved filed from Falstad's original. The circuit shows up, even functions correctly, but the scope displays don't work properly. I can click any point in the circuit that clearly has a changing voltage and the scope displays no voltage change at all, just a flat 0 line.

Something changed with the format for file importing in this version??

In the picture below, my mouse is hovered over the scope, highlighting the wire to left in blue that is is currently displaying. It's clearly green in the picture, and the text display on the scope even says 15V, but no waveform appears.

falstad_update_error

Non-Ideal Wires Causing Errors

Unfortunately I think the sections of code written to use realistic wires are still causing quite a few errors.

I noticed this problem when one of my circuits ran fine on Falstad's original, but yet fails to converge in this version. Setting the boolean ideal to true inside WireElm allows the circuit to run properly on this version.

Rather difficult to debug, but so far I have traced the error to the program attempting to set one of the nodes to a voltage of 2.6 billion volts.

hausen_error_1

The value of 2.6 billion volts is inserted into the array called "volts". Inside of MosfetElm, this causes execution to run inside one of these if-statements, replacing the value with lastv2 + 0.5.

hausen_error_2

After that, the convergence is set to false, here:

hausen_error_3

This repeats until it has looped the maximum of 5,000 times, where it then fails. Each time the large value of 2.6 billion alternates between being in volts[1] or volts[2]

Now trying to trace this backwards, that result of 2.6 Billion is computed inside lu_solve in the matrix called b. Harder to trace at this point because I don't know which value is incorrect.

It comes from the statement:

b[i] = tot / a[i][i]

tot = -2.6*10^21

hausen_error_4

And a[i][i] = -1*10^12, (in this case i=29)

hausen_error_5

This may or may not be of any help. At this point it becomes much harder because this is getting into all of the matrix calculations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.