Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verilog-A model not mathematically sound #10

Open
Keno opened this issue Nov 22, 2021 · 8 comments
Open

Verilog-A model not mathematically sound #10

Keno opened this issue Nov 22, 2021 · 8 comments

Comments

@Keno
Copy link

Keno commented Nov 22, 2021

The Verilog-A model does a manual integration of the filament thickness here:

Tfilament_current = Tfilament_current + Tfilament_dTdt * t_delta; // 1st-order update to filament thickness

This is not a mathematically sound way to do this, because it makes the solution dependent on the simulator's chosen timestep. Such trajectory-dependent models will confuse adaptive integrators and generally cause more sophisticated simulators to error. The correct way to handle something like this is to give this as a separate ODE to the integrator, e.g.
as

eletrical Tfilament;
[....]
I(Tfilament) <+ ddt(V(Tfliament)) - Tfilament_dTdt

Of course, Tfilament isn't actually a voltage, so if one was bothered by that, one could do a custom discipline

nature Growth;
  units      = "m/s";
  access     = Growth;
  idt_nature = Length;
end

nature Length;
  units      = "m";
  access     = Length;
  ddt_nature = Growth;
end

discipline metric;
  potential Length;
  flow Growth;
enddiscipline

which would let you write the above as:

metric Tfilament;
[....]
Growth(Tfilament) <+ ddt(Length(Tfliament)) - Tfilament_dTdt
@Keno
Copy link
Author

Keno commented Nov 22, 2021

(I can submit a PR for this at some point, but I haven't tested that this actually works yet, so I'll do that once I get around to doing that, unless somebody beats me to it).

@mithro
Copy link
Contributor

mithro commented Nov 22, 2021

These two documents could be useful;

@QuantamHD
Copy link
Collaborator

@Keno Does that also imply that the temperature integrator is wrong as well?

Temperature_current = (Temperature_current + t_delta * (abs(V(TE,BE)*I(TE,BE)) / C_thermal + Temperature_0/tau_thermal))

@Keno
Copy link
Author

Keno commented Nov 22, 2021

Yes, sorry should have specified. Also it's not "wrong" as much as "bad"/"unsound". For integrators without adaptive time stepping or dynamic error detection, it will probably give sensible answers.

@QuantamHD
Copy link
Collaborator

QuantamHD commented Nov 22, 2021

So basically we should remove all the unsound integrators, and replace them with custom disciplines and ODEs.

@Keno
Copy link
Author

Keno commented Nov 22, 2021

Yes, though the "custom disciplines" part of that is optional (and I wouldn't be surprised if many simulators chocked on those) and of course thermal is already a standard discipline. But yes, replace all manual integration with proper ODE representations. Plus you'll be able to remove the time step bounding

so your simulations will both be faster and more accurate :)

@mithro
Copy link
Contributor

mithro commented Nov 23, 2021

@Keno - Looking forward to your pull request! It would be great if we could add some spice simulations which produce the graphs found in the documentation too.

@lekez2005
Copy link

@Keno Is there a way to cap the growth of Tfilament? Tfilament is supposed to be limited to between 3.3nm and 4.9nm. Using the Growth(Tfilament) construct, it grows without bound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants