does anyone know why the equation of ElectricField is defined as below.
edge_model(device=device, region=region, name=“ElectricField”,
equation=“(Potential@n0 - Potential@n1)*EdgeInverseLength”)

But why not：edge_model(device=device, region=region, name=“ElectricField”,
equation=“(Potential@n0 - Potential@n1)/EdgeInverseLength”)
Since Electrical Field = Potential / distance.

I used edge_average_model to define the electric field，but why it occure some fatal error in 2D capacitor.

scripts as below

edge_average_model(device=device, region=region, node_model="Potential", edge_model="ElecticField", average_type="negative_gradient")
edge_average_model(device=device, region=region, node_model="Potential", edge_model="ElecticField", average_type="negative_gradient", derivative="Potential")
###
### Model the D Field
###
edge_model(device=device, region=region, name="DField",
equation="Permittivity*ElectricField")
edge_model(device=device, region=region, name="DField:Potential@n0",
equation="diff(Permittivity*ElectricField, Potential@n0)")
edge_model(device=device, region=region, name="DField:Potential@n1",
equation="-DField:Potential@n0")

errors as below：
number of equations 8281
while evaluating edge model DField on Device: MyDevice on Region: air
Value for “ElectricField” not available.
while evaluating model DField: expression (Permittivity * ElectricField) evaluates to invalid

Traceback (most recent call last):

File “D:\06 Devsim\projects\2d capacitor\2dcap.py”, line 130, in
solve(type=“dc”, absolute_error=1.0, relative_error=1e-10, maximum_iterations=100,

I followed your suggestion and it did not work. So we still have to follow the electric field definition as below.

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
# ###
edge_model(device=device, region=region, name="ElectricField",
equation="(Potential@n0 - Potential@n1)/EdgeLength")
edge_model(device=device, region=region, name="ElectricField:Potential@n0",
equation="EdgeInverseLength")
edge_model(device=device, region=region, name="ElectricField:Potential@n1",
equation="-EdgeInverseLength")

@Juan，
Then please help check if i understand it correctly.
1、if we have some semicondor area where net carrier density is not zero, then we have to write the equation in some other expression.
2、for different area we can use different equation, and also need to consider the interface boundary condition. for semiconductor junction we need to use the SRH model equation but how about a inverse conducting layer? do we have some suggestion ?

Yes. That is correct. For the initial solution, the equilibrium Potential equation would require an expression for NetDoping, as well as Electrons and Holes based on the Potential.

For drift diffusion, the PotentialEquation would incorporate NetDoping and Electrons and Holes. The electron and hole continuity equations would also be added. Please see the examples in examples/diode for a simple diode simulation, with one region.

The inverse conducting area is a direct result of the other models. Please see the other topics in the forum concerning the interface and contact equations. Also the SRH model is available. A good overview is available here: https://github.com/devsim/devsim_bjt_example