I am running an example of 1D Capacitor in Devsim,and some error occur when i press the “Run File” button for the second time,but it is always ok for the first time. The same situation can happen when it comes to other examples in Devsim. I would like to know why and how could i solve this “Problem”.
Below is the error infomation:
runfile(‘D:/06 Devsim/Cap1d_ch_debug.py’, wdir=‘D:/06 Devsim’)
problems with creating default derivatives. declare(dBdx(x)); define(B(x),dBdx(x)); declare(sgn(x)); declare(step(x)); define(abs(x), sgn(x)); declare(derfdx(x)); declare(derfcdx(x)); define(erf(x), derfdx(x)); define(erfc(x), derfcdx(x));declare(derf_invdx(x)); declare(derfc_invdx(x)); define(erf_inv(x), derf_invdx(x)); define(erfc_inv(x), derfc_invdx(x));declare(dFermidx(x)); declare(dInvFermidx(x)); define(Fermi(x), dFermidx(x)); define(InvFermi(x), dInvFermidx(x)); define(vec_sum(x),1);declare(vec_max(x));declare(vec_min(x));declare(dot2d(ax,ay,bx,by));define(dot2d(ax, ay, bx, by), bx, by, ax, ay);define(max(x, y), x >= y, x < y);define(min(x, y), x <= y, x > y);define(kahan3(a, b, c), 1, 1, 1);define(kahan4(a, b, c, d), 1, 1, 1, 1);define(asinh(x), ((1 + (x^2))^(-1/2)));define(acosh(x), (((x^2) - 1)^(-1/2)));define(atanh(x), ((1 - (x^2))^(-1)));declare(cosh(x));define(sinh(x), cosh(x));define(cosh(x), sinh(x));declare(tanh(x));define(tanh(x), 1 - pow(tanh(x), 2));declare(dgfidx(x,y));define(gfi(x,y), dgfidx(x,y), 0);declare(digfidx(x,y));define(igfi(x,y), digfidx(x,y), 0);
dBdx has already been declared with 1 argument(s)
sgn has already been declared with 1 argument(s)
step has already been declared with 1 argument(s)
derfdx has already been declared with 1 argument(s)
derfcdx has already been declared with 1 argument(s)
derf_invdx has already been declared with 1 argument(s)
derfc_invdx has already been declared with 1 argument(s)
dFermidx has already been declared with 1 argument(s)
dInvFermidx has already been declared with 1 argument(s)
vec_max has already been declared with 1 argument(s)
vec_min has already been declared with 1 argument(s)
dot2d has already been declared with 4 argument(s)
cosh has already been declared with 1 argument(s)
tanh has already been declared with 1 argument(s)
dgfidx has already been declared with 2 argument(s)
digfidx has already been declared with 2 argument(s)
Traceback (most recent call last):
File “D:\06 Devsim\Cap1d_ch_debug.py”, line 9, in
import devsim as dv
File “c:\users\caihng\devsim_win64_v2.1.0\devsim_win64_v2.1.0\lib\devsim_init_.py”, line 8, in
from .devsim_py3 import *
RuntimeError: Issues initializing DEVSIM.
The code for this example is also listed here:
-- coding: utf-8 --
“”"
Created on Mon Jun 13 20:01:26 2022
@author: Caiheng
“”"
#from devsim import *
import devsim as dv
device=“MyDevice”
region=“MyRegion”
Create a 1D mesh
dv.create_1d_mesh (mesh=“mesh1”)
dv.add_1d_mesh_line (mesh=“mesh1”, pos=0.0, ps=0.1, tag=“contact1”)
dv.add_1d_mesh_line (mesh=“mesh1”, pos=1.0, ps=0.1, tag=“contact2”)
dv.add_1d_contact (mesh=“mesh1”, name=“contact1”, tag=“contact1”,
material=“metal”)
dv.add_1d_contact (mesh=“mesh1”, name=“contact2”, tag=“contact2”,
material=“metal”)
dv.add_1d_region (mesh=“mesh1”, material=“Si”, region=region,
tag1=“contact1”, tag2=“contact2”)
dv.finalize_mesh (mesh=“mesh1”)
dv.create_device (mesh=“mesh1”, device=device)
Set parameters on the region
dv.set_parameter(device=device, region=region,
name=“Permittivity”, value=3.9*8.85e-14)
Create the Potential solution variable
dv.node_solution(device=device, region=region, name=“Potential”)
Creates the Potential@n0 and Potential@n1 edge model
dv.edge_from_node_model(device=device, region=region, node_model=“Potential”)
Electric field on each edge, as well as its derivatives with respect to
the potential at each node
dv.edge_model(device=device, region=region, name=“ElectricField”,
equation="(Potential@n0 - Potential@n1)*EdgeInverseLength")
dv.edge_model(device=device, region=region, name=“ElectricField:Potential@n0”,
equation=“EdgeInverseLength”)
dv.edge_model(device=device, region=region, name=“ElectricField:Potential@n1”,
equation="-EdgeInverseLength")
Model the D Field
dv.edge_model(device=device, region=region, name=“DField”,
equation=“Permittivity*ElectricField”)
dv.edge_model(device=device, region=region, name=“DField:Potential@n0”,
equation=“diff(Permittivity*ElectricField, Potential@n0)”)
dv.edge_model(device=device, region=region, name=“DField:Potential@n1”,
equation="-DField:Potential@n0")
Create the bulk equation
dv.equation(device=device, region=region, name=“PotentialEquation”,
variable_name=“Potential”, edge_model=“DField”,
variable_update=“default”)
Contact models and equations
for c in (“contact1”, “contact2”):
dv.contact_node_model(device=device, contact=c, name="%s_bc" % c,
equation=“Potential - %s_bias” % c)
dv.contact_node_model(device=device, contact=c, name="%s_bc:Potential" % c,
equation=“1”)
dv.contact_equation(device=device, contact=c, name=“PotentialEquation”,
node_model="%s_bc" % c, edge_charge_model=“DField”)
Set the contact
dv.set_parameter(device=device, region=region, name=“contact1_bias”, value=1.0e-0)
dv.set_parameter(device=device, region=region, name=“contact2_bias”, value=0.0)
Solve
dv.solve(type=“dc”, absolute_error=1.0, relative_error=1e-10, maximum_iterations=30)
Print the charge on the contacts
for c in (“contact1”, “contact2”):
print(“contact: %s charge: %1.5e”
% (c, dv.get_contact_charge(device=device, contact=c, equation=“PotentialEquation”)))