("topnode_model", "Potential - topbias"), ("topnode_model:Potential", "1"), ("topnode_model:topbias", "-1"), ("botnode_model", "Potential - botbias"), ("botnode_model:Potential", "1"), ): devsim.node_model(device=device, region=region, name=name, equation=equation) # attached to circuit node devsim.contact_equation(device=device, contact="top", name="PotentialEquation", variable_name="Potential", node_model="topnode_model", edge_charge_model="DField", circuit_node="topbias") # attached to ground devsim.contact_equation(device=device, contact="bot", name="PotentialEquation", variable_name="Potential", node_model="botnode_model", edge_charge_model="DField") # # Voltage source # devsim.circuit_element(name="V1", n1=1, n2=0, value=1.0, acreal=1.0) devsim.circuit_element(name="R1", n1="topbias", n2=1, value=1e3) # 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.solve(type="ac", frequency=1e10) devsim.solve(type="ac", frequency=1e15)
devices = ("MyDevice1", "MyDevice2") region = "MyRegion" #### #### Meshing #### test_common.CreateSimpleMesh(device=devices[0], region=region) devsim.create_device(mesh="dog", device=devices[1]) for device in devices: test_common.SetupResistorConstants(device=device, region="") test_common.SetupInitialResistorSystem(device, region) devsim.add_circuit_node(name="cnode1", variable_update="log_damp") devsim.circuit_element(name="R1", n1="cnode1", n2=0, value=1e15) # ground these contacts devsim.set_parameter(device="MyDevice1", name="topbias", value=0.0) devsim.set_parameter(device="MyDevice2", name="botbias", value=0.0) test_common.SetupInitialResistorContact(device="MyDevice1", contact="top", use_circuit_bias=True, circuit_node="cnode1") test_common.SetupInitialResistorContact(device="MyDevice1", contact="bot", use_circuit_bias=False, circuit_node="topbias") test_common.SetupInitialResistorContact(device="MyDevice2",
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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 # ssac circuit only devsim.circuit_element(name="V1", n1=1, n2=0, value=1.0, acreal=1.0) #lambda = 0.04 devsim.circuit_element(name="R1", n1=1, n2=2, value=5) devsim.circuit_element(name="C1", n1=2, n2=0, value=5) print("transient_dc") devsim.solve(type="transient_dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=3) devsim.circuit_alter(name="V1", value=0.0) print("transient_tr") devsim.solve(type="transient_tr", absolute_error=1.0, relative_error=1e-14,
# you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. # solid state resistor ssac import devsim import test_common devsim.circuit_element(name="V1", n1="topbias", n2=0, acreal=1.0) device = "MyDevice" region = "MyRegion" #### #### Meshing #### devsim.create_2d_mesh(mesh="dog") devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=0, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=1e-5, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=0, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="y", pos=1e-5, ps=1e-6) devsim.add_2d_mesh_line(mesh="dog", dir="x", pos=-1e-8, ps=1e-8)
# # 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 import test_common device="MyDevice" 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);")