devsim 2.10.0__cp39-abi3-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- devsim/__init__.py +17 -0
- devsim/devsim_py3.pyd +0 -0
- devsim/python_packages/Klaassen.py +336 -0
- devsim/python_packages/__init__.py +0 -0
- devsim/python_packages/fermi_physics.py +31 -0
- devsim/python_packages/model_create.py +262 -0
- devsim/python_packages/mos_physics.py +170 -0
- devsim/python_packages/pythonmesh.py +131 -0
- devsim/python_packages/ramp.py +101 -0
- devsim/python_packages/simple_dd.py +75 -0
- devsim/python_packages/simple_physics.py +463 -0
- devsim/umfpack/umfpack_lgpl.dll +0 -0
- devsim/umfpack/umfpack_loader.py +517 -0
- devsim/umfpack/umfshim.py +116 -0
- devsim-2.10.0.data/data/devsim_data/BUILD.md +94 -0
- devsim-2.10.0.data/data/devsim_data/CHANGES.md +773 -0
- devsim-2.10.0.data/data/devsim_data/CITATION.md +23 -0
- devsim-2.10.0.data/data/devsim_data/CODE_OF_CONDUCT.md +74 -0
- devsim-2.10.0.data/data/devsim_data/CONTRIBUTING.md +43 -0
- devsim-2.10.0.data/data/devsim_data/HOWTO.md +27 -0
- devsim-2.10.0.data/data/devsim_data/INSTALL.md +65 -0
- devsim-2.10.0.data/data/devsim_data/README.md +97 -0
- devsim-2.10.0.data/data/devsim_data/TEST.md +13 -0
- devsim-2.10.0.data/data/devsim_data/doc/devsim.pdf +0 -0
- devsim-2.10.0.data/data/devsim_data/doc/symdiff.pdf +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0_3d.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7_3d.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_2d.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_3d.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_common.py +399 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.geo +62 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.msh +65606 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.geo +183 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.msh +25808 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap.lay +1587 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap1d.py +155 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap2d.py +200 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/3dblock.geo +48 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d.py +94 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d_custom.py +159 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_2d.py +68 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_common.py +253 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_current.lay +3271 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_density.lay +3271 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_potential.lay +3272 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.msh +1477 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.py +55 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.msh +8557 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.py +74 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_equil.py +43 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_float128.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux2d.py +43 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux3d.py +54 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux_common.py +503 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/pythonmesh3d.py +61 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/ssac_diode.py +57 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/tran_diode.py +63 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.geo +160 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.msh +8599 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.py +96 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_create.py +174 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_kla.py +162 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/logElectrons.lay +1327 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/pythonmesh2d.py +100 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/test.lay +3385 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/times.txt +34 -0
- devsim-2.10.0.data/data/devsim_data/examples/plotting/visualization.ipynb +160 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/arrhenius.py +24 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/deftest.py +48 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/modellist1.py +9 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/models1.py +41 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/ordered.py +9 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/parsetest.py +107 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/remove1.py +8 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/subexpression1.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/table.py +7 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/undefined1.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/utf8.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.geo +34 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.lay +1469 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.msh +13596 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.py +177 -0
- devsim-2.10.0.data/data/devsim_data/setup.cfg +23 -0
- devsim-2.10.0.data/data/devsim_data/setup.py +58 -0
- devsim-2.10.0.data/data/devsim_data/testing/3dtetmesh.msh +281 -0
- devsim-2.10.0.data/data/devsim_data/testing/CMakeLists.txt +175 -0
- devsim-2.10.0.data/data/devsim_data/testing/Fermi1.py +59 -0
- devsim-2.10.0.data/data/devsim_data/testing/Fermi1_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/GaussFermi.py +38 -0
- devsim-2.10.0.data/data/devsim_data/testing/GaussFermi_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/cap2.py +439 -0
- devsim-2.10.0.data/data/devsim_data/testing/cap_mesh.py +33 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ1.py +79 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ2.py +79 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ3.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ4.py +105 -0
- devsim-2.10.0.data/data/devsim_data/testing/dio2_element_2d.py +136 -0
- devsim-2.10.0.data/data/devsim_data/testing/dio2_element_physics.py +302 -0
- devsim-2.10.0.data/data/devsim_data/testing/equation1.py +68 -0
- devsim-2.10.0.data/data/devsim_data/testing/erf1.py +52 -0
- devsim-2.10.0.data/data/devsim_data/testing/erf2.py +34 -0
- devsim-2.10.0.data/data/devsim_data/testing/fpetest1.py +21 -0
- devsim-2.10.0.data/data/devsim_data/testing/fpetest2.py +25 -0
- devsim-2.10.0.data/data/devsim_data/testing/gmsh_mos3d.geo +272 -0
- devsim-2.10.0.data/data/devsim_data/testing/info.py +11 -0
- devsim-2.10.0.data/data/devsim_data/testing/kahan.py +24 -0
- devsim-2.10.0.data/data/devsim_data/testing/kahan_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/laux1.py +232 -0
- devsim-2.10.0.data/data/devsim_data/testing/mctest.mc +30 -0
- devsim-2.10.0.data/data/devsim_data/testing/mctest_user.mc +33 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh1.msh +52 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh1.py +121 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2.msh +70 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2.py +210 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2d.py +105 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh3.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh4.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d.py +111 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_create.py +207 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart.py +69 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart2.py +24 -0
- devsim-2.10.0.data/data/devsim_data/testing/noise_res.py +51 -0
- devsim-2.10.0.data/data/devsim_data/testing/noise_res_2d.py +101 -0
- devsim-2.10.0.data/data/devsim_data/testing/ptest1.py +53 -0
- devsim-2.10.0.data/data/devsim_data/testing/ptest2.py +110 -0
- devsim-2.10.0.data/data/devsim_data/testing/pythonmesh1d.py +202 -0
- devsim-2.10.0.data/data/devsim_data/testing/res1.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/res2.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/res3.py +59 -0
- devsim-2.10.0.data/data/devsim_data/testing/rundifftest.py +62 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap.py +145 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_edge.py +199 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_element.py +214 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_edge.py +148 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_element.py +167 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_circ.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_res.py +30 -0
- devsim-2.10.0.data/data/devsim_data/testing/symdiff1.py +54 -0
- devsim-2.10.0.data/data/devsim_data/testing/test_common.py +435 -0
- devsim-2.10.0.data/data/devsim_data/testing/testfunc.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/testfunc_extended.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ.py +67 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ2.py +67 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ3.py +125 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_rc.py +157 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh1.msh +47 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh1.py +114 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh2.py +114 -0
- devsim-2.10.0.data/data/devsim_data/testing/utf8_2.py +126 -0
- devsim-2.10.0.dist-info/METADATA +121 -0
- devsim-2.10.0.dist-info/RECORD +157 -0
- devsim-2.10.0.dist-info/WHEEL +5 -0
- devsim-2.10.0.dist-info/licenses/LICENSE +202 -0
- devsim-2.10.0.dist-info/licenses/NOTICE +241 -0
- devsim-2.10.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Copyright 2013 DEVSIM LLC
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
#### circ4.tcl
|
|
6
|
+
####
|
|
7
|
+
#### copy of circ1.tcl using a voltage source
|
|
8
|
+
|
|
9
|
+
import devsim
|
|
10
|
+
import test_common
|
|
11
|
+
|
|
12
|
+
devices = ("MyDevice1", "MyDevice2")
|
|
13
|
+
region = "MyRegion"
|
|
14
|
+
|
|
15
|
+
####
|
|
16
|
+
#### Meshing
|
|
17
|
+
####
|
|
18
|
+
test_common.CreateSimpleMesh(device=devices[0], region=region)
|
|
19
|
+
devsim.create_device(mesh="dog", device=devices[1])
|
|
20
|
+
|
|
21
|
+
for device in devices:
|
|
22
|
+
test_common.SetupResistorConstants(device=device, region="")
|
|
23
|
+
test_common.SetupInitialResistorSystem(device, region)
|
|
24
|
+
|
|
25
|
+
devsim.add_circuit_node(name="cnode0", variable_update="default")
|
|
26
|
+
devsim.add_circuit_node(name="cnode1", variable_update="default")
|
|
27
|
+
devsim.circuit_element(name="R1", n1="cnode1", n2=0, value=1e15)
|
|
28
|
+
devsim.circuit_element(name="V1", n1="cnode0", n2=0, value=0.0)
|
|
29
|
+
|
|
30
|
+
test_common.SetupInitialResistorContact(
|
|
31
|
+
device="MyDevice1",
|
|
32
|
+
contact="top",
|
|
33
|
+
use_circuit_bias=True,
|
|
34
|
+
circuit_node="MyDevice1_top",
|
|
35
|
+
)
|
|
36
|
+
test_common.SetupInitialResistorContact(
|
|
37
|
+
device="MyDevice1",
|
|
38
|
+
contact="bot",
|
|
39
|
+
use_circuit_bias=True,
|
|
40
|
+
circuit_node="MyDevice1_bot",
|
|
41
|
+
)
|
|
42
|
+
test_common.SetupInitialResistorContact(
|
|
43
|
+
device="MyDevice2",
|
|
44
|
+
contact="top",
|
|
45
|
+
use_circuit_bias=True,
|
|
46
|
+
circuit_node="MyDevice2_top",
|
|
47
|
+
)
|
|
48
|
+
test_common.SetupInitialResistorContact(
|
|
49
|
+
device="MyDevice2",
|
|
50
|
+
contact="bot",
|
|
51
|
+
use_circuit_bias=True,
|
|
52
|
+
circuit_node="MyDevice2_bot",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
devsim.circuit_node_alias(node="cnode0", alias="MyDevice1_top")
|
|
57
|
+
devsim.circuit_node_alias(node="cnode1", alias="MyDevice2_top")
|
|
58
|
+
devsim.circuit_node_alias(node="cnode1", alias="MyDevice1_bot")
|
|
59
|
+
devsim.circuit_node_alias(node="GND", alias="MyDevice2_bot")
|
|
60
|
+
|
|
61
|
+
devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=30)
|
|
62
|
+
|
|
63
|
+
for device in devices:
|
|
64
|
+
print(device)
|
|
65
|
+
for name in ("Potential", "IntrinsicElectrons"):
|
|
66
|
+
devsim.print_node_values(device=device, region=region, name=name)
|
|
67
|
+
|
|
68
|
+
for device in devices:
|
|
69
|
+
test_common.SetupCarrierResistorSystem(device=device, region=region)
|
|
70
|
+
|
|
71
|
+
test_common.SetupCarrierResistorContact(
|
|
72
|
+
device="MyDevice1",
|
|
73
|
+
contact="top",
|
|
74
|
+
use_circuit_bias=True,
|
|
75
|
+
circuit_node="MyDevice1_top",
|
|
76
|
+
)
|
|
77
|
+
test_common.SetupCarrierResistorContact(
|
|
78
|
+
device="MyDevice1",
|
|
79
|
+
contact="bot",
|
|
80
|
+
use_circuit_bias=True,
|
|
81
|
+
circuit_node="MyDevice1_bot",
|
|
82
|
+
)
|
|
83
|
+
test_common.SetupCarrierResistorContact(
|
|
84
|
+
device="MyDevice2",
|
|
85
|
+
contact="top",
|
|
86
|
+
use_circuit_bias=True,
|
|
87
|
+
circuit_node="MyDevice2_top",
|
|
88
|
+
)
|
|
89
|
+
test_common.SetupCarrierResistorContact(
|
|
90
|
+
device="MyDevice2",
|
|
91
|
+
contact="bot",
|
|
92
|
+
use_circuit_bias=True,
|
|
93
|
+
circuit_node="MyDevice2_bot",
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
for v in (0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10):
|
|
98
|
+
devsim.circuit_alter(name="V1", value=v)
|
|
99
|
+
devsim.solve(
|
|
100
|
+
type="dc", absolute_error=1.0, relative_error=1e-9, maximum_iterations=30
|
|
101
|
+
)
|
|
102
|
+
test_common.print_circuit_solution()
|
|
103
|
+
for device in devices:
|
|
104
|
+
test_common.printResistorCurrent(device=device, contact="top")
|
|
105
|
+
test_common.printResistorCurrent(device=device, contact="bot")
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Copyright 2013 DEVSIM LLC
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import devsim
|
|
6
|
+
import dio2_element_physics
|
|
7
|
+
#####
|
|
8
|
+
# dio1
|
|
9
|
+
#
|
|
10
|
+
# Make doping a step function
|
|
11
|
+
# print dat to text file for viewing in grace
|
|
12
|
+
# verify currents analytically
|
|
13
|
+
# in dio2 add recombination
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
####
|
|
18
|
+
#### Meshing
|
|
19
|
+
####
|
|
20
|
+
def createMesh(device, region):
|
|
21
|
+
devsim.create_2d_mesh(mesh="dog")
|
|
22
|
+
devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=0, ps=1e-6)
|
|
23
|
+
devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=0.5e-5, ps=1e-8)
|
|
24
|
+
devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=1e-5, ps=1e-6)
|
|
25
|
+
devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=0, ps=1e-6)
|
|
26
|
+
devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=1e-5, ps=1e-6)
|
|
27
|
+
|
|
28
|
+
devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=-1e-8, ps=1e-8)
|
|
29
|
+
devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=1.001e-5, ps=1e-8)
|
|
30
|
+
|
|
31
|
+
devsim.add_2d_region(mesh="dog", material="Si", region=region)
|
|
32
|
+
devsim.add_2d_region(mesh="dog", material="Si", region="air1", xl=-1e-8, xh=0)
|
|
33
|
+
devsim.add_2d_region(
|
|
34
|
+
mesh="dog", material="Si", region="air2", xl=1.0e-5, xh=1.001e-5
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
devsim.add_2d_contact(
|
|
38
|
+
mesh="dog",
|
|
39
|
+
name="top",
|
|
40
|
+
region=region,
|
|
41
|
+
yl=0.8e-5,
|
|
42
|
+
yh=1e-5,
|
|
43
|
+
xl=0,
|
|
44
|
+
xh=0,
|
|
45
|
+
bloat=1e-10,
|
|
46
|
+
material="metal",
|
|
47
|
+
)
|
|
48
|
+
devsim.add_2d_contact(
|
|
49
|
+
mesh="dog",
|
|
50
|
+
name="bot",
|
|
51
|
+
region=region,
|
|
52
|
+
xl=1e-5,
|
|
53
|
+
xh=1e-5,
|
|
54
|
+
bloat=1e-10,
|
|
55
|
+
material="metal",
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
devsim.finalize_mesh(mesh="dog")
|
|
59
|
+
devsim.create_device(mesh="dog", device=device)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
device = "MyDevice"
|
|
63
|
+
region = "MyRegion"
|
|
64
|
+
|
|
65
|
+
createMesh(device, region)
|
|
66
|
+
|
|
67
|
+
dio2_element_physics.setMaterialParameters(device, region)
|
|
68
|
+
|
|
69
|
+
dio2_element_physics.createSolution(device, region, "Potential")
|
|
70
|
+
|
|
71
|
+
####
|
|
72
|
+
#### NetDoping
|
|
73
|
+
####
|
|
74
|
+
for name, equation in (
|
|
75
|
+
("Acceptors", "1.0e18*step(0.5e-5-x)"),
|
|
76
|
+
("Donors", "1.0e18*step(x-0.5e-5)"),
|
|
77
|
+
("NetDoping", "Donors-Acceptors"),
|
|
78
|
+
):
|
|
79
|
+
devsim.node_model(device=device, region=region, name=name, equation=equation)
|
|
80
|
+
|
|
81
|
+
dio2_element_physics.createPotentialOnly(device, region)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
dio2_element_physics.createPotentialOnlyContact(device, region, "top")
|
|
85
|
+
dio2_element_physics.createPotentialOnlyContact(device, region, "bot")
|
|
86
|
+
|
|
87
|
+
####
|
|
88
|
+
#### Initial DC solution
|
|
89
|
+
####
|
|
90
|
+
devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-12, maximum_iterations=30)
|
|
91
|
+
|
|
92
|
+
devsim.write_devices(file="dio2_element_2d_potentialonly.tec", type="tecplot")
|
|
93
|
+
|
|
94
|
+
####
|
|
95
|
+
#### drift diffusion
|
|
96
|
+
####
|
|
97
|
+
dio2_element_physics.createSolution(device, region, "Electrons")
|
|
98
|
+
dio2_element_physics.createSolution(device, region, "Holes")
|
|
99
|
+
|
|
100
|
+
####
|
|
101
|
+
#### create initial guess from dc only solution
|
|
102
|
+
####
|
|
103
|
+
devsim.set_node_values(
|
|
104
|
+
device=device, region=region, name="Electrons", init_from="IntrinsicElectrons"
|
|
105
|
+
)
|
|
106
|
+
devsim.set_node_values(
|
|
107
|
+
device=device, region=region, name="Holes", init_from="IntrinsicHoles"
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
dio2_element_physics.createDriftDiffusion(device, region)
|
|
111
|
+
|
|
112
|
+
dio2_element_physics.createDriftDiffusionAtContact(device, region, "top")
|
|
113
|
+
dio2_element_physics.createDriftDiffusionAtContact(device, region, "bot")
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
devsim.set_parameter(device=device, region=region, name="topbias", value=0.0)
|
|
117
|
+
|
|
118
|
+
#
|
|
119
|
+
# This is to test the solution backup
|
|
120
|
+
#
|
|
121
|
+
# set_parameter -device device -region region -name "topbias" -value 10
|
|
122
|
+
# catch {solve -type dc -absolute_error 1e10 -relative_error 1e-10 -maximum_iterations 30} x
|
|
123
|
+
# puts x
|
|
124
|
+
|
|
125
|
+
v = 0
|
|
126
|
+
while v < 0.51:
|
|
127
|
+
devsim.set_parameter(device=device, region=region, name="topbias", value=v)
|
|
128
|
+
devsim.solve(
|
|
129
|
+
type="dc", absolute_error=1e10, relative_error=1e-10, maximum_iterations=30
|
|
130
|
+
)
|
|
131
|
+
dio2_element_physics.printCurrents(device, "top", v)
|
|
132
|
+
dio2_element_physics.printCurrents(device, "bot", 0.0)
|
|
133
|
+
v += 0.1
|
|
134
|
+
|
|
135
|
+
devsim.write_devices(file="dio2_element_2d_dd.tec", type="tecplot")
|
|
136
|
+
devsim.write_devices(file="dio2_element_2d_dd", type="vtk")
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# Copyright 2013 DEVSIM LLC
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import devsim
|
|
6
|
+
|
|
7
|
+
###
|
|
8
|
+
### element edge based example
|
|
9
|
+
###
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def printCurrents(device, contact, bias):
|
|
13
|
+
ecurr = devsim.get_contact_current(
|
|
14
|
+
contact=contact, equation="ElectronContinuityEquation", device=device
|
|
15
|
+
)
|
|
16
|
+
hcurr = devsim.get_contact_current(
|
|
17
|
+
contact=contact, equation="HoleContinuityEquation", device=device
|
|
18
|
+
)
|
|
19
|
+
tcurr = ecurr + hcurr
|
|
20
|
+
print("%s %g %g %g %g" % (contact, bias, ecurr, hcurr, tcurr))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
####
|
|
24
|
+
#### Constants
|
|
25
|
+
####
|
|
26
|
+
def setMaterialParameters(device, region):
|
|
27
|
+
q = 1.6e-19
|
|
28
|
+
k = 1.3806503e-23
|
|
29
|
+
eps = 8.85e-14
|
|
30
|
+
T = 300
|
|
31
|
+
for name, value in (
|
|
32
|
+
("Permittivity", 11.1 * eps),
|
|
33
|
+
("ElectronCharge", q),
|
|
34
|
+
("n_i", 1.0e10),
|
|
35
|
+
("kT", eps * T),
|
|
36
|
+
("V_t", k * T / q),
|
|
37
|
+
("mu_n", 400),
|
|
38
|
+
("mu_p", 200),
|
|
39
|
+
):
|
|
40
|
+
devsim.set_parameter(device=device, region=region, name=name, value=value)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def createSolution(device, region, name):
|
|
44
|
+
devsim.node_solution(device=device, region=region, name=name)
|
|
45
|
+
devsim.edge_from_node_model(device=device, region=region, node_model=name)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def createPotentialOnly(device, region):
|
|
49
|
+
for name, equation in (
|
|
50
|
+
("IntrinsicElectrons", "n_i*exp(Potential/V_t)"),
|
|
51
|
+
("IntrinsicElectrons:Potential", "diff(n_i*exp(Potential/V_t), Potential)"),
|
|
52
|
+
("IntrinsicHoles", "n_i^2/IntrinsicElectrons"),
|
|
53
|
+
("IntrinsicHoles:Potential", "diff(n_i^2/IntrinsicElectrons, Potential)"),
|
|
54
|
+
("IntrinsicCharge", "IntrinsicHoles-IntrinsicElectrons + NetDoping"),
|
|
55
|
+
(
|
|
56
|
+
"IntrinsicCharge:Potential",
|
|
57
|
+
"diff(IntrinsicHoles-IntrinsicElectrons, Potential)",
|
|
58
|
+
),
|
|
59
|
+
("PotentialIntrinsicNodeCharge", "-ElectronCharge*IntrinsicCharge"),
|
|
60
|
+
(
|
|
61
|
+
"PotentialIntrinsicNodeCharge:Potential",
|
|
62
|
+
"diff(-ElectronCharge*IntrinsicCharge, Potential)",
|
|
63
|
+
),
|
|
64
|
+
):
|
|
65
|
+
devsim.node_model(device=device, region=region, name=name, equation=equation)
|
|
66
|
+
|
|
67
|
+
for name, equation in (
|
|
68
|
+
("EField", "(Potential@n0-Potential@n1)*EdgeInverseLength"),
|
|
69
|
+
("EField:Potential@n0", "EdgeInverseLength"),
|
|
70
|
+
("EField:Potential@n1", "-EField:Potential@n0"),
|
|
71
|
+
):
|
|
72
|
+
devsim.edge_model(device=device, region=region, name=name, equation=equation)
|
|
73
|
+
|
|
74
|
+
devsim.element_from_edge_model(edge_model="EField", device=device, region=region)
|
|
75
|
+
devsim.element_from_edge_model(
|
|
76
|
+
edge_model="EField", derivative="Potential", device=device, region=region
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
foo = "dot2d(EField_x, EField_y, unitx, unity)"
|
|
80
|
+
for name, equation in (
|
|
81
|
+
("ElectricField", foo),
|
|
82
|
+
("ElectricField:Potential@en0", "diff(%s, Potential@en0)" % foo),
|
|
83
|
+
("ElectricField:Potential@en1", "diff(%s, Potential@en1)" % foo),
|
|
84
|
+
("ElectricField:Potential@en2", "diff(%s, Potential@en2)" % foo),
|
|
85
|
+
("PotentialEdgeFlux", "Permittivity*ElectricField"),
|
|
86
|
+
(
|
|
87
|
+
"PotentialEdgeFlux:Potential@en0",
|
|
88
|
+
"diff(Permittivity*ElectricField,Potential@en0)",
|
|
89
|
+
),
|
|
90
|
+
(
|
|
91
|
+
"PotentialEdgeFlux:Potential@en1",
|
|
92
|
+
"diff(Permittivity*ElectricField,Potential@en1)",
|
|
93
|
+
),
|
|
94
|
+
(
|
|
95
|
+
"PotentialEdgeFlux:Potential@en2",
|
|
96
|
+
"diff(Permittivity*ElectricField,Potential@en2)",
|
|
97
|
+
),
|
|
98
|
+
):
|
|
99
|
+
devsim.element_model(device=device, region=region, name=name, equation=equation)
|
|
100
|
+
|
|
101
|
+
devsim.equation(
|
|
102
|
+
device=device,
|
|
103
|
+
region=region,
|
|
104
|
+
name="PotentialEquation",
|
|
105
|
+
variable_name="Potential",
|
|
106
|
+
node_model="PotentialIntrinsicNodeCharge",
|
|
107
|
+
element_model="PotentialEdgeFlux",
|
|
108
|
+
variable_update="log_damp",
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def createPotentialOnlyContact(device, region, contact):
|
|
113
|
+
format_dict = {"contact": contact}
|
|
114
|
+
biasname = contact + "bias"
|
|
115
|
+
devsim.set_parameter(device=device, region=region, name=biasname, value=0.0)
|
|
116
|
+
|
|
117
|
+
for name, equation in (
|
|
118
|
+
(
|
|
119
|
+
"celec_%(contact)s",
|
|
120
|
+
"1e-10 + 0.5*(NetDoping+(NetDoping^2 + 4 * n_i^2)^(0.5))+1e-10",
|
|
121
|
+
),
|
|
122
|
+
(
|
|
123
|
+
"chole_%(contact)s",
|
|
124
|
+
"1e-10 + 0.5*(-NetDoping+(NetDoping^2 + 4 * n_i^2)^(0.5))+1e-10",
|
|
125
|
+
),
|
|
126
|
+
(
|
|
127
|
+
"%(contact)snodemodel",
|
|
128
|
+
"""ifelse(NetDoping > 0,
|
|
129
|
+
Potential-%(contact)sbias-V_t*log(celec_%(contact)s/n_i),
|
|
130
|
+
Potential-%(contact)sbias+V_t*log(chole_%(contact)s/n_i))""",
|
|
131
|
+
),
|
|
132
|
+
("%(contact)snodemodel:Potential", "1"),
|
|
133
|
+
):
|
|
134
|
+
name_sub = name % format_dict
|
|
135
|
+
equation_sub = equation % format_dict
|
|
136
|
+
devsim.contact_node_model(
|
|
137
|
+
device=device, contact=contact, name=name_sub, equation=equation_sub
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
devsim.contact_equation(
|
|
141
|
+
device=device,
|
|
142
|
+
contact=contact,
|
|
143
|
+
name="PotentialEquation",
|
|
144
|
+
node_model="%snodemodel" % contact,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def createDriftDiffusion(device, region):
|
|
149
|
+
for name, equation in (
|
|
150
|
+
("PotentialNodeCharge", "-ElectronCharge*(Holes -Electrons + NetDoping)"),
|
|
151
|
+
("PotentialNodeCharge:Electrons", "+ElectronCharge"),
|
|
152
|
+
("PotentialNodeCharge:Holes", "-ElectronCharge"),
|
|
153
|
+
):
|
|
154
|
+
devsim.node_model(device=device, region=region, name=name, equation=equation)
|
|
155
|
+
|
|
156
|
+
devsim.equation(
|
|
157
|
+
device=device,
|
|
158
|
+
region=region,
|
|
159
|
+
name="PotentialEquation",
|
|
160
|
+
variable_name="Potential",
|
|
161
|
+
node_model="PotentialNodeCharge",
|
|
162
|
+
element_model="PotentialEdgeFlux",
|
|
163
|
+
variable_update="log_damp",
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
for name, equation in (
|
|
167
|
+
("vdiff", "(Potential@n0 - Potential@n1)/V_t"),
|
|
168
|
+
("vdiff:Potential@n0", "V_t^(-1)"),
|
|
169
|
+
("vdiff:Potential@n1", "-V_t^(-1)"),
|
|
170
|
+
("Bern01", "B(vdiff)"),
|
|
171
|
+
("Bern01:Potential@n0", "dBdx(vdiff)*vdiff:Potential@n0"),
|
|
172
|
+
("Bern01:Potential@n1", "dBdx(vdiff)*vdiff:Potential@n1"),
|
|
173
|
+
("Bern10", "Bern01 + vdiff"),
|
|
174
|
+
("Bern10:Potential@n0", "Bern01:Potential@n0 + vdiff:Potential@n0"),
|
|
175
|
+
("Bern10:Potential@n1", "Bern01:Potential@n1 + vdiff:Potential@n1"),
|
|
176
|
+
):
|
|
177
|
+
devsim.edge_model(device=device, region=region, name=name, equation=equation)
|
|
178
|
+
|
|
179
|
+
Jn = "ElectronCharge*mu_n*EdgeInverseLength*V_t*(Electrons@n1*Bern10 - Electrons@n0*Bern01)"
|
|
180
|
+
dJndn0 = "simplify(diff( %s, Electrons@n0))" % Jn
|
|
181
|
+
dJndn1 = "simplify(diff( %s, Electrons@n1))" % Jn
|
|
182
|
+
dJndpot0 = "simplify(diff( %s, Potential@n0))" % Jn
|
|
183
|
+
dJndpot1 = "simplify(diff( %s, Potential@n1))" % Jn
|
|
184
|
+
for name, equation in (
|
|
185
|
+
("ElectronCurrent", Jn),
|
|
186
|
+
("ElectronCurrent:Electrons@n0", dJndn0),
|
|
187
|
+
("ElectronCurrent:Electrons@n1", dJndn1),
|
|
188
|
+
("ElectronCurrent:Potential@n0", dJndpot0),
|
|
189
|
+
("ElectronCurrent:Potential@n1", dJndpot1),
|
|
190
|
+
):
|
|
191
|
+
devsim.edge_model(device=device, region=region, name=name, equation=equation)
|
|
192
|
+
|
|
193
|
+
Jp = (
|
|
194
|
+
"-ElectronCharge*mu_p*EdgeInverseLength*V_t*(Holes@n1*Bern01 - Holes@n0*Bern10)"
|
|
195
|
+
)
|
|
196
|
+
dJpdp0 = "simplify(diff(%s, Holes@n0))" % Jp
|
|
197
|
+
dJpdp1 = "simplify(diff(%s, Holes@n1))" % Jp
|
|
198
|
+
dJpdpot0 = "simplify(diff(%s, Potential@n0))" % Jp
|
|
199
|
+
dJpdpot1 = "simplify(diff(%s, Potential@n1))" % Jp
|
|
200
|
+
|
|
201
|
+
for name, equation in (
|
|
202
|
+
("HoleCurrent", Jp),
|
|
203
|
+
("HoleCurrent:Holes@n0", dJpdp0),
|
|
204
|
+
("HoleCurrent:Holes@n1", dJpdp1),
|
|
205
|
+
("HoleCurrent:Potential@n0", dJpdpot0),
|
|
206
|
+
("HoleCurrent:Potential@n1", dJpdpot1),
|
|
207
|
+
):
|
|
208
|
+
devsim.edge_model(device=device, region=region, name=name, equation=equation)
|
|
209
|
+
|
|
210
|
+
NCharge = "-ElectronCharge * Electrons"
|
|
211
|
+
dNChargedn = "-ElectronCharge"
|
|
212
|
+
for name, equation in (
|
|
213
|
+
("NCharge", NCharge),
|
|
214
|
+
("NCharge:Electrons", dNChargedn),
|
|
215
|
+
):
|
|
216
|
+
devsim.node_model(device=device, region=region, name=name, equation=equation)
|
|
217
|
+
|
|
218
|
+
PCharge = "-ElectronCharge * Holes"
|
|
219
|
+
dPChargedp = "-ElectronCharge"
|
|
220
|
+
for name, equation in (
|
|
221
|
+
("PCharge", PCharge),
|
|
222
|
+
("PCharge:Holes", dPChargedp),
|
|
223
|
+
):
|
|
224
|
+
devsim.node_model(device=device, region=region, name=name, equation=equation)
|
|
225
|
+
|
|
226
|
+
ni = devsim.get_parameter(device=device, region=region, name="n_i")
|
|
227
|
+
for name, value in (
|
|
228
|
+
("n1", ni),
|
|
229
|
+
("p1", ni),
|
|
230
|
+
("taun", 1e-5),
|
|
231
|
+
("taup", 1e-5),
|
|
232
|
+
):
|
|
233
|
+
devsim.set_parameter(device=device, region=region, name=name, value=value)
|
|
234
|
+
|
|
235
|
+
USRH = "-ElectronCharge*(Electrons*Holes - n_i^2)/(taup*(Electrons + n1) + taun*(Holes + p1))"
|
|
236
|
+
dUSRHdn = "simplify(diff($USRH, Electrons))"
|
|
237
|
+
dUSRHdp = "simplify(diff($USRH, Holes))"
|
|
238
|
+
for name, equation in (
|
|
239
|
+
("USRH", USRH),
|
|
240
|
+
("USRH:Electrons", dUSRHdn),
|
|
241
|
+
("USRH:Holes", dUSRHdp),
|
|
242
|
+
):
|
|
243
|
+
devsim.node_model(device=device, region=region, name=name, equation=equation)
|
|
244
|
+
|
|
245
|
+
devsim.equation(
|
|
246
|
+
device=device,
|
|
247
|
+
region=region,
|
|
248
|
+
name="ElectronContinuityEquation",
|
|
249
|
+
variable_name="Electrons",
|
|
250
|
+
edge_model="ElectronCurrent",
|
|
251
|
+
variable_update="positive",
|
|
252
|
+
time_node_model="NCharge",
|
|
253
|
+
node_model="USRH",
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
devsim.equation(
|
|
257
|
+
device=device,
|
|
258
|
+
region=region,
|
|
259
|
+
name="HoleContinuityEquation",
|
|
260
|
+
variable_name="Holes",
|
|
261
|
+
edge_model="HoleCurrent",
|
|
262
|
+
variable_update="positive",
|
|
263
|
+
time_node_model="PCharge",
|
|
264
|
+
node_model="USRH",
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
def createDriftDiffusionAtContact(device, region, contact):
|
|
269
|
+
format_dict = {"contact": contact}
|
|
270
|
+
for name, equation in (
|
|
271
|
+
(
|
|
272
|
+
"%(contact)snodeelectrons",
|
|
273
|
+
"ifelse(NetDoping > 0, Electrons - celec_%(contact)s, Electrons - n_i^2/chole_%(contact)s)",
|
|
274
|
+
),
|
|
275
|
+
(
|
|
276
|
+
"%(contact)snodeholes",
|
|
277
|
+
"ifelse(NetDoping < 0, Holes - chole_%(contact)s, Holes - n_i^2/celec_%(contact)s)",
|
|
278
|
+
),
|
|
279
|
+
("%(contact)snodeelectrons:Electrons", "1.0"),
|
|
280
|
+
("%(contact)snodeholes:Holes", "1.0"),
|
|
281
|
+
):
|
|
282
|
+
name_sub = name % format_dict
|
|
283
|
+
equation_sub = equation % format_dict
|
|
284
|
+
devsim.contact_node_model(
|
|
285
|
+
device=device, contact=contact, name=name_sub, equation=equation_sub
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
devsim.contact_equation(
|
|
289
|
+
device=device,
|
|
290
|
+
contact=contact,
|
|
291
|
+
name="ElectronContinuityEquation",
|
|
292
|
+
node_model="%snodeelectrons" % contact,
|
|
293
|
+
edge_current_model="ElectronCurrent",
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
devsim.contact_equation(
|
|
297
|
+
device=device,
|
|
298
|
+
contact=contact,
|
|
299
|
+
name="HoleContinuityEquation",
|
|
300
|
+
node_model="%snodeholes" % contact,
|
|
301
|
+
edge_current_model="HoleCurrent",
|
|
302
|
+
)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Copyright 2013 DEVSIM LLC
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
from devsim import (
|
|
6
|
+
add_circuit_node,
|
|
7
|
+
circuit_alter,
|
|
8
|
+
circuit_element,
|
|
9
|
+
custom_equation,
|
|
10
|
+
get_circuit_equation_number,
|
|
11
|
+
get_circuit_node_value,
|
|
12
|
+
solve,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
import test_common
|
|
16
|
+
|
|
17
|
+
# basic linear circuit solved by itself
|
|
18
|
+
add_circuit_node(name="n1", variable_update="default")
|
|
19
|
+
add_circuit_node(name="n2", variable_update="default")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
circuit_element(name="V1", n1="n1", n2="0", value=1.0)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def myassemble(what, timemode):
|
|
26
|
+
n1 = get_circuit_equation_number(node="n1")
|
|
27
|
+
n2 = get_circuit_equation_number(node="n2")
|
|
28
|
+
G1 = 1.0
|
|
29
|
+
G2 = 1.0
|
|
30
|
+
|
|
31
|
+
rcv = []
|
|
32
|
+
rv = []
|
|
33
|
+
|
|
34
|
+
if timemode != "DC":
|
|
35
|
+
return [rcv, rv]
|
|
36
|
+
|
|
37
|
+
if what != "MATRIXONLY":
|
|
38
|
+
v1 = get_circuit_node_value(node="n1", solution="dcop")
|
|
39
|
+
v2 = get_circuit_node_value(node="n2", solution="dcop")
|
|
40
|
+
|
|
41
|
+
I1 = G1 * (v1 - v2)
|
|
42
|
+
I2 = G2 * v2
|
|
43
|
+
rv.extend([n1, I1])
|
|
44
|
+
rv.extend([n2, I2])
|
|
45
|
+
rv.extend([n2, -I1])
|
|
46
|
+
|
|
47
|
+
if what != "RHS":
|
|
48
|
+
mG1 = -G1
|
|
49
|
+
mG2 = -G2
|
|
50
|
+
|
|
51
|
+
rcv.extend([n1, n1, G1])
|
|
52
|
+
rcv.extend([n2, n2, G1])
|
|
53
|
+
rcv.extend([n1, n2, mG1])
|
|
54
|
+
rcv.extend([n2, n1, mG2])
|
|
55
|
+
rcv.extend([n2, n2, G2])
|
|
56
|
+
|
|
57
|
+
print(rcv)
|
|
58
|
+
print(rv)
|
|
59
|
+
return rcv, rv, False
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
custom_equation(name="test1", procedure=myassemble)
|
|
63
|
+
solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=3)
|
|
64
|
+
test_common.print_circuit_solution()
|
|
65
|
+
|
|
66
|
+
circuit_alter(name="V1", value=2.0)
|
|
67
|
+
solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=3)
|
|
68
|
+
test_common.print_circuit_solution()
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Copyright 2013 DEVSIM LLC
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import devsim
|
|
6
|
+
import test_common
|
|
7
|
+
|
|
8
|
+
device = "MyDevice"
|
|
9
|
+
region = "MyRegion"
|
|
10
|
+
|
|
11
|
+
# basic linear circuit solved by itself
|
|
12
|
+
devsim.circuit_element(name="V1", n1=1, n2=0, value=1.0)
|
|
13
|
+
devsim.circuit_element(name="R1", n1=1, n2="cnode1", value=5.0)
|
|
14
|
+
devsim.circuit_element(name="R2", n1="cnode1", n2=0, value=5.0)
|
|
15
|
+
|
|
16
|
+
devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=3)
|
|
17
|
+
test_common.print_circuit_solution()
|
|
18
|
+
|
|
19
|
+
devsim.circuit_alter(name="V1", value=2.0)
|
|
20
|
+
devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=30)
|
|
21
|
+
test_common.print_circuit_solution()
|
|
22
|
+
|
|
23
|
+
test_common.CreateSimpleMesh(device, region)
|
|
24
|
+
|
|
25
|
+
devsim.node_model(device=device, region=region, name="erf", equation="erf(x);")
|
|
26
|
+
devsim.print_node_values(device=device, region=region, name="erf")
|
|
27
|
+
devsim.node_model(
|
|
28
|
+
device=device, region=region, name="d_erf_dx", equation="diff(erf(x),x);"
|
|
29
|
+
)
|
|
30
|
+
devsim.print_node_values(device=device, region=region, name="d_erf_dx")
|
|
31
|
+
devsim.node_model(device=device, region=region, name="erfc", equation="erfc(x);")
|
|
32
|
+
devsim.print_node_values(device=device, region=region, name="erfc")
|
|
33
|
+
devsim.node_model(
|
|
34
|
+
device=device, region=region, name="d_erfc_dx", equation="diff(erfc(x),x);"
|
|
35
|
+
)
|
|
36
|
+
devsim.print_node_values(device=device, region=region, name="d_erfc_dx")
|
|
37
|
+
|
|
38
|
+
devsim.node_model(
|
|
39
|
+
device=device, region=region, name="d_abs_dx", equation="diff(abs(x),x);"
|
|
40
|
+
)
|
|
41
|
+
devsim.print_node_values(device=device, region=region, name="d_abs_dx")
|
|
42
|
+
|
|
43
|
+
devsim.set_parameter(name="param", value=-1.0)
|
|
44
|
+
devsim.node_model(device=device, region=region, name="deptest", equation="param;")
|
|
45
|
+
devsim.print_node_values(device=device, region=region, name="deptest")
|
|
46
|
+
devsim.set_parameter(name="param", value=1.0)
|
|
47
|
+
devsim.print_node_values(device=device, region=region, name="deptest")
|
|
48
|
+
|
|
49
|
+
devsim.node_model(device=device, region=region, name="cdeptest", equation="cnode1;")
|
|
50
|
+
devsim.print_node_values(device=device, region=region, name="cdeptest")
|
|
51
|
+
devsim.set_circuit_node_value(node="cnode1", value=-1.0)
|
|
52
|
+
devsim.print_node_values(device=device, region=region, name="cdeptest")
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright 2013 DEVSIM LLC
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
import devsim
|
|
6
|
+
import test_common
|
|
7
|
+
|
|
8
|
+
device = "MyDevice"
|
|
9
|
+
region = "MyRegion"
|
|
10
|
+
|
|
11
|
+
test_common.CreateSimpleMesh(device, region)
|
|
12
|
+
# the mesh range is 0 to 1
|
|
13
|
+
# range is -1 to 1
|
|
14
|
+
myexp1 = "0.999*(x-0.5)"
|
|
15
|
+
# range is 0 to 2
|
|
16
|
+
myexp2 = "1.999*x+0.0001"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
for i, j in (
|
|
20
|
+
("erf_inv", "erf_inv(x)"),
|
|
21
|
+
("d_erf_inv_dx", "diff(erf_inv(x),x)"),
|
|
22
|
+
("erfc_inv", "erfc_inv(x)"),
|
|
23
|
+
("d_erfc_inv_dx", "diff(erfc_inv(x),x)"),
|
|
24
|
+
("erf_inv", "erf_inv(%s)" % myexp1),
|
|
25
|
+
("d_erf_inv_dx", "diff(erf_inv(%s),x)" % myexp1),
|
|
26
|
+
("erfc_inv", "erfc_inv(%s)" % myexp2),
|
|
27
|
+
("d_erfc_inv_dx", "diff(erfc_inv(%s),x)" % myexp2),
|
|
28
|
+
):
|
|
29
|
+
devsim.node_model(device=device, region=region, name=i, equation=j)
|
|
30
|
+
print()
|
|
31
|
+
try:
|
|
32
|
+
devsim.print_node_values(device=device, region=region, name=i)
|
|
33
|
+
except Exception as e:
|
|
34
|
+
print(f"Failed to print node values for {i}: {e}")
|