hausen / circuit-simulator Goto Github PK
View Code? Open in Web Editor NEWPaul Falstad's circuit simulator (with improvements)
Paul Falstad's circuit simulator (with improvements)
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
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.
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.
There is no Draw menu on the Java applet and Java application versions of the simulator. Is this a bug? If not, how can you add new circuit elements to a blank (or any other) circuit?
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.
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.
After that, the convergence is set to false, here:
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
And a[i][i] = -1*10^12, (in this case i=29)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.