From e4ff0d3322b1da0c747fd98d3100e4bea840bada Mon Sep 17 00:00:00 2001 From: couriersud Date: Fri, 29 Mar 2019 19:40:39 +0100 Subject: netlist: Improved MOS transistor model. [Couriersud] This is a significant improvement to the MOS transistor model. It adds modelling of the Meyer capacitance model. This is a somewhat academic addition since the effects occur on a nanosecond time scale and have a huge impact on performance. I plan to make the capacitance model selectable. Both on a model level as well as by introducing a global solver parameter. The model delivers comparable results to LTSpice. --- nl_examples/nmos_fet.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'nl_examples') diff --git a/nl_examples/nmos_fet.cpp b/nl_examples/nmos_fet.cpp index ffa67c1bf00..8a096af59ac 100644 --- a/nl_examples/nmos_fet.cpp +++ b/nl_examples/nmos_fet.cpp @@ -9,13 +9,15 @@ #include "netlist/devices/net_lib.h" #include "netlist/analog/nld_twoterm.h" -NETLIST_START(bjt) +NETLIST_START(nmos) /* Standard stuff */ CLOCK(clk, 100) // 100 Hz SOLVER(Solver, 48000) - PARAM(Solver.ACCURACY, 1e-7) - PARAM(Solver.NR_LOOPS, 5000) + PARAM(Solver.ACCURACY, 1e-9) + PARAM(Solver.NR_LOOPS, 50000) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-9) ANALOG_INPUT(V5, 5) ANALOG_INPUT(V3, 3.5) @@ -40,7 +42,7 @@ NETLIST_START(bjt) NET_C(RCE.1, M.D) NET_C(RCE.2, GND) - // capacitance over D - S + // capacitance over G - S CAP(C, CAP_N(1)) NET_C(M.D, C.1) -- cgit v1.2.3