Hi,
When I read the following example on AMS, I am puzzled about two branches for two terminals. What relationship of these two branches i_diode, junc_cap ? A diode should have one current flow through, what about the two current?
Thanks
Code:module diode (a, c);
electrical a, c;
branch (a, c) i_diode, junc_cap;
parameter real is = 1e-14, tf = 0, cjo = 0, imax = 1, phi = 0.7 ;
analog begin
I(i_diode) <+ is*(limexp(V(i_diode)/$vt) – 1);
I(junc_cap) <+
ddt(tf*I(i_diode) - 2*cjo*sqrt(phi*(phi*V(junc_cap))));
if (I(<a>) > imax)
$strobe( "Warning: diode is melting!" );
end
endmodule