This component consists of a simple diode parallel with an ohmic
resistance (
). The current passing through this component is
defined as a function of the voltage across the ports, i.e.,
where
and
are the saturation current and the voltage
equivalent of temperature, respectively. If the exponent
reaches a certain limit (
), the diode characterisic becomes
linear to avoid overflow.
| Set Diode block parameter | |
| Saturation cuurent (A) | 0.000001 |
| Voltage equivalent to temperature (Volt) | 0.04 |
| Max exponent for linear continuation | 15 |
| R (ohm) | 1.000E+08 |
class Diode "Simple diode"
Pin p, n;
parameter Real Ids=1.e-6 "Saturation current";
parameter Real Vt=0.04 "Voltage equivalent of temperature (kT/qn)";
parameter Real Maxexp=15 "Max. exponent for linear continuation";
parameter Real R=1.e8 "Parallel ohmic resistance";
Real v;
equation
v = p.v - n.v;
p.i = if noEvent(v/Vt > Maxexp) then
Ids*(Modelica.Math.exp(Maxexp)*(1 + v/Vt - Maxexp) - 1) + v/R
else
Ids*(Modelica.Math.exp(v/Vt) - 1) + v/R;
p.i = -n.i;
end Diode;