How to fix stanford pisces Internal error - simulation

I have successfully compiled the following repository pisces with ubuntu 20.04.
https://github.com/ComputerWhisperer/pisces
I used gcc-5 and gfortran-5 at compile time.
Then, I ran mosfet.p2 with pisces from the pdf of the following university (Sorry, in japanese).
http://www.nuee.nagoya-u.ac.jp/labs/nakazatolab/nakazato/2005Lids/Lids3.pdf
(mosfet.p2)
Title Short Channel (L = 1.5 um) MOSFET
mesh infile = ldd.mesh geom
symb gummel carr = 1 electrons
method iccg damped
mater num = 4 g.surf = 0.75
contact num = 1 n.poly
models conmob temp = 300 fldmob print
solve initial
solve v1 = 0.6 vstep = 0.6 nsteps = 2 electrode = 1
log outf = log
solve v1 = 1.8
symb newton carriers = 1 electrons
method itlimit = 50 autonr
solve v2 = 0.1 vstep = 0.1 nsteps = 17 electrode = 2
plot.1d x.axis = v2 y.axis = i2
end
But,
solve initial
At that point, the device simulation is interrupted.
Screen output.
********* PISCES-II Device Modeling Program *********
(Version 9009-S.0523 SunOS 4.1)
Date and time = 20-May-21 14:55:39
1 ... Title Short Channel (L = 1.5 um) MOSFET
2 ... mesh infile = ldd.mesh geom
3 ... symb gummel carr = 1 electrons
4 ... method iccg damped
5 ... mater num = 4 g.surf = 0.75
6 ... contact num = 1 n.poly
7 ... models conmob temp = 300 fldmob print
8 ... solve initial
9 ... solve v1 = 0.6 vstep = 0.6 nsteps = 2 electrode = 1
10 ... log outf = log
11 ... solve v1 = 1.8
12 ... symb newton carriers = 1 electrons
13 ... method itlimit = 50 autonr
14 ... solve v2 = 0.1 vstep = 0.1 nsteps = 17 electrode = 2
15 ... plot.1d x.axis = v2 y.axis = i2
16 ... end
*******************************
Short Channel (L = 1.5 um) MOSFET
*******************************
Read geometry from file ldd.mesh
Mesh statistics:
Total grid points = 2273
Total no. of triangles = 4310
Obtuse triangles = 539 (12.5%)
** Warning in line # 5
Invalid parameter specified for an insulator! 36
Gummel method carriers = 1 Electrons
Constants:
Boltzmanns k = 8.61700E-05
charge = 1.60200E-19
permittivity = 8.85400E-14
Temperature = 300.
Thermal voltage = 0.025851
Material data:
Num Type Rel Permit
1 1 11.80
2 -1 3.90
3 -1 3.90
4 -1 3.90
5 -1 3.90
Semiconductor data:
type = 1.0000
rel permit = 11.800
log10 (ni) = 10.160
n-mobility = 1000.0
p-mobility = 500.00
vsat = 1.03494E + 07
taup0 = 1.00000E-07
taun0 = 1.00000E-07
egap (300) = 1.0800
egalpha = 4.73000E-04
egbeta = 636.00
affinity = 4.1700
egap = 1.0800
cnau = 2.80000E-31
cpau = 9.90000E-32
An ** = 110.00
Ap ** = 30.000
Nc = 2.80000E + 19
Nv = 1.04000E + 19
gcb = 2.0000
gvb = 4.0000
edb = 4.40000E-02
eab = 4.50000E-02
Contacts:
Num Work fn. Vsurfn Vsurfp Resistance Capacitance
1 4.170 0.000000E + 00 0.000000E + 00 0.000000E + 00 0.000000E + 00
2 0.000 0.000000E + 00 0.000000E + 00 0.000000E + 00 0.000000E + 00
3 0.000 0.000000E + 00 0.000000E + 00 0.000000E + 00 0.000000E + 00
4 0.000 0.000000E + 00 0.000000E + 00 0.000000E + 00 0.000000E + 00
5 0.000 0.000000E + 00 0.000000E + 00 0.000000E + 00 0.000000E + 00
Model flags:
SRH recombination = F
Conc. dep. lifetime = F
Auger recombination = F
Band-gap narrowing = F
Conc. Dep. Mobility = T
Field dep. Mobility = T
CCS dep. mobility = F
Analytic mobility = F
Arora mobility = F
Trans. E. mobility = F
Impact Ionization = F
Cylindrical coords = F
Photogeneration = F
Mobility model parameters:
Gsurf = 7.500000E-01
B.elect = 2.000000E + 00
B.hole = 1.000000E + 00
Internal error in vmin / vmax calculation, elect = 4
nb = 107 nelect = 5
** Internal error occurs when executing solve initial.
In addition, suprem is
https://github.com/cogenda/Suprem4
I made it with the master branch of.
Above
http://www.nuee.nagoya-u.ac.jp/labs/nakazatolab/nakazato/2005Lids/Lids3.pdf
From
I edited and ran ldd.s4 to create ldd.mesh.
(ldd.s4)
line x loc = 0.0 tag = lft spacing = 0.25
line x loc = 0.45 spacing = 0.03
line x loc = 0.75 spacing = 0.03
line x loc = 1.4 spacing = 0.25
line x loc = 1.5 tag = rht spacing = 0.25
line y loc = 0.0 tag = top spacing = 0.01
line y loc = 0.1 spacing = 0.01
line y loc = 0.25 spacing = 0.05
line y loc = 3.0 tag = bot
region silicon xlo = lft xhi = rht ylo = top yhi = bot
bound exposed xlo = lft xhi = rht ylo = top yhi = top
bound backside xlo = lft xhi = rht ylo = bot yhi = bot
init boron conc = 1.0e16
deposit oxide thick = 0.025
implant boron dose = 1.0e12 energy = 15.0
deposit poly thick = 0.50 div = 10 phos conc = 1.0e19
diff time = 10 temp = 1000
etch poly right p1.x = 0.55 p1.y = -0.020 p2.x = 0.45 p2.y = -0.55
diffuse time = 30.0 temp = 950
implant phos dose = 1.0e13 energy = 50.0
deposit oxide thick = 0.400 spac = 0.05
etch dry oxide thick = 0.420
method vert fermi grid.ox = 0.0
diffuse time = 30 temp = 950 dry
implant ars dose = 5.0e15 energy = 80.0
deposit oxide thick = 0.15 space = 0.03
diffuse time = 20 temp = 950
#put down the aluminum
deposit alum thick = 0.1
#reflect the structure
struct mirror left
#etch off aluminum
etch alum start x = -1.4 y = 0.1
etch continue x = 1.4 y = 0.1
etch continue x = 1.4 y = -0.7
etch done x = -1.4 y = -0.7
plot.2d boundary
#save it in Pisces format
struct pisces = ldd.mesh
In order for pisces not to output an Internal error
What should I do with solve initial in mosfet.p2?

Changed ldd.s4 as follows.
(ldd.s4)
line x loc = 0.0 tag = lft spacing = 0.25
line x loc = 0.45 spacing = 0.03
line x loc = 0.75 spacing = 0.03
line x loc = 1.4 spacing = 0.25
line x loc = 1.5 tag = rht spacing = 0.25
line y loc = 0.0 tag = top spacing = 0.01
line y loc = 0.1 spacing = 0.01
line y loc = 0.25 spacing = 0.05
line y loc = 3.0 tag = bot
region silicon xlo = lft xhi = rht ylo = top yhi = bot
bound exposed xlo = lft xhi = rht ylo = top yhi = top
bound backside xlo = lft xhi = rht ylo = bot yhi = bot
init boron conc = 1.0e16
deposit oxide thick = 0.025
implant boron dose = 1.0e12 energy = 15.0
deposit poly thick = 0.50 div = 10 phos conc = 1.0e19
diff time = 10 temp = 1000
etch poly right p1.x = 0.55 p1.y = -0.020 p2.x = 0.45 p2.y = -0.55
diffuse time = 30.0 temp = 950
implant phos dose = 1.0e13 energy = 50.0
deposit oxide thick = 0.400 spac = 0.05
etch dry oxide thick = 0.420
method vert fermi grid.ox = 0.0
diffuse time = 30 temp = 950 dry
implant ars dose = 5.0e15 energy = 80.0
deposit oxide thick = 0.15 space = 0.03
diffuse time = 20 temp = 950
plot.2d bound
struct pisc = ldd.mesh
Then I ran pisces mosfet.p2 and it looks like this:
(pisces ./mosfet.p2)
********* PISCES-II Device Modeling Program *********
(Version 9009-S.0523 SunOS 4.1)
Date and time = 26-May-21 19:38:47
1 ... Title Short Channel (L = 1.5 um) MOSFET
2 ... mesh infile = ldd.mesh geom
3 ... symb gummel carr = 1 electrons
4 ... method iccg damped
5 ... mater num = 4 g.surf = 0.75
6 ... contact num = 1 n.poly
7 ... models conmob temp = 300 fldmob print
8 ... solve initial
9 ... solve v1 = 0.6 vstep = 0.6 nsteps = 2 electrode = 1
10 ... log outf = log
11 ... solve v1 = 1.8
12 ... symb newton carriers = 1 electrons
13 ... method itlimit = 50 autonr
14 ... solve v2 = 0.1 vstep = 0.1 nsteps = 17 electrode = 2
15 ... plot.1d x.axis = v2 y.axis = i2
16 ... end
*******************************
Short Channel (L = 1.5 um) MOSFET
*******************************
Read geometry from file ldd.mesh
Mesh statistics:
Total grid points = 1150
Total no. of triangles = 2154
Obtuse triangles = 269 (12.5%)
** Warning in line # 5
Invalid parameter specified for an insulator! 36
Gummel method carriers = 1 Electrons
Constants:
Boltzmanns k = 8.61700E-05
charge = 1.60200E-19
permittivity = 8.85400E-14
Temperature = 300.
Thermal voltage = 0.025851
Material data:
Num Type Rel Permit
1 1 11.80
2 -1 3.90
3 -1 3.90
4 -1 3.90
5 -1 3.90
Semiconductor data:
type = 1.0000
rel permit = 11.800
log10 (ni) = 10.160
n-mobility = 1000.0
p-mobility = 500.00
vsat = 1.03494E + 07
taup0 = 1.00000E-07
taun0 = 1.00000E-07
egap (300) = 1.0800
egalpha = 4.73000E-04
egbeta = 636.00
affinity = 4.1700
egap = 1.0800
cnau = 2.80000E-31
cpau = 9.90000E-32
An ** = 110.00
Ap ** = 30.000
Nc = 2.80000E + 19
Nv = 1.04000E + 19
gcb = 2.0000
gvb = 4.0000
edb = 4.40000E-02
eab = 4.50000E-02
Contacts:
Num Work fn. Vsurfn Vsurfp Resistance Capacitance
1 4.170 0.000000E + 00 0.000000E + 00 0.000000E + 00 0.000000E + 00
2 0.000 0.000000E + 00 0.000000E + 00 0.000000E + 00 0.000000E + 00
Model flags:
SRH recombination = F
Conc. dep. lifetime = F
Auger recombination = F
Band-gap narrowing = F
Conc. Dep. Mobility = T
Field dep. Mobility = T
CCS dep. mobility = F
Analytic mobility = F
Arora mobility = F
Trans. E. mobility = F
Impact Ionization = F
Cylindrical coords = F
Photogeneration = F
Mobility model parameters:
Gsurf = 7.500000E-01
B.elect = 2.000000E + 00
B.hole = 1.000000E + 00
Solution for bias:
V1 = 0.0000000E + 00 V2 = 0.0000000E + 00
Initial solution
Warning --ICCG not converging
Switching to direct LU for this iteration
p-iter c-iter psi-error n-error p-error
1 2.3432E + 01
Warning --ICCG not converging
Switching to direct LU for this iteration
2 1.0951E + 01
Warning --ICCG not converging
Switching to direct LU for this iteration
3 4.1479E + 00
4 1.1738E + 00
Warning --ICCG not converging
Switching to direct LU for this iteration
5 1.1284 E-01
Warning --ICCG not converging
Switching to direct LU for this iteration
6 1.5466E-03
Warning --ICCG not converging
Switching to direct LU for this iteration
7 1 5.5300E-07 1.1362E-14 0.0000E + 00
8 2 8.7875E-15 2.9333E-15 0.0000E + 00
Electrode Voltage Electron Current Hole Current Conduction Current
(Volts) (amps / micron) (amps / micron) (amps / micron)
1 0.0000 -0.00000E + 00 -0.00000E + 00 -0.00000E + 00
2 0.0000 2.28455E-32 -0.00000E + 00 2.28455E-32
Electrode Flux Displacement Current Total Current
(coul / micron) (amps / micron) (amps / micron)
1 3.46222E-16 0.00000E + 00 0.00000E + 00
2 -1.82419E-26 0.00000E + 00 2.28455E-32
Absolute convergence criterion met for Poisson
Absolute convergence criterion met for continuity
Total cpu time for bias point = 0.06
Total cpu time = 0.08
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
Solution for bias:
V1 = 6.0000002E-01 V2 = 0.0000000E + 00
Previous solution used as initial guess
Warning --ICCG not converging
Switching to direct LU for this iteration
p-iter c-iter psi-error n-error p-error
1 2.3210E + 01
2 2.3356E + 00
3 9.9053E-01
Warning --ICCG not converging
Switching to direct LU for this iteration
4 9.5441 E-01
5 8.1053E-01
Warning --ICCG not converging
Switching to direct LU for this iteration
6 4.6211E-01
7 1.0489E-01
Warning --ICCG not converging
Switching to direct LU for this iteration
8 4.1305E-03
Warning --ICCG not converging
Switching to direct LU for this iteration
9 1 5.9992E-06 1.1531E-14 0.0000E + 00
10 2 6.8864E-15 6.9463E-15 0.0000E + 00
Electrode Voltage Electron Current Hole Current Conduction Current
(Volts) (amps / micron) (amps / micron) (amps / micron)
1 0.6000 -0.00000E + 00 0.00000E + 00 0.00000E + 00
2 0.0000 3.75532E-32 0.00000E + 00 3.75532E-32
Electrode Flux Displacement Current Total Current
(coul / micron) (amps / micron) (amps / micron)
1 6.26181E-16 0.00000E + 00 0.00000E + 00
2 -1.82967E-26 0.00000E + 00 3.75532E-32
Absolute convergence criterion met for Poisson
Absolute convergence criterion met for continuity
Total cpu time for bias point = 0.05
Total cpu time = 0.13
Solution for bias:
V1 = 1.2000000E + 00 V2 = 0.0000000E + 00
Projection used to find initial guess
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
p-iter c-iter psi-error n-error p-error
1 2.3057E + 00
2 9.9999E-01
3 1.8374E + 02
Warning --ICCG not converging
Switching to direct LU for this iteration
4 3.8682 E + 01
5 9.9957E-01
6 9.9857E-01
7 9.9521E-01
8 2.9386E + 00
Warning --ICCG not converging
Switching to direct LU for this iteration
9 2.9 147E + 00
10 8.4660E-01
11 6.1511 E-01
12 2.6687E-01
Warning --ICCG not converging
Switching to direct LU for this iteration
13 3.7334E-02
14 6.3672 E-04
Warning --ICCG not converging
Switching to direct LU for this iteration
15 1 3.4358E-06 1.1966E-14 0.0000E + 00
16 2 5.5567E-15 7.1786E-15 0.0000E + 00
Electrode Voltage Electron Current Hole Current Conduction Current
(Volts) (amps / micron) (amps / micron) (amps / micron)
1 1.2000 -0.00000E + 00 -0.00000E + 00 -0.00000E + 00
2 0.0000 4.54473E-32 -0.00000E + 00 4.54473E-32
Electrode Flux Displacement Current Total Current
(coul / micron) (amps / micron) (amps / micron)
1 1.06838E-15 0.00000E + 00 0.00000E + 00
2 -1.83123E-26 0.00000E + 00 4.54473E-32
Absolute convergence criterion met for Poisson
Absolute convergence criterion met for continuity
Total cpu time for bias point = 0.06
Total cpu time = 0.18
Solution for bias:
V1 = 1.8000001E + 00 V2 = 0.0000000E + 00
Projection used to find initial guess
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
p-iter c-iter psi-error n-error p-error
1 9.7099E-01
2 9.2042E-01
Warning --ICCG not converging
Switching to direct LU for this iteration
3 7.9295E-01
4 5.3167 E-01
5 1.9655E-01
6 2.1050E-02
Warning --ICCG not converging
Switching to direct LU for this iteration
7 2.2976E-03
8 1 2.1611E-08 8.1258E-15 0.0000E + 00
9 2 1.8033E-14 2.9538E-15 0.0000E + 00
Electrode Voltage Electron Current Hole Current Conduction Current
(Volts) (amps / micron) (amps / micron) (amps / micron)
1 1.8000 -0.00000E + 00 0.00000E + 00 0.00000E + 00
2 0.0000 2.47781E-32 0.00000E + 00 2.47781E-32
Electrode Flux Displacement Current Total Current
(coul / micron) (amps / micron) (amps / micron)
1 1.55386E-15 0.00000E + 00 0.00000E + 00
2 -1.83165E-26 0.00000E + 00 2.47781E-32
Absolute convergence criterion met for Poisson
Absolute convergence criterion met for continuity
Total cpu time for bias point = 0.04
Total cpu time = 0.22
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
Solution for bias:
V1 = 1.8000000E + 00 V2 = 0.0000000E + 00
Projection used to find initial guess
p-iter c-iter psi-error n-error p-error
1 1 5.0496E-08 6.5467E-15 0.0000E + 00
Warning --ICCG not converging
Switching to direct LU for this iteration
2 2 5.1730E-09 3.4275E-15 0.0000E + 00
Electrode Voltage Electron Current Hole Current Conduction Current
(Volts) (amps / micron) (amps / micron) (amps / micron)
1 1.8000 -0.00000E + 00 -0.00000E + 00 -0.00000E + 00
2 0.0000 5.78572E-32 -0.00000E + 00 5.78572E-32
Electrode Flux Displacement Current Total Current
(coul / micron) (amps / micron) (amps / micron)
1 1.55386E-15 0.00000E + 00 0.00000E + 00
2 -1.83165E-26 0.00000E + 00 5.78572E-32
Absolute convergence criterion met for Poisson
Absolute convergence criterion met for continuity
Total cpu time for bias point = 0.02
Total cpu time = 0.25
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
** Warning in line # 0
Small pivot had to be fixed during incomplete factorization --ICCG is in difficulty.738
Solution for bias:
V1 = 1.8000000E + 00 V2 = 1.0000000E-01
Previous solution used as initial guess
iter psi-error n-error p-error
1 9.7924E-01 1.1696E + 00 0.0000E + 00
2 9.4461E-01 2.4172E + 00 0.0000E + 00
3 3.5434E + 01 9.7816E-01 0.0000E + 00
4 6.7550E + 00 4.7057E + 00 0.0000E + 00
5 4.3743E + 00 4.7430E + 00 0.0000E + 00
6 2.4091E + 00 6.4758E + 00 0.0000E + 00
7 8.5386E-01 1.7228E + 02 0.0000E + 00
8 9.9325E-02 4.5727E + 01 0.0000E + 00
9 * 9.9125E-02 6.0700E-01 0.0000E + 00
10 5.3139E-02 9.9966E-01 0.0000E + 00
11 * 5.3144E-02 2.3083E-02 0.0000E + 00
12 7.4757E-02 2.0760E-01 0.0000E + 00
13 5.1106E-02 2.2708E-02 0.0000E + 00
14 5.4977E-02 2.4046E-02 0.0000E + 00
15 1.6516E-01 7.1058E-02 0.0000E + 00
16 6.9029E-02 2.8302E-02 0.0000E + 00
17 7.0727E-02 3.0941E-02 0.0000E + 00
18 5.9970E-02 2.7111E-02 0.0000E + 00
19 1.4453E-01 6.3741E-02 0.0000E + 00
20 1.1600E-01 5.0619E-02 0.0000E + 00
21 3.7983E-02 1.6272E-02 0.0000E + 00
22 3.8026E-02 1.7518E-02 0.0000E + 00
23 1.2794E-01 5.8200E-02 0.0000E + 00
24 2.5246E-02 1.3028E-02 0.0000E + 00
25 * 2.5245E-02 1.1592E-02 0.0000E + 00
26 4.6918E-02 2.1424E-02 0.0000E + 00
27 3.3700E-01 1.5601E-01 0.0000E + 00
28 1.2478E-01 6.3979E-02 0.0000E + 00
29 1.1582E-01 5.2105E-02 0.0000E + 00
30 2.5380E-02 1.1970E-02 0.0000E + 00
31 * 2.5378E-02 1.0935E-02 0.0000E + 00
32 8.9952E-02 3.8959E-02 0.0000E + 00
33 6.9398E-02 3.0246E-02 0.0000E + 00
34 7.8585E-02 3.3048E-02 0.0000E + 00
35 3.6101E-02 1.5893E-02 0.0000E + 00
36 4.0608E-02 1.7227E-02 0.0000E + 00
37 1.1913E + 00 5.1002E-01 0.0000E + 00
38 1.6712E + 00 7.6782E-01 0.0000E + 00
39 1.7433E-01 1.0673E + 00 0.0000E + 00
40 * 4.2024E-02 3.2193E-02 0.0000E + 00
41 4.3470E-02 2.8632E-02 0.0000E + 00
42 2.9936E-02 1.8434E-02 0.0000E + 00
43 5.0113E-02 3.0157E-02 0.0000E + 00
44 2.4720E-02 1.5407E-02 0.0000E + 00
45 5.4076E-02 3.2707E-02 0.0000E + 00
46 1.2671E-01 7.7875E-02 0.0000E + 00
47 1.2971E-01 7.5825E-02 0.0000E + 00
48 4.1093E-02 2.2797E-02 0.0000E + 00
49 * 4.1096E-02 2.5519E-02 0.0000E + 00
50 4.1441E-02 2.4940E-02 0.0000E + 00
Electrode Voltage Electron Current Hole Current Conduction Current
(Volts) (amps / micron) (amps / micron) (amps / micron)
1 1.8000 -0.00000E + 00 -0.00000E + 00 -0.00000E + 00
2 0.1000 -5.85968E-18 -0.00000E + 00 -5.85968E-18
Electrode Flux Displacement Current Total Current
(coul / micron) (amps / micron) (amps / micron)
1 8.54356E-16 0.00000E + 00 0.00000E + 00
2 -2.04272E-25 0.00000E + 00 -5.85968E-18
Total cpu time for bias point = 0.54
Total cpu time = 0.81
*** Warning ***
This solution has not converged to the selected tolerances!
Solution for bias:
V1 = 1.8000000E + 00 V2 = 2.0000000E-01
Projection used to find initial guess
iter psi-error n-error p-error
1 5.8878E + 17 5.8989E + 16 0.0000E + 00
2 8.6348E + 18 6.1800E + 00 0.0000E + 00
3 3.4686E + 18 4.8415E + 15 0.0000E + 00
4 1.0680E + 18 1.0000E + 00 0.0000E + 00
** Error in line # 14
Numerical value of pivot # 99 is approximately zero in vmnp routine --no solution possible.
Try a different bias point.
********* PISCES Aborted **********
This time I got an error on line14 of mosfet.p2.
"Try a different bias point."
I don't really understand the meaning.
I will come back again.
Please let me know if you have a reference book (About ldd, etc).

Related

affine transformation and `imtransform`

I am trying to follow this MATLAB example.
Please see Step 2, the example used a 128 * 27 matrix M2, and use affine transform to scale and rotate M2, the scale factor is 2.5. However, I expect the size of the result should be 67.5 * 128 (since 27 * 2.5 = 67.5, I do not think it works, but I have no idea how to handle double in this case), the actual result done by MATLAB is 66 * 128.
How to derive the 66 in this case?
I tried to change the scale factor to 2, and the result is 53 * 128, and I expect it to be 54 * 128 since 27 * 2 = 54.
load mri
M1 = D(:,64,:,:);
M2 = reshape(M1,[128 27]);
T0 = maketform('affine',[0 -2.5; 1 0; 0 0]);
res = imtransform(M2,T0,'cubic')
size(res) // 66 * 128
A matrix with 27 elements has coordinates going from 0 through 26 (these are the coordinates used by imtransform). After scaling by 2.5, these coordinates go from 0 through 26*2.5 = 65. To hold x-coordinates from 0 through 65 you need 66 elements.

Print all entries after a pattern without including the pattern - awk

Consider the following input file
* Z1 Z2 A1pre A2pre A1post A2post I1pre I2pre I1gs I2gs Eexc1 Eexc2 n1 n2 TKEpre TKEpost
* Z1: Atomic number of first fragment
* Z2: Atomic number of second fragment
* A1pre: Pre-neutron mass number of first fragment
* A2pre: Pre-neutron mass number of second fragment
* A1post: Post-neutron mass number of first fragment
* A2post: Post-neutron mass number of second fragment
* I1pre: Spin of first fragment after scission
* I2pre: Spin of second fragment after scission
* I1gs: Ground-state spin of first fragment
* I2gs: Ground-state spin of second fragment
* Eexc1: Excitation energy of first fragment [MeV]
* Eexc2: Excitation energy of second fragment [MeV]
* n1: Prompt neutrons emitted from first fragment
* n2: Primpt neutrons emitted from second fragment
* TKEpre: Pre-neutron total kinetic energy [MeV]
* TKEpost: Post-neutron total kinetic energy [MeV]
* Calculation with nominal model parameters
38 54 97 138 94 136 5.5 9.0 0.0 0.0 21.72 14.78 3 2 159.43 156.00
39 53 101 134 99 133 2.5 4.0 2.5 3.5 17.12 12.93 2 1 166.45 161.75
36 56 92 143 91 143 3.0 11.5 2.5 2.5 12.27 7.81 1 0 170.00 168.44
38 54 93 142 92 141 3.5 7.0 0.0 2.5 13.94 9.81 1 1 168.95 163.96
40 52 99 136 98 135 2.5 6.0 0.0 3.5 9.28 13.10 1 1 177.04 172.75
40 52 100 135 98 134 0.0 6.5 0.0 0.0 14.74 10.13 2 1 176.61 173.55
What I want to do is to print specific columns following the Calculation with nominal model parameters pattern.
So far I've tried
awk '{/Calculation with nominal model parameters/;line=FNR}{for(i=0;i<=NR-19;++i){getline;print $5 "\t" $6 "\t" $16 "\t" $16*$6/($5+$6) "\t" $16*$5/($5+$6)}}{print line}' input
and my output is more or less what I want
88 144 159.10 98.7517 60.3483
87 146 164.87 103.309 61.5609
92 141 163.96 99.2204 64.7396
98 135 172.75 100.091 72.6588
98 134 173.55 100.24 73.3099
98 134 173.55 100.24 73.3099
19
As you can see the two last lines are identical. My goal is to avoid calculating the same thing twice. To achieve that I thought that I should finish the loop after NR-NFR_pattern, that's why I used line variable.
The weird thing is that even if I hardcode the pattern's NFR I don't get the desired output.
The weirdest thing is that if I replace the hardcoded NFR with the variable that has the NFR information i.e.
awk '{/Calculation with nominal model parameters/;line=FNR}{for(i=0;i<=NR-line;++i){getline;print $5 "\t" $6 "\t" $16 "\t" $16*$6/($5+$6) "\t" $16*$5/($5+$6)}}' input
I get the error
awk: (FILENAME=input FNR=2) fatal: division by zero attempted
Any idea how to solve this?
What you are missing, I think, is that getline changes NR:
getline Set $0 from next input record; set NF, NR, FNR, RT.
I wouldn't use getline at all.
awk 'isdata{print $5 "\t" $6 "\t" $16 "\t" $16*$6/($5+$6) "\t" $16*$5/($5+$6)}
/Calculation with nominal model parameters/{isdata="yes"}' input
I get:
94 136 156.00 92.2435 63.7565
99 133 161.75 92.7274 69.0226
91 143 168.44 102.936 65.5044
92 141 163.96 99.2204 64.7396
98 135 172.75 100.091 72.6588
98 134 173.55 100.24 73.3099

