ModelicaStandardLibrary icon indicating copy to clipboard operation
ModelicaStandardLibrary copied to clipboard

Proper unit for gamma. It is computed as the square root of something.

Open HansOlsson opened this issue 10 months ago • 2 comments

Closes #4369 To confirm I just binged "gamma spice Bulk threshold parameter" and found: https://www.seas.upenn.edu/~jan/spice/spice.MOSparamlist.html which contains the same unit for gamma. And the copilot said: "Its units are Volts^(1/2)."

HansOlsson avatar Apr 02 '24 06:04 HansOlsson

  • What about MosModelLineVariableqs.m_gamma where it is of type Real?

Should also be updated.

  • Did you notice that there are two different calculations in the lib? In Modelica.Electrical.Spice3.Internal.Mos1.mos1ModelLineParamsInitEquations it is a sqrt, in Modelica.Electrical.Spice3.Internal.Mos2.mos2ModelLineParamsInitEquationsRevised it is a quotient. I am not sure if this is intentional.

I have mostly skipped units in functions.

out_v.m_gamma := sqrt(2 * SpiceConstants.EPSSIL * SpiceConstants.CHARGE *
			   in_p.m_substrateDoping * 1e6 / out_v.m_oxideCapFactor);         // (cm**3/m**3)

vs.

out_p.m_gamma := sqrt(2.0*Spice3.Internal.SpiceConstants.EPSSIL*
	Spice3.Internal.SpiceConstants.CHARGE*out_p.m_substrateDoping*1.0e6)
	/out_p.m_oxideCapFactor;

An additional problem here is that m_substrateDoping and m_oxideCapFactor both lack units.

Deleted

Additionally spice is weird in that it has prefixed SI-units, and even not really SI-units (like eV).

HansOlsson avatar Apr 03 '24 07:04 HansOlsson

Oh, I realized that the units are even weirder - and the previous was incorrect.

EPSSIL shouldn't be unit-less, but as far as I understand has unit "F/m", specifically it is computed based on the relative di-electric constant of Silicon being 11.7 and 8.85...e-12 F/m being Modelica.Constants.epsilon_0.

Added: The name EPSSIL means epsilion (di-electric constant) for Silicon.

The m_oxideCapFactor is computed as di-electric-constant divided by thickness and should thus have unit "F/m2" (ignoring unit-conversions - I think thickness is measured in "um").

That would make the first equation unit-correct if doping was measured in "1/m2" instead of "1/m3"; and I don't know how the second equation would be unit-correct.

But: for doping we have: out_p.m_substrateDoping*1.0e6 > Modelica.Electrical.Spice3.Internal.MaterialParameters.IntCondCarrDensity - where IntCondCarrDensity clearly is per volume, and 1.0e6 is cm3 to m3 conversion (for mos1 the IntCondCarrDensity is inlined, but they are the same formulas); so it should have unit "1/m3".

Or basically: There seems to be some remaining unit-issues, but I don't know which ones; and I don't know if it is just a matter of missing/incorrect units or whether some formulas should be updated.

HansOlsson avatar Apr 03 '24 12:04 HansOlsson