blob: 51affce1e31a5c9b35bfef40eedcde6878ffd4b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
*ng_script
* A somewhat complex example:
* This script loads two circuits, then selects circuit 1,
* does three dc simulations, selects circuit 2, does
* two dc simulations on the bipolar table device.
* Always do a 'reset' in between to avoid memory leaks.
* you have to create the bipolar device table first by running
* the table generator table-generator-q-2d.sp
.control
source $inputdir/table-model-bip-2d-1-oc.sp $ circuit 2
source $inputdir/table-model-mos-2d-2-oc.sp $ circuit 1
*** analysis type ***
setcirc 1
dc V1 -0.1 1.7 0.06 V2 0.3 1.7 0.3
plot i(Vs)
plot deriv(i(Vs))
reset
dc v2 0 1.7 0.04
plot i(Vs)
plot deriv(i(Vs))
reset
dc V1 -0.1 1.7 0.06
plot i(Vs2)
setcirc 2
* bipolar model qinn
dc vce 0 5 0.05 ib 0.2u 1.8u 0.4u
*plot i(vee)
*plot v(1) ylimit 0 1
reset
* bipolar from table
dc vce2 0 5 0.05 ib2 0.2u 1.8u 0.4u
plot dc4.i(vee) i(vee2) title 'table q3, q4 output current (i(vee2)) compared to bjt model (dc1.i(vee))'
plot dc4.v(1) v(bb) ylimit 0.6 0.8 title 'table q3, q4 input diode (v(bb)) compared to bjt model (dc1.v(1))'
.endc
|