Base 36 counter without I or O

we have a requirement to make our serial numbers Base 36 (0-9,A-Z). My initial thought was store the counter in decimal and convert to hex only when required for display. This makes the counting simple, however there is another requirement to not use I or O because it'll be confused with 1 and 0 on the barcodes human readable portion. This makes it a bit of a nightmare.
Language is unimportant, but the counter itself will be held in SQL Server 2012+.
Anyone have any experiences with this problem?
Edit:
I've rewritten a method I found to test in C#. It allows any string of base characters to be passed in.
ie. string baseChars = "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
It's not pretty but its a start!
private string GetCustomBase(int iValue, string baseChars)
{
int baseNum = baseChars.Length;
int value= iValue;
string result = "";
while( value > 0 )
{
result = baseChars[ 0 + (value % baseNum)] + result;
value = value / baseNum;
}
return result;
}
private int GetDecimal(string strValue, string baseChars)
{
int baseNum = baseChars.Length;
string strAmendedValue = strValue;
int iResult = 0;
//Each char one at a time (from right)
for (int i = 0; i < strValue.Length; i++)
{
string c = strValue.Substring(strValue.Length - i -1, 1);
int iPos = baseChars.IndexOf(c); //get actual value (0 = 0, A = 10 etc.)
int iPowerVal = (int)Math.Pow((double)baseNum, (double)(i));
iResult = iResult + (iPowerVal * iPos);
}
return iResult;
}
An implementation of the suggestion in the question comments. As language is unimportant, here's a Ruby version:
class Integer
def to_34_IO_shifted
to_s(34).upcase.tr("IJKLMNOPQRSTUVWX", "JKLMNPQRSTUVWXYZ")
end
end
class String
def from_34_IO_shifted
upcase.tr("JKLMNPQRSTUVWXYZIO", "IJKLMNOPQRSTUVWX10").to_i(34)
end
end
puts 170.times.map { |x| x.to_34_IO_shifted }.join(' ')
x = 73644
x34 = x.to_34_IO_shifted
x10 = x34.from_34_IO_shifted
puts "\n#{x} -> '#{x34}' -> #{x10}"
puts "'10' -> #{'10'.from_34_IO_shifted}"
puts "'IO' -> #{'IO'.from_34_IO_shifted}"
Output:
0 1 2 3 4 5 6 7 8 9 A B C D E F G H J K L M N P Q R S T U V W X Y Z 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 1G 1H 1J 1K 1L 1M 1N 1P 1Q 1R 1S 1T 1U 1V 1W 1X 1Y 1Z 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 2G 2H 2J 2K 2L 2M 2N 2P 2Q 2R 2S 2T 2U 2V 2W 2X 2Y 2Z 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 3G 3H 3J 3K 3L 3M 3N 3P 3Q 3R 3S 3T 3U 3V 3W 3X 3Y 3Z 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 4G 4H 4J 4K 4L 4M 4N 4P 4Q 4R 4S 4T 4U 4V 4W 4X 4Y 4Z
73644 -> '1VQ0' -> 73644
'10' -> 34
'IO' -> 34
EDIT: made it so that I and O are interpreted as 1 and 0, in case someone does misread it.

Extract diagonal element from each frontal slice of tensor

I have a p-by-p-by-n tensor. I want to extract diagonal element for each p-by-p slice. Are there anyone know how to do this without looping?
Thank you.
Behold the ever mighty and ever powerful bsxfun for vectorizing MATLAB problems to do this task very efficiently using MATLAB's linear indexing -
diags = A(bsxfun(#plus,[1:p+1:p*p]',[0:n-1]*p*p))
Sample run with 4 x 4 x 3 sized input array -
A(:,:,1) =
0.7094 0.6551 0.9597 0.7513
0.7547 0.1626 0.3404 0.2551
0.2760 0.1190 0.5853 0.5060
0.6797 0.4984 0.2238 0.6991
A(:,:,2) =
0.8909 0.1493 0.8143 0.1966
0.9593 0.2575 0.2435 0.2511
0.5472 0.8407 0.9293 0.6160
0.1386 0.2543 0.3500 0.4733
A(:,:,3) =
0.3517 0.9172 0.3804 0.5308
0.8308 0.2858 0.5678 0.7792
0.5853 0.7572 0.0759 0.9340
0.5497 0.7537 0.0540 0.1299
diags =
0.7094 0.8909 0.3517
0.1626 0.2575 0.2858
0.5853 0.9293 0.0759
0.6991 0.4733 0.1299
Benchmarking
Here's few runtime tests comparing this bsxfun based approach against repmat + eye based approach for big datasizes -
***** Datasize: 500 x 500 x 500 *****
----------------------- With BSXFUN
Elapsed time is 0.008383 seconds.
----------------------- With REPMAT + EYE
Elapsed time is 0.163341 seconds.
***** Datasize: 800 x 800 x 500 *****
----------------------- With BSXFUN
Elapsed time is 0.012977 seconds.
----------------------- With REPMAT + EYE
Elapsed time is 0.402111 seconds.
***** Datasize: 1000 x 1000 x 500 *****
----------------------- With BSXFUN
Elapsed time is 0.017058 seconds.
----------------------- With REPMAT + EYE
Elapsed time is 0.690199 seconds.
One suggestion I have is to create a p x p logical identity matrix, replicate this n times in the third dimension, and then use this matrix to access your tensor. Something like this, supposing that your tensor was stored in A:
ind = repmat(logical(eye(p)), [1 1 n]);
out = A(ind);
Example use:
>> p = 5; n = 3;
>> A = reshape(1:75, p, p, n)
A(:,:,1) =
1 6 11 16 21
2 7 12 17 22
3 8 13 18 23
4 9 14 19 24
5 10 15 20 25
A(:,:,2) =
26 31 36 41 46
27 32 37 42 47
28 33 38 43 48
29 34 39 44 49
30 35 40 45 50
A(:,:,3) =
51 56 61 66 71
52 57 62 67 72
53 58 63 68 73
54 59 64 69 74
55 60 65 70 75
>> ind = repmat(logical(eye(p)), [1 1 n]);
>> out = A(ind)
out =
1
7
13
19
25
26
32
38
44
50
51
57
63
69
75
You'll notice that we grab the diagonals of the first slice, followed by the diagonals of the second slice, etc. up until the last slice. These values are all concatenated into a single vector.
Just reading Divakar's answer and trying to understand why he again is roughly 10 times faster than my idea I put together code mixing both, and ended up with code which is faster:
A=reshape(A,[],n);
diags2 = A(1:p+1:p*p,:);
For a 500x500x500 tensor I get 0.008s for Divakar's solution and 0.005s for my solution using Matlab 2013a. Probably plain indexing is the only way to beat bsxfun.

soft viterbi decoder not working properly

I have been working on viterbi decoder in matlab2009 on simple 1/2 rate convolutional encoder.
Here is my code
trel = poly2trellis(3,[7 5]);
msg = [ 0 1 0 1 1 1 0 0 1 0 1 0 0 0 1 ];
code = convenc(msg,trel);
% Traceback Length
tblen = 5;
ucode = real(awgn(1-2*code,tblen,'measured'));
dcd = vitdec(ucode,trel,tblen,'cont','unquant');
According to this input code
i am getting the code = 00 11 10 00 01 10 01 11 11 10 00 10 11 00 11
which is correct
but talking about the dcd which is output after viterbi decoder is coming incorrect
i.e 000000101110010. which is far different from my msg input.
guide me where i am going incorrect
The decoded output depends on the type of opmode Input you selected.
In case of cont, there is a delay in the output equal to tblen number of symbols whereas there are 'term' and trunc modes as well.
You can compare the initial msg(1,end-tblen) symbols with dcd(1,tblen+1:end). They are same!
You may check vitdec at Matlab help.