B4J Question Attempt to create a simulation tool for electronic components,,,

rbghongade

Well-Known Member
Licensed User
Longtime User
Dear friends,
With Erel's encouragement, I shall be attempting to create a spice (SIMULATION PROGRAM WITH INTEGRATED CIRCUIT EMPHASIS) like software (free for the students) using an already existing simulation engine JSpice (https://github.com/knowm/jspice). The requirement is to access the methods (maybe a wrapper) in this library.
Suggestions and help are most welcome.
 

derez

Expert
Licensed User
Longtime User
How to do sweep without the jspice ?
Two ways:
1. The Software way, run a simulation loop where the value of the resistor R is changed by steps, draw the results of I on that resistor.
2. The Engineer way - use Thevenin theorem, replace the whole network by a voltage source Vt and a resistor Rt, connect the resistor R in series and run I = Vt/(Rt+R), draw the results. Vt is found by running the simulation without the sweep resistor and noting the V on the nodes of the missing resistor. For Rt - delete the I sources, replace the V sources by resistor with 0 ohms (short), put a Vx source on the nodes of the resistor R and run the simulation. Rt = Vx / I(Vx)

Example: To run a sweep on R5 in the above network I delete R5 and run, get V(3) = 5.71 volt.
I delete I1, delete V1 and put instead a resistor of 0 ohm, add V 0f 10 v between nodes 0 and 3 . run and get I(V) = 19.1 mA, so the equivalent Resistance Rt is 10/0.0191 = 524 ohm. (this is what you get from 1/(1/1000+1/1100) just to make sure that the theorem works )
The sweep should be run for I = 5.71/(R+524)
 
Last edited:
Upvote 0
Top