def run_initial_bias(use_circuit_bias, net_doping=1e16): ''' use_circuit for topbias ''' test_common.SetupResistorConstants(device, region) test_common.SetupInitialResistorSystem(device, region, net_doping) test_common.SetupInitialResistorContact(device=device, contact='top', use_circuit_bias=use_circuit_bias) test_common.SetupInitialResistorContact(device=device, contact='bot') ##### ##### Initial DC Solution ##### devsim.solve(type='dc', absolute_error=1.0, relative_error=1e-10, maximum_iterations=30) for name in ("Potential", "IntrinsicElectrons"): devsim.print_node_values(device=device, region=region, name=name) test_common.SetupCarrierResistorSystem(device, region) test_common.SetupCarrierResistorContact(device=device, contact='top', use_circuit_bias=use_circuit_bias) test_common.SetupCarrierResistorContact(device, contact='bot')
test_common.SetupContinuousPotentialAtInterface(device, interface) ##### ##### Initial DC Solution ##### devsim.set_parameter(name="topbias", value=0.0) devsim.set_parameter(name="botbias", value=0.0) devsim.solve(type='dc', absolute_error=1.0, relative_error=1e-10, maximum_iterations=30) for region in regions: for name in ("Potential", "IntrinsicElectrons"): devsim.print_node_values(device=device, region=region, name=name) for region in regions: test_common.SetupCarrierResistorSystem(device, region) for contact in contacts: test_common.SetupCarrierResistorContact(device, contact=contact) test_common.SetupContinuousElectronsAtInterface(device, interface) 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): devsim.set_parameter(name="topbias", value=v) devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30)
# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import devsim device="MyDevice" region="MyRegion" devsim.load_devices(file="trimesh2.msh") devsim.print_node_values(device="MyDevice", region="MyRegion", name="NodeVolume") devsim.print_edge_values(device="MyDevice", region="MyRegion", name="EdgeCouple") devsim.set_parameter(device=device, region=region, name="Permittivity", value=3.9*8.85e-14) devsim.set_parameter(device=device, region=region, name="ElectricCharge", value=1.6e-19) devsim.node_solution(device=device, region=region, name="Potential") devsim.edge_from_node_model(device=device, region=region, node_model="Potential") devsim.edge_model(device=device, region=region, name="ElectricField", equation="(Potential@n0 - Potential@n1)*EdgeInverseLength") devsim.edge_model(device=device, region=region, name="ElectricField:Potential@n0", equation="EdgeInverseLength") devsim.edge_model(device=device, region=region, name="ElectricField:Potential@n1", equation="-EdgeInverseLength") devsim.set_parameter(device=device, region=region, name="topbias", value=1.0e-0) devsim.set_parameter(device=device, region=region, name="botbias", value=0.0)
contact="top", use_circuit_bias=True, circuit_node="cnode1") test_common.SetupInitialResistorContact(device="MyDevice2", contact="bot", use_circuit_bias=False) devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=30) for device in devices: print(device) for name in ("Potential", "IntrinsicElectrons"): devsim.print_node_values(device=device, region=region, name=name) for device in devices: test_common.SetupCarrierResistorSystem(device=device, region=region) test_common.SetupCarrierResistorContact(device="MyDevice1", contact="top", use_circuit_bias=True, circuit_node="cnode1") test_common.SetupCarrierResistorContact(device="MyDevice1", contact="bot", use_circuit_bias=False, circuit_node="topbias") test_common.SetupCarrierResistorContact(device="MyDevice2", contact="top",
devsim.set_parameter( device=device, region=region, name="botbias", value=0.0) devsim.edge_model( device=device, region=region, name="PotentialEdgeFlux", equation="Permittivity*ElectricField") devsim.edge_model( device=device, region=region, name="PotentialEdgeFlux:Potential@n0", equation="diff(Permittivity*ElectricField, Potential@n0)") devsim.edge_model( device=device, region=region, name="PotentialEdgeFlux:Potential@n1", equation="-PotentialEdgeFlux:Potential@n0") devsim.equation( device=device, region=region, name="PotentialEquation", variable_name="Potential", edge_model="PotentialEdgeFlux", variable_update="default") devsim.node_model( device=device, region=region, name="topnode_model" , equation="Potential - topbias") devsim.node_model( device=device, region=region, name="topnode_model:Potential", equation="1") devsim.node_model( device=device, region=region, name="botnode_model" , equation="Potential - botbias") devsim.node_model( device=device, region=region, name="botnode_model:Potential", equation="1") devsim.contact_equation( device=device, contact="top", name="PotentialEquation", variable_name="Potential", node_model="topnode_model", edge_charge_model="PotentialEdgeFlux") devsim.contact_equation( device=device, contact="bot", name="PotentialEquation", variable_name="Potential", node_model="botnode_model", edge_charge_model="PotentialEdgeFlux") devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30) print(devsim.get_contact_charge(device=device, contact="top", equation="PotentialEquation")) print(devsim.get_contact_charge(device=device, contact="bot", equation="PotentialEquation")) devsim.print_node_values(device=device, region=region, name="NodeVolume") devsim.print_edge_values(device=device, region=region, name="ElectricField") devsim.print_edge_values(device=device, region=region, name="EdgeCouple")
region="MyRegion" # basic linear circuit solved by itself devsim.circuit_element(name="V1", n1=1, n2=0, value=1.0) devsim.circuit_element(name="R1", n1=1, n2="cnode1", value=5.0) devsim.circuit_element(name="R2", n1="cnode1", n2=0, value=5.0) devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=3) devsim.circuit_alter(name="V1", value=2.0) devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=30) test_common.CreateSimpleMesh(device, region) devsim.node_model(device=device, region=region, name="erf", equation="erf(x);") devsim.print_node_values(device=device, region=region, name="erf") devsim.node_model(device=device, region=region, name="d_erf_dx", equation="diff(erf(x),x);") devsim.print_node_values(device=device, region=region, name="d_erf_dx") devsim.node_model(device=device, region=region, name="erfc", equation="erfc(x);") devsim.print_node_values(device=device, region=region, name="erfc") devsim.node_model(device=device, region=region, name="d_erfc_dx", equation="diff(erfc(x),x);") devsim.print_node_values(device=device, region=region, name="d_erfc_dx") devsim.node_model(device=device, region=region, name="d_abs_dx", equation="diff(abs(x),x);") devsim.print_node_values(device=device, region=region, name="d_abs_dx") devsim.set_parameter(name="param", value=-1.0) devsim.node_model(device=device, region=region, name="deptest", equation="param;") devsim.print_node_values(device=device, region=region, name="deptest") devsim.set_parameter(name="param", value=1.0) devsim.print_node_values(device=device, region=region, name="deptest")
print_flux() set_permittivities(si=1.0, ox=1.0) devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30) print_charge() print_flux() # makes sure this global scope does not interfere devsim.set_parameter(device=device, name="Permittivity", value=11.1 * 8.85e-14) set_permittivities(si=11.1, ox=3.9) devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-10, maximum_iterations=30) print_charge() print_flux() devsim.print_edge_values(device=device, region="MySiRegion", name="ElectricField") devsim.print_edge_values(device=device, region="MyOxRegion", name="ElectricField") devsim.print_node_values(device=device, region="MySiRegion", name="Potential") devsim.print_node_values(device=device, region="MyOxRegion", name="Potential")
name="Eta:r", equation="diff(InvFermi(r),r);") devsim.node_model(device=device, region=region, name="r2:Eta", equation="diff(Fermi(Eta),Eta);") devsim.node_model(device=device, region=region, name="r3:Eta", equation="dFermidx(Eta);") devsim.node_model(device=device, region=region, name="r4:Eta", equation="1.0/dInvFermidx(r2);") devsim.print_node_values(device=device, region=region, name="Electrons") devsim.print_node_values(device=device, region=region, name="r") devsim.print_node_values(device=device, region=region, name="Eta") devsim.print_node_values(device=device, region=region, name="r2") devsim.print_node_values(device=device, region=region, name="Eta:r") devsim.print_node_values(device=device, region=region, name="r2:Eta") devsim.print_node_values(device=device, region=region, name="r3:Eta") devsim.print_node_values(device=device, region=region, name="r4:Eta") devsim.set_parameter(name="Nc", value=3.23e19) devsim.set_parameter(name="Nv", value=1.83e19) devsim.set_parameter(name="Eg", value=1.12) devsim.set_parameter(name="Vt", value=0.0259) devsim.node_model(device=device, region=region, name="ni_f",