Skip to content

Instantly share code, notes, and snippets.

Created August 29, 2011 20:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/1179366 to your computer and use it in GitHub Desktop.
* Inductance-2.asc for Prometheus Project base line model.
*
* You probably want to start this with
* spice -i Inductance-2.net
* or some such.
* In order to maintain cross program/platform compatibility
* you should probably stick to the original Spice 3 manual
* whenever possible.
* Thyristor model ; really crude
*
.model MySwitch SW(Ron=.1 Roff=1Meg Vt=3 Vh=0)
* circuit
* Raw supply
V1 N002 0 450
* charging resistor
R1 N003 N002 1K
* Storage capacitor
C1 N003 0 .015
* wiring between caps and switch
R3 N004 N003 .1
* Temporary switch to replace thyristor
S1 N005 N004 N001 0 MySwitch
* Switch pulser
V2 N001 0 PULSE(0 5 5ms 0 0 200ms 1sec )
*Inductance of coil and wiring
L1 N006 N007 0.1mH
*Coil resistance
R2 N006 N005 .180
* R4 is current sense
R4 N007 0 .001
* A kludge to stop the graphics from autoscaling
* humongously when the switch turns off.
* This is a switch model artifact and can be
*removed
* D1 N007 N006 D
* .model D D
* control lines
.tran .1ms 1 0 .1ms
* .plot tran V(N:exi
* .control commands are equivalent to commands in interactive
* mode.
.control
run
* Current sense scaled by 1/R4 value
* xlimit: start end of plot window
* xdel x axis grid lines
plot n007*1000 xlimit 0 .2 xdel .02
.endc
.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment