blob: b151daab57ef97cdbe7b0dd582831679ce20c559 (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
* Author: FOSSEE
* Date:
.subckt scr 3 7 1
* /opt/esim/src/subcircuitlibrary/scr/scr.cir
.model PowerDiode D(
+ Vj=.75
+ Cjo=175p
+ Rs=.25
+ Eg=1.11
+ M=.5516
+ Nbv=1.6989
+ N=1
+ bv=1800
+ Fc=.5
+ Ikf=0
+ Ibv=20.245m
+ Is=2.2E-15
+ Xti=3)
* f2
d1 5 2 PowerDiode
c1 3 9 10u
* f1
v1 8 4 dc 0
v2 6 5 dc 0
* u1 9 1 6 aswitch
r1 7 8 50
r2 3 9 1
Vf2 2 3 0
f2 3 9 Vf2 100
Vf1 4 3 0
f1 3 9 Vf1 10
a1 9 (1 6) u1
* Schematic Name: aswitch, NgSpice Name: aswitch
.model u1 aswitch(log=TRUE cntl_off=0.0 cntl_on=1.0 r_on=1.0 r_off=1.0e12 )
* Control Statements
.ends scr
v1 in gnd sine(0 100 50 0 0)
v2 pulse gnd pulse(0 5 4m 0 0 1m 20m)
r1 in a 100
* u2 in a plot_v2
* u1 in plot_v1
* u3 pulse plot_v1
x1 gnd pulse a scr
.tran 40e-06 40e-03 0e-03
* Control Statements
.control
run
print allv > plot_data_v.txt
print alli > plot_data_i.txt
plot v(in,a)
plot v(in)
plot v(pulse)
.endc
.end
|