concord-consortium / build-ngspice-js

Proof of concept build script that successfully compiles the ngspice circuit simulator to Javascript using Emscripten.
MIT License
14 stars 1 forks source link

Incorrect analysis result #1

Open marfri opened 9 years ago

marfri commented 9 years ago

I get different results when executing an op-analysis with ngspice-js and ngspice. The circuit is as follows:

v1 1 0 5
r1 1 0 2k
.options filetype=ascii
.dc v1 1 1 1
.end

ngspice-js returns v(1) = 1.000000e+00 whereas ngspice (correctly) returns v(1) = 5.000000e+00.

EDIT: The error seems to be that ngspice.js it's own circuit-file creates and uses. If i try to load another circuit-file (by entering the spice commands into the inputs array like it is done in pre.js) ngspice-js returns "No such file or directory". The file i try to load is in the same directory as ngspice.js and ngspice.html.