Browse Source
Fixed numparam library (Steven Borley) and corrected bug in node translation (Hitoshi Tanaka).
pre-master-46
Fixed numparam library (Steven Borley) and corrected bug in node translation (Hitoshi Tanaka).
pre-master-46
10 changed files with 183 additions and 52 deletions
-
17examples/numparam/example.cir
-
33examples/numparam/pin.mod
-
28examples/numparam/pintest.cir
-
23src/frontend/inpcom.c
-
4src/frontend/numparam/general.h
-
14src/frontend/numparam/mystring.c
-
4src/frontend/numparam/readme.txt
-
66src/frontend/numparam/spicenum.c
-
7src/frontend/numparam/xpressn.c
-
39src/frontend/subckt.c
@ -0,0 +1,17 @@ |
|||||
|
* Param-example |
||||
|
.param amplitude= 1V |
||||
|
|
||||
|
.subckt myfilter in out |
||||
|
+ params: rval=100k cval= 100nF |
||||
|
Ra in p1 {2*rval} |
||||
|
Rb p1 out {2*rval} |
||||
|
C1 p1 0 {2*cval} |
||||
|
Ca in p2 {cval} |
||||
|
Cb p2 out {cval} |
||||
|
R1 p2 0 {rval} |
||||
|
.ends myfilter |
||||
|
|
||||
|
X1 input output myfilter 1k 1nF |
||||
|
V1 input 0 AC {amplitude} |
||||
|
|
||||
|
.end |
||||
@ -0,0 +1,33 @@ |
|||||
|
* PIN model |
||||
|
* line 2 |
||||
|
* line 3 |
||||
|
* -- Summary ------------------------------- |
||||
|
* This is a simple spice model of a PIN diode. |
||||
|
* |
||||
|
* -- Description --------------------------- |
||||
|
* It is a three node device; one input node (relative to ground) and two |
||||
|
* output nodes (cathode and anode) |
||||
|
* |
||||
|
|
||||
|
* -- Model ---------------------------------- |
||||
|
.subckt SIMPLE_PIN input cathode anode params: resp=0.5 |
||||
|
|
||||
|
* Input photocurrent is modled by a voltage |
||||
|
* This generates a current using a linear voltage-controlled current source |
||||
|
Gin dk da input 0 {resp} |
||||
|
Rin input 0 1G |
||||
|
Cin input 0 {resp} |
||||
|
|
||||
|
* The pn-junction that generates this photocurrent in the real device is modelled |
||||
|
* here by a simple diode |
||||
|
Dpn da dk pndiode |
||||
|
|
||||
|
* terminal resistances |
||||
|
Ra anode da 0.001ohm |
||||
|
Rk cathode dk 0.001ohm |
||||
|
|
||||
|
* subsircuit models: |
||||
|
.MODEL pndiode D IS=0.974p RS=0.1 N=1.986196 BV=7.1 IBV=0.1n |
||||
|
+ CJO=99.2p VJ=0.455536 M=0.418717 TT=500n |
||||
|
|
||||
|
.ends |
||||
@ -0,0 +1,28 @@ |
|||||
|
* Test circuit for pin.mod |
||||
|
|
||||
|
.include pin.mod |
||||
|
|
||||
|
* Photodiode supply |
||||
|
Vbias psu 0 10V |
||||
|
|
||||
|
* Light input is modeled by a voltage source that we can vary |
||||
|
Vlight input 0 2mW |
||||
|
|
||||
|
* The pin diode |
||||
|
Xpin input cathode anode SIMPLE_PIN 0.7 |
||||
|
|
||||
|
* monitor resistor |
||||
|
Rmon anode 0 1ohm |
||||
|
|
||||
|
* Quench restistor |
||||
|
Rq psu cathode 1k |
||||
|
|
||||
|
*.dc vlight 0 5mW 0.01mW |
||||
|
|
||||
|
.control |
||||
|
dc vlight 0 10mW 0.01mW |
||||
|
plot V(anode) |
||||
|
.endc |
||||
|
|
||||
|
.end |
||||
|
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue