Pavel wrote on Nov 10th, 2006, 6:50am:Your response confirms my original opinion concerning Charge and Flux natures.
They are USELESS.
Supposing that one knows Charge (or Flux) functions: CHARGE = F1(time), FLUX = F2(time).
Current through capaitor and voltage on inductor could be assigned ignoring physical nature of charge (flux).
One can declare CHARGE and FLUX as real variables - it will be sufficient. Then apply to them ddt function and we have current and voltage...
Or I miss something ...
You did miss something. The creation of different natures allows you to set different tolerances on the variables: if the simulator applied ABSTOL (which usually runs around 1e-12 in Spice-like simulators) to charge variables (which in modern MOSFETs runs in the 1e-18 range, then you could never expect the charge to give accurate results, because any answer would be below the tolerance.
Also, there's some mention about compatible disciplines -- a good simulator will warn you (or give an error) if you accidentally connect a magnetic port to one that is really supposed to be electrical. I heard a story once about a designer who accidentally connected the "thermal terminal" of a bipolar model with self-heating to an electrical wire in a Spice simulator; he thought Kirchoff's current law was being violated because current was disappearing into the "thermal ground" of the BJT model (and he must have been getting the wrong answer because his BJT was incorrectly computing its temperature).
Quote:Concerning your verilog-A code - the inductor isn't mentionned.
How can I modelize the reception of a RF-signal by LC-tank.
I think you'd need to write your own inductor with the usual two electrical ports
and a magnetic port to bring in the RF:
Code:module fluc_recv(a,b,rf_in);
inout a, b, rf_in;
electrical a, b;
magnetic rf_in;
parameter real L = 1n from (0:inf);
analog
V(a,b) <+ ddt(L * I(a,b) + Phi(rf_in));
endmodule