TITLE 'Trapezoidal Resistor' { This script finds the resistance of a thin trapedoial sheet. } VARIABLES V ! V is the potential Q ! Q is for current streamlines DEFINITIONS rsh = 1 ! sheet resistance h=1 s=1/(rsh*h) ! conductivity L=10 ! Contact separation a=2 ! Film Width (out of page) b=6 ! Contact length V0 =1 ! voltage on first contact V1 =0 ! voltage on second contact { Here we find the current and the total resistance } It=s*h*LINE_INTEGRAL(Normal(grad(V)),'crosssection') Rin =(V1-V0)/It EQUATIONS V: DIV(s*GRAD(V)) = 0 ! Laplace's equation Q: DIV(GRAD(Q)/s) = 0 ! Adjoint equation BOUNDARIES REGION 1 'resistor' { Now define a path across the cross-section to find the current} START "crosssection" (a,0) LINE TO (a,a) FINISH { For each line segment, define boundary conditions for V } START(0,0) VALUE(V)=V0 natural(Q) = tangential(grad(V)) LINE TO (0,a) NATURAL(V)=0 natural(Q) = tangential(grad(V)) LINE TO (a,a) NATURAL(V)=0 natural(Q) = tangential(grad(V)) LINE TO (L,b) NATURAL(V)=0 natural(Q) = tangential(grad(V)) LINE TO (L+b,b) VALUE(V)=V1 natural(Q) = tangential(grad(V)) LINE TO (L+b,0) NATURAL(V)=0 natural(Q) = tangential(grad(V)) LINE TO FINISH PLOTS CONTOUR(V) REPORT(It) Report(Rin) CONTOUR(Q) REPORT(It) Report(Rin) CONTOUR(V,Q) REPORT(It) Report(Rin) END