Xyce  6.1
N_DEV_ADMSHBT_X.h
Go to the documentation of this file.
1 
2 // -*-c++-*-
3 //-----------------------------------------------------------------------------
4 // Copyright Notice
5 //
6 // Copyright 2002 Sandia Corporation. Under the terms
7 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
8 // Government retains certain rights in this software.
9 //
10 // Xyce(TM) Parallel Electrical Simulator
11 // Copyright (C) 2002-2015 Sandia Corporation
12 //
13 // This program is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program. If not, see <http://www.gnu.org/licenses/>.
25 //-----------------------------------------------------------------------------
26 
27 //-----------------------------------------------------------------------------
28 // Filename : $RCSfile: N_DEV_ADMSHBT_X.h,v $
29 //
30 // Purpose :
31 //
32 // Special Notes : Generated from verilog file fbhhbt-2.1_nonoise_limited_inductors_typed.va with ADMS
33 // interface for Xyce 6.1.0
34 // DO NOT EDIT THIS FILE DIRECTLY! It may be overwritten!
35 //
36 // Creator : admsXml-2.3.4
37 //
38 // Creation Date : Wed, 04 Mar 2015 18:40:52
39 //
40 // Revision Information:
41 // ---------------------
42 //
43 // Revision Number: $Revision: 1.53.2.1 $
44 //
45 // Revision Date : $Date: 2015/04/02 18:20:08 $
46 //
47 // Current Owner : $Author: tvrusso $
48 //-----------------------------------------------------------------------------
49 #ifndef Xyce_N_DEV_ADMSHBT_X_h
50 #define Xyce_N_DEV_ADMSHBT_X_h
51 
52 
53 #include <Sacado.hpp>
54 
55 #include <N_DEV_Configuration.h>
56 #include <N_DEV_Const.h>
57 #include <N_DEV_DeviceBlock.h>
58 #include <N_DEV_DeviceInstance.h>
59 #include <N_DEV_DeviceModel.h>
60 #include <N_DEV_BJT.h>
61 
62 
63 namespace Xyce {
64 namespace Device {
65 namespace ADMSHBT_X {
66 
67 // This typedef is for our automatic differentiation:
68 typedef Sacado::Fad::SFad<double,19> AdmsFadType;
69 typedef Sacado::Fad::SFad<double,1> AdmsSensFadType;
70 
71 class Model;
72 class Instance;
74 
75 //-----------------------------------------------------------------------------
76 // Class : InstanceSensitivity
77 //
78 // Purpose : This class is a functor for sensitivity
79 //
80 // Special Notes :
81 // Creator :
82 // Creation Date :
83 //-----------------------------------------------------------------------------
85 {
86 public:
88  baseSensitivity() {};
89 
90  virtual ~InstanceSensitivity() {};
91 
92  virtual void operator()(
93  const ParameterBase &entity,
94  const std::string &param,
95  std::vector<double> & dfdp,
96  std::vector<double> & dqdp,
97  std::vector<double> & dbdp,
98  std::vector<int> & Findices,
99  std::vector<int> & Qindices,
100  std::vector<int> & Bindices
101  ) const ;
102 };
103 
105 
106 
107 //-----------------------------------------------------------------------------
108 // Class : ModelSensitivity
109 //
110 // Purpose : This class is a functor for sensitivity
111 //
112 // Special Notes :
113 // Creator :
114 // Creation Date :
115 //-----------------------------------------------------------------------------
117 {
118 public:
120  baseSensitivity() {};
121 
122  virtual ~ModelSensitivity() {};
123 
124  virtual void operator()(
125  const ParameterBase &entity,
126  const std::string &param,
127  std::vector<double> & dfdp,
128  std::vector<double> & dqdp,
129  std::vector<double> & dbdp,
130  std::vector<int> & Findices,
131  std::vector<int> & Qindices,
132  std::vector<int> & Bindices
133  ) const ;
134 };
135 
137 
138 // general purpose free functions
139 // thermal voltage at kelvin temperature temp)
140 template <typename T> static inline T adms_vt(const T temp) {return(CONSTKoverQ*temp);};
141 
142 // Figure out how to template this shiznit!
143 //-----------------------------------------------------------------------------
144 
145 
146 template<typename Tin>
147 static Tin adms_ternary_op(const bool cond, const Tin &ifTrue, const Tin &ifFalse)
148 {
149  if (cond)
150  return ifTrue;
151  else
152  return ifFalse;
153 }
154 
155 template<typename Tin>
156 static Tin adms_ternary_op(const bool cond, const Tin &ifTrue, const double &ifFalse)
157 {
158  if (cond)
159  return ifTrue;
160  else
161  return Tin(ifFalse);
162 }
163 
164 template<typename Tin>
165 static Tin adms_ternary_op(const bool cond, const double &ifTrue, const Tin &ifFalse)
166 {
167  if (cond)
168  return Tin(ifTrue);
169  else
170  return ifFalse;
171 }
172 
173 
174 
175 
176 
177 //-----------------------------------------------------------------------------
178 // Free functions used by sensitivity
179 //
180 //-----------------------------------------------------------------------------
182  std::vector <double> & probeVars,
183  // probe constants
184  const int admsProbeID_V_t_ti,
185  const int admsProbeID_V_b_c,
186  const int admsProbeID_V_c_GND,
187  const int admsProbeID_V_b_GND,
188  const int admsProbeID_V_cx_bii,
189  const int admsProbeID_V_exx_bii,
190  const int admsProbeID_V_ex_bii,
191  const int admsProbeID_V_bii_bi,
192  const int admsProbeID_I_c_ci,
193  const int admsProbeID_I_e_ei,
194  const int admsProbeID_I_b_bi,
195  const int admsProbeID_V_ti_GND,
196  const int admsProbeID_V_ci_ei,
197  const int admsProbeID_V_exx_ei,
198  const int admsProbeID_V_cx_ci,
199  const int admsProbeID_V_ex_ei,
200  const int admsProbeID_V_bii_ei,
201  const int admsProbeID_V_bii_ci,
202  const int admsProbeID_V_bi_ci,
203  // node constants
204  const int admsNodeID_c,
205  const int admsNodeID_b,
206  const int admsNodeID_e,
207  const int admsNodeID_t,
208  const int admsNodeID_ei,
209  const int admsNodeID_bi,
210  const int admsNodeID_bii,
211  const int admsNodeID_ci,
212  const int admsNodeID_ti,
213  const int admsNodeID_ex,
214  const int admsNodeID_exx,
215  const int admsNodeID_cx,
216  const int admsBRA_ID_b_bi,
217  const int admsBRA_ID_e_ei,
218  const int admsBRA_ID_c_ci,
219  // instance parameters
220  // reals
221  AdmsSensFadType & instancePar_Temp,
222  bool instancePar_given_Temp,
223  AdmsSensFadType & instancePar_L,
224  bool instancePar_given_L,
225  AdmsSensFadType & instancePar_W,
226  bool instancePar_given_W,
227  // non-reals(including hidden)
228  int instancePar_N,
229  bool instancePar_given_N,
230  // model parameters
231  // reals
232  AdmsSensFadType & modelPar_Temp,
233  bool modelPar_given_Temp,
234  AdmsSensFadType & modelPar_Rth,
235  bool modelPar_given_Rth,
236  AdmsSensFadType & modelPar_Cth,
237  bool modelPar_given_Cth,
238  AdmsSensFadType & modelPar_L,
239  bool modelPar_given_L,
240  AdmsSensFadType & modelPar_W,
241  bool modelPar_given_W,
242  AdmsSensFadType & modelPar_Jsf,
243  bool modelPar_given_Jsf,
244  AdmsSensFadType & modelPar_nf,
245  bool modelPar_given_nf,
246  AdmsSensFadType & modelPar_Vg,
247  bool modelPar_given_Vg,
248  AdmsSensFadType & modelPar_Jse,
249  bool modelPar_given_Jse,
250  AdmsSensFadType & modelPar_ne,
251  bool modelPar_given_ne,
252  AdmsSensFadType & modelPar_Rbxx,
253  bool modelPar_given_Rbxx,
254  AdmsSensFadType & modelPar_Vgb,
255  bool modelPar_given_Vgb,
256  AdmsSensFadType & modelPar_Jsee,
257  bool modelPar_given_Jsee,
258  AdmsSensFadType & modelPar_nee,
259  bool modelPar_given_nee,
260  AdmsSensFadType & modelPar_Rbbxx,
261  bool modelPar_given_Rbbxx,
262  AdmsSensFadType & modelPar_Vgbb,
263  bool modelPar_given_Vgbb,
264  AdmsSensFadType & modelPar_Jsr,
265  bool modelPar_given_Jsr,
266  AdmsSensFadType & modelPar_nr,
267  bool modelPar_given_nr,
268  AdmsSensFadType & modelPar_Vgr,
269  bool modelPar_given_Vgr,
270  AdmsSensFadType & modelPar_XCjc,
271  bool modelPar_given_XCjc,
272  AdmsSensFadType & modelPar_Jsc,
273  bool modelPar_given_Jsc,
274  AdmsSensFadType & modelPar_nc,
275  bool modelPar_given_nc,
276  AdmsSensFadType & modelPar_Rcxx,
277  bool modelPar_given_Rcxx,
278  AdmsSensFadType & modelPar_Vgc,
279  bool modelPar_given_Vgc,
280  AdmsSensFadType & modelPar_Bf,
281  bool modelPar_given_Bf,
282  AdmsSensFadType & modelPar_kBeta,
283  bool modelPar_given_kBeta,
284  AdmsSensFadType & modelPar_Br,
285  bool modelPar_given_Br,
286  AdmsSensFadType & modelPar_VAF,
287  bool modelPar_given_VAF,
288  AdmsSensFadType & modelPar_VAR,
289  bool modelPar_given_VAR,
290  AdmsSensFadType & modelPar_IKF,
291  bool modelPar_given_IKF,
292  AdmsSensFadType & modelPar_IKR,
293  bool modelPar_given_IKR,
294  AdmsSensFadType & modelPar_Mc,
295  bool modelPar_given_Mc,
296  AdmsSensFadType & modelPar_BVceo,
297  bool modelPar_given_BVceo,
298  AdmsSensFadType & modelPar_kc,
299  bool modelPar_given_kc,
300  AdmsSensFadType & modelPar_BVebo,
301  bool modelPar_given_BVebo,
302  AdmsSensFadType & modelPar_Tr,
303  bool modelPar_given_Tr,
304  AdmsSensFadType & modelPar_Trx,
305  bool modelPar_given_Trx,
306  AdmsSensFadType & modelPar_Tf,
307  bool modelPar_given_Tf,
308  AdmsSensFadType & modelPar_Tft,
309  bool modelPar_given_Tft,
310  AdmsSensFadType & modelPar_Thcs,
311  bool modelPar_given_Thcs,
312  AdmsSensFadType & modelPar_Ahc,
313  bool modelPar_given_Ahc,
314  AdmsSensFadType & modelPar_Cje,
315  bool modelPar_given_Cje,
316  AdmsSensFadType & modelPar_mje,
317  bool modelPar_given_mje,
318  AdmsSensFadType & modelPar_Vje,
319  bool modelPar_given_Vje,
320  AdmsSensFadType & modelPar_Cjc,
321  bool modelPar_given_Cjc,
322  AdmsSensFadType & modelPar_mjc,
323  bool modelPar_given_mjc,
324  AdmsSensFadType & modelPar_Vjc,
325  bool modelPar_given_Vjc,
326  AdmsSensFadType & modelPar_kjc,
327  bool modelPar_given_kjc,
328  AdmsSensFadType & modelPar_Cmin,
329  bool modelPar_given_Cmin,
330  AdmsSensFadType & modelPar_J0,
331  bool modelPar_given_J0,
332  AdmsSensFadType & modelPar_XJ0,
333  bool modelPar_given_XJ0,
334  AdmsSensFadType & modelPar_Rci0,
335  bool modelPar_given_Rci0,
336  AdmsSensFadType & modelPar_Jk,
337  bool modelPar_given_Jk,
338  AdmsSensFadType & modelPar_RJk,
339  bool modelPar_given_RJk,
340  AdmsSensFadType & modelPar_Vces,
341  bool modelPar_given_Vces,
342  AdmsSensFadType & modelPar_Rc,
343  bool modelPar_given_Rc,
344  AdmsSensFadType & modelPar_Re,
345  bool modelPar_given_Re,
346  AdmsSensFadType & modelPar_Rb,
347  bool modelPar_given_Rb,
348  AdmsSensFadType & modelPar_Rb2,
349  bool modelPar_given_Rb2,
350  AdmsSensFadType & modelPar_Lc,
351  bool modelPar_given_Lc,
352  AdmsSensFadType & modelPar_Le,
353  bool modelPar_given_Le,
354  AdmsSensFadType & modelPar_Lb,
355  bool modelPar_given_Lb,
356  AdmsSensFadType & modelPar_Cq,
357  bool modelPar_given_Cq,
358  AdmsSensFadType & modelPar_Cpb,
359  bool modelPar_given_Cpb,
360  AdmsSensFadType & modelPar_Cpc,
361  bool modelPar_given_Cpc,
362  AdmsSensFadType & modelPar_Tnom,
363  bool modelPar_given_Tnom,
364  // non-reals (including hidden)
365  int modelPar_Mode,
366  bool modelPar_given_Mode,
367  int modelPar_Noise,
368  bool modelPar_given_Noise,
369  int modelPar_Debug,
370  bool modelPar_given_Debug,
371  int modelPar_DebugPlus,
372  bool modelPar_given_DebugPlus,
373  int modelPar_N,
374  bool modelPar_given_N,
375  int modelPar_dtype,
376  // basic variables
377  double admsTemperature, double adms_vt_nom, double gmin, std::vector <AdmsSensFadType> & staticContributions, std::vector <AdmsSensFadType> & dynamicContributions, const Instance & theInstance);
378 
380  // instance parameters
381  // reals
382  AdmsSensFadType & instancePar_Temp,
383  bool instancePar_given_Temp,
384  AdmsSensFadType & instancePar_L,
385  bool instancePar_given_L,
386  AdmsSensFadType & instancePar_W,
387  bool instancePar_given_W,
388  // non-reals(including hidden)
389  int instancePar_N,
390  bool instancePar_given_N,
391  // model parameters
392  // reals
393  AdmsSensFadType & modelPar_Temp,
394  bool modelPar_given_Temp,
395  AdmsSensFadType & modelPar_Rth,
396  bool modelPar_given_Rth,
397  AdmsSensFadType & modelPar_Cth,
398  bool modelPar_given_Cth,
399  AdmsSensFadType & modelPar_L,
400  bool modelPar_given_L,
401  AdmsSensFadType & modelPar_W,
402  bool modelPar_given_W,
403  AdmsSensFadType & modelPar_Jsf,
404  bool modelPar_given_Jsf,
405  AdmsSensFadType & modelPar_nf,
406  bool modelPar_given_nf,
407  AdmsSensFadType & modelPar_Vg,
408  bool modelPar_given_Vg,
409  AdmsSensFadType & modelPar_Jse,
410  bool modelPar_given_Jse,
411  AdmsSensFadType & modelPar_ne,
412  bool modelPar_given_ne,
413  AdmsSensFadType & modelPar_Rbxx,
414  bool modelPar_given_Rbxx,
415  AdmsSensFadType & modelPar_Vgb,
416  bool modelPar_given_Vgb,
417  AdmsSensFadType & modelPar_Jsee,
418  bool modelPar_given_Jsee,
419  AdmsSensFadType & modelPar_nee,
420  bool modelPar_given_nee,
421  AdmsSensFadType & modelPar_Rbbxx,
422  bool modelPar_given_Rbbxx,
423  AdmsSensFadType & modelPar_Vgbb,
424  bool modelPar_given_Vgbb,
425  AdmsSensFadType & modelPar_Jsr,
426  bool modelPar_given_Jsr,
427  AdmsSensFadType & modelPar_nr,
428  bool modelPar_given_nr,
429  AdmsSensFadType & modelPar_Vgr,
430  bool modelPar_given_Vgr,
431  AdmsSensFadType & modelPar_XCjc,
432  bool modelPar_given_XCjc,
433  AdmsSensFadType & modelPar_Jsc,
434  bool modelPar_given_Jsc,
435  AdmsSensFadType & modelPar_nc,
436  bool modelPar_given_nc,
437  AdmsSensFadType & modelPar_Rcxx,
438  bool modelPar_given_Rcxx,
439  AdmsSensFadType & modelPar_Vgc,
440  bool modelPar_given_Vgc,
441  AdmsSensFadType & modelPar_Bf,
442  bool modelPar_given_Bf,
443  AdmsSensFadType & modelPar_kBeta,
444  bool modelPar_given_kBeta,
445  AdmsSensFadType & modelPar_Br,
446  bool modelPar_given_Br,
447  AdmsSensFadType & modelPar_VAF,
448  bool modelPar_given_VAF,
449  AdmsSensFadType & modelPar_VAR,
450  bool modelPar_given_VAR,
451  AdmsSensFadType & modelPar_IKF,
452  bool modelPar_given_IKF,
453  AdmsSensFadType & modelPar_IKR,
454  bool modelPar_given_IKR,
455  AdmsSensFadType & modelPar_Mc,
456  bool modelPar_given_Mc,
457  AdmsSensFadType & modelPar_BVceo,
458  bool modelPar_given_BVceo,
459  AdmsSensFadType & modelPar_kc,
460  bool modelPar_given_kc,
461  AdmsSensFadType & modelPar_BVebo,
462  bool modelPar_given_BVebo,
463  AdmsSensFadType & modelPar_Tr,
464  bool modelPar_given_Tr,
465  AdmsSensFadType & modelPar_Trx,
466  bool modelPar_given_Trx,
467  AdmsSensFadType & modelPar_Tf,
468  bool modelPar_given_Tf,
469  AdmsSensFadType & modelPar_Tft,
470  bool modelPar_given_Tft,
471  AdmsSensFadType & modelPar_Thcs,
472  bool modelPar_given_Thcs,
473  AdmsSensFadType & modelPar_Ahc,
474  bool modelPar_given_Ahc,
475  AdmsSensFadType & modelPar_Cje,
476  bool modelPar_given_Cje,
477  AdmsSensFadType & modelPar_mje,
478  bool modelPar_given_mje,
479  AdmsSensFadType & modelPar_Vje,
480  bool modelPar_given_Vje,
481  AdmsSensFadType & modelPar_Cjc,
482  bool modelPar_given_Cjc,
483  AdmsSensFadType & modelPar_mjc,
484  bool modelPar_given_mjc,
485  AdmsSensFadType & modelPar_Vjc,
486  bool modelPar_given_Vjc,
487  AdmsSensFadType & modelPar_kjc,
488  bool modelPar_given_kjc,
489  AdmsSensFadType & modelPar_Cmin,
490  bool modelPar_given_Cmin,
491  AdmsSensFadType & modelPar_J0,
492  bool modelPar_given_J0,
493  AdmsSensFadType & modelPar_XJ0,
494  bool modelPar_given_XJ0,
495  AdmsSensFadType & modelPar_Rci0,
496  bool modelPar_given_Rci0,
497  AdmsSensFadType & modelPar_Jk,
498  bool modelPar_given_Jk,
499  AdmsSensFadType & modelPar_RJk,
500  bool modelPar_given_RJk,
501  AdmsSensFadType & modelPar_Vces,
502  bool modelPar_given_Vces,
503  AdmsSensFadType & modelPar_Rc,
504  bool modelPar_given_Rc,
505  AdmsSensFadType & modelPar_Re,
506  bool modelPar_given_Re,
507  AdmsSensFadType & modelPar_Rb,
508  bool modelPar_given_Rb,
509  AdmsSensFadType & modelPar_Rb2,
510  bool modelPar_given_Rb2,
511  AdmsSensFadType & modelPar_Lc,
512  bool modelPar_given_Lc,
513  AdmsSensFadType & modelPar_Le,
514  bool modelPar_given_Le,
515  AdmsSensFadType & modelPar_Lb,
516  bool modelPar_given_Lb,
517  AdmsSensFadType & modelPar_Cq,
518  bool modelPar_given_Cq,
519  AdmsSensFadType & modelPar_Cpb,
520  bool modelPar_given_Cpb,
521  AdmsSensFadType & modelPar_Cpc,
522  bool modelPar_given_Cpc,
523  AdmsSensFadType & modelPar_Tnom,
524  bool modelPar_given_Tnom,
525  // non-reals (including hidden)
526  int modelPar_Mode,
527  bool modelPar_given_Mode,
528  int modelPar_Noise,
529  bool modelPar_given_Noise,
530  int modelPar_Debug,
531  bool modelPar_given_Debug,
532  int modelPar_DebugPlus,
533  bool modelPar_given_DebugPlus,
534  int modelPar_N,
535  bool modelPar_given_N,
536  int modelPar_dtype,
537  double admsTemperature);
538 
540  // model parameters
541  // reals
542  AdmsSensFadType & modelPar_Temp,
543  bool modelPar_given_Temp,
544  AdmsSensFadType & modelPar_Rth,
545  bool modelPar_given_Rth,
546  AdmsSensFadType & modelPar_Cth,
547  bool modelPar_given_Cth,
548  AdmsSensFadType & modelPar_L,
549  bool modelPar_given_L,
550  AdmsSensFadType & modelPar_W,
551  bool modelPar_given_W,
552  AdmsSensFadType & modelPar_Jsf,
553  bool modelPar_given_Jsf,
554  AdmsSensFadType & modelPar_nf,
555  bool modelPar_given_nf,
556  AdmsSensFadType & modelPar_Vg,
557  bool modelPar_given_Vg,
558  AdmsSensFadType & modelPar_Jse,
559  bool modelPar_given_Jse,
560  AdmsSensFadType & modelPar_ne,
561  bool modelPar_given_ne,
562  AdmsSensFadType & modelPar_Rbxx,
563  bool modelPar_given_Rbxx,
564  AdmsSensFadType & modelPar_Vgb,
565  bool modelPar_given_Vgb,
566  AdmsSensFadType & modelPar_Jsee,
567  bool modelPar_given_Jsee,
568  AdmsSensFadType & modelPar_nee,
569  bool modelPar_given_nee,
570  AdmsSensFadType & modelPar_Rbbxx,
571  bool modelPar_given_Rbbxx,
572  AdmsSensFadType & modelPar_Vgbb,
573  bool modelPar_given_Vgbb,
574  AdmsSensFadType & modelPar_Jsr,
575  bool modelPar_given_Jsr,
576  AdmsSensFadType & modelPar_nr,
577  bool modelPar_given_nr,
578  AdmsSensFadType & modelPar_Vgr,
579  bool modelPar_given_Vgr,
580  AdmsSensFadType & modelPar_XCjc,
581  bool modelPar_given_XCjc,
582  AdmsSensFadType & modelPar_Jsc,
583  bool modelPar_given_Jsc,
584  AdmsSensFadType & modelPar_nc,
585  bool modelPar_given_nc,
586  AdmsSensFadType & modelPar_Rcxx,
587  bool modelPar_given_Rcxx,
588  AdmsSensFadType & modelPar_Vgc,
589  bool modelPar_given_Vgc,
590  AdmsSensFadType & modelPar_Bf,
591  bool modelPar_given_Bf,
592  AdmsSensFadType & modelPar_kBeta,
593  bool modelPar_given_kBeta,
594  AdmsSensFadType & modelPar_Br,
595  bool modelPar_given_Br,
596  AdmsSensFadType & modelPar_VAF,
597  bool modelPar_given_VAF,
598  AdmsSensFadType & modelPar_VAR,
599  bool modelPar_given_VAR,
600  AdmsSensFadType & modelPar_IKF,
601  bool modelPar_given_IKF,
602  AdmsSensFadType & modelPar_IKR,
603  bool modelPar_given_IKR,
604  AdmsSensFadType & modelPar_Mc,
605  bool modelPar_given_Mc,
606  AdmsSensFadType & modelPar_BVceo,
607  bool modelPar_given_BVceo,
608  AdmsSensFadType & modelPar_kc,
609  bool modelPar_given_kc,
610  AdmsSensFadType & modelPar_BVebo,
611  bool modelPar_given_BVebo,
612  AdmsSensFadType & modelPar_Tr,
613  bool modelPar_given_Tr,
614  AdmsSensFadType & modelPar_Trx,
615  bool modelPar_given_Trx,
616  AdmsSensFadType & modelPar_Tf,
617  bool modelPar_given_Tf,
618  AdmsSensFadType & modelPar_Tft,
619  bool modelPar_given_Tft,
620  AdmsSensFadType & modelPar_Thcs,
621  bool modelPar_given_Thcs,
622  AdmsSensFadType & modelPar_Ahc,
623  bool modelPar_given_Ahc,
624  AdmsSensFadType & modelPar_Cje,
625  bool modelPar_given_Cje,
626  AdmsSensFadType & modelPar_mje,
627  bool modelPar_given_mje,
628  AdmsSensFadType & modelPar_Vje,
629  bool modelPar_given_Vje,
630  AdmsSensFadType & modelPar_Cjc,
631  bool modelPar_given_Cjc,
632  AdmsSensFadType & modelPar_mjc,
633  bool modelPar_given_mjc,
634  AdmsSensFadType & modelPar_Vjc,
635  bool modelPar_given_Vjc,
636  AdmsSensFadType & modelPar_kjc,
637  bool modelPar_given_kjc,
638  AdmsSensFadType & modelPar_Cmin,
639  bool modelPar_given_Cmin,
640  AdmsSensFadType & modelPar_J0,
641  bool modelPar_given_J0,
642  AdmsSensFadType & modelPar_XJ0,
643  bool modelPar_given_XJ0,
644  AdmsSensFadType & modelPar_Rci0,
645  bool modelPar_given_Rci0,
646  AdmsSensFadType & modelPar_Jk,
647  bool modelPar_given_Jk,
648  AdmsSensFadType & modelPar_RJk,
649  bool modelPar_given_RJk,
650  AdmsSensFadType & modelPar_Vces,
651  bool modelPar_given_Vces,
652  AdmsSensFadType & modelPar_Rc,
653  bool modelPar_given_Rc,
654  AdmsSensFadType & modelPar_Re,
655  bool modelPar_given_Re,
656  AdmsSensFadType & modelPar_Rb,
657  bool modelPar_given_Rb,
658  AdmsSensFadType & modelPar_Rb2,
659  bool modelPar_given_Rb2,
660  AdmsSensFadType & modelPar_Lc,
661  bool modelPar_given_Lc,
662  AdmsSensFadType & modelPar_Le,
663  bool modelPar_given_Le,
664  AdmsSensFadType & modelPar_Lb,
665  bool modelPar_given_Lb,
666  AdmsSensFadType & modelPar_Cq,
667  bool modelPar_given_Cq,
668  AdmsSensFadType & modelPar_Cpb,
669  bool modelPar_given_Cpb,
670  AdmsSensFadType & modelPar_Cpc,
671  bool modelPar_given_Cpc,
672  AdmsSensFadType & modelPar_Tnom,
673  bool modelPar_given_Tnom,
674  // non-reals (including hidden)
675  int modelPar_Mode,
676  bool modelPar_given_Mode,
677  int modelPar_Noise,
678  bool modelPar_given_Noise,
679  int modelPar_Debug,
680  bool modelPar_given_Debug,
681  int modelPar_DebugPlus,
682  bool modelPar_given_DebugPlus,
683  int modelPar_N,
684  bool modelPar_given_N,
685  int modelPar_dtype,
686  double admsTemperature);
687 
688 
689 
690 // Limited exponential --- NOT what verilog LRM says, but what qucs,
691 // ng-spice, and zspice do.
692 
693 template <typename T>
694 T limexp(const T &x)
695 {
696  if ((x) < 80.0)
697  return (exp(x));
698  else
699  return (exp(80.0)*(x-79.0));
700 }
701 
702 // Maybe this will do as a substitute for a sacado-provided "floor" and "ceil"?
703 // It is wrong to try to propagate the Sacado derivatives to the return
704 // value, as the floor and ceil functions have zero derivative w.r.t. any
705 // of the variables in the argument, except when X is an integer at which
706 // point the derivative is undefined.
707 template <typename T>
708 double ADMSfloor(const T & x)
709 {
710  return (floor(x.val()));
711 }
712 
713 template <typename T>
714 double ADMSceil(const T & x)
715 {
716  return (ceil(x.val()));
717 }
718 
719 
720 struct Traits: public DeviceTraits<Model, Instance, BJT::Traits>
721 {
722  static const char *name() {return "FBH HBT_X v2.1";}
723  static const char *deviceTypeName() {return "q level 23";}
724 
725  static int numNodes() {return 4;}
726  static bool modelRequired() {return true;}
727  static bool isLinearDevice() {return false;}
728 
729  static Device *factory(const Configuration &configuration, const FactoryBlock &factory_block);
730  static void loadModelParameters(ParametricData<Model> &model_parameters);
731  static void loadInstanceParameters(ParametricData<Instance> &instance_parameters);
732 };
733 
734 //-----------------------------------------------------------------------------
735 // Class : Instance
736 
737 //
738 // Purpose : This class represents a single instance of the
739 // device. It mainly contains indices and pointers into
740 // the matrix equation (see the resistor instance class for
741 // more details).
742 //
743 // Special Notes :
744 // Creator :
745 // Creation Date :
746 //-----------------------------------------------------------------------------
747 class Instance : public DeviceInstance
748 {
749  friend class ParametricData<Instance>;
750  friend class Model;
751  friend class InstanceSensitivity;
752  friend class ModelSensitivity;
753  friend class Traits;
754 
755 public:
756  Instance(
757  const Configuration & configuration,
758  const InstanceBlock & instance_block,
759  Model & model,
760  const FactoryBlock & factory_block);
761 
762  ~Instance();
763 
764 private:
765  Instance(const Instance &);
766  Instance &operator=(const Instance &);
767 
768 public:
769  void registerLIDs( const LocalIdVector & intLIDVecRef,
770  const LocalIdVector & extLIDVecRef );
771  void registerStateLIDs( const LocalIdVector & staLIDVecRef );
772  void setupPointers();
773 
774  void loadNodeSymbols(Util::SymbolTable &symbol_table) const;
775 
776  const JacobianStamp & jacobianStamp() const;
777  void registerJacLIDs( const JacobianStamp & jacLIDVec );
778 
779  bool processParams();
780  bool updateTemperature ( const double & temp = -999.0 );
781  bool updateIntermediateVars ();
782  bool updatePrimaryState ();
783  bool updateSecondaryState ();
784 
785  // load functions, residual:
786  bool loadDAEQVector ();
787  bool loadDAEFVector ();
788 
789  // load functions, Jacobian:
790  bool loadDAEdQdx ();
791  bool loadDAEdFdx ();
792 
793 
794 private:
795 
796 public:
797  // iterator reference to the HBT_X model which owns this instance.
798  // Getters and setters
800  {
801  return model_;
802  }
803 
804 private:
805 
806  Model & model_; //< Owning Model
807  // Begin verilog Instance Variables
808  // Instance Parameters
809  double Temp;
810  int N;
811  double L;
812  double W;
813  // Variables of global_instance scope
814  // end verilog Instance Variables=====
815  // Nodal LID Variables
816  int li_c;
817  int li_b;
818  int li_e;
819  int li_t;
820  int li_ei;
821  int li_bi;
822  int li_bii;
823  int li_ci;
824  int li_ti;
825  int li_ex;
826  int li_exx;
827  int li_cx;
828  // end Nodal LID Variables
829  // Branch LID Variables
833  // end Branch LID Variables
834  // Jacobian pointers
961  // end of Jacobian and pointers
962  // node numbers
963  static const int admsNodeID_c = 0;
964  static const int admsNodeID_b = 1;
965  static const int admsNodeID_e = 2;
966  static const int admsNodeID_t = 3;
967  static const int admsNodeID_ei = 4;
968  static const int admsNodeID_bi = 5;
969  static const int admsNodeID_bii = 6;
970  static const int admsNodeID_ci = 7;
971  static const int admsNodeID_ti = 8;
972  static const int admsNodeID_ex = 9;
973  static const int admsNodeID_exx = 10;
974  static const int admsNodeID_cx = 11;
975  // end node numbers
976  // Additional IDs for branch equations
977  static const int admsBRA_ID_b_bi = 12;
978  static const int admsBRA_ID_e_ei = 13;
979  static const int admsBRA_ID_c_ci = 14;
980  // end branch numbers
981  // Probe numbers
982  static const int admsProbeID_V_t_ti = 0;
983  static const int admsProbeID_V_b_c = 1;
984  static const int admsProbeID_V_c_GND = 2;
985  static const int admsProbeID_V_b_GND = 3;
986  static const int admsProbeID_V_cx_bii = 4;
987  static const int admsProbeID_V_exx_bii = 5;
988  static const int admsProbeID_V_ex_bii = 6;
989  static const int admsProbeID_V_bii_bi = 7;
990  static const int admsProbeID_I_c_ci = 8;
991  static const int admsProbeID_I_e_ei = 9;
992  static const int admsProbeID_I_b_bi = 10;
993  static const int admsProbeID_V_ti_GND = 11;
994  static const int admsProbeID_V_ci_ei = 12;
995  static const int admsProbeID_V_exx_ei = 13;
996  static const int admsProbeID_V_cx_ci = 14;
997  static const int admsProbeID_V_ex_ei = 15;
998  static const int admsProbeID_V_bii_ei = 16;
999  static const int admsProbeID_V_bii_ci = 17;
1000  static const int admsProbeID_V_bi_ci = 18;
1001  // end probe numbers
1002  // State LIDs
1006  // end state LIDs
1007  // Arrays to hold probes
1008  std::vector < AdmsFadType > probeVars;
1009  // Arrays to hold contributions
1010  // dynamic contributions are differentiated w.r.t time
1011  std::vector < AdmsFadType > staticContributions;
1012  std::vector < AdmsFadType > dynamicContributions;
1013 
1014  // This array stores the differences between original and limited variables.
1015  std::vector<double> probeDiffs;
1016  // These store the Jdxp's for F and Q, respectively
1017  std::vector<double> Jdxp_static;
1018  std::vector<double> Jdxp_dynamic;
1019 
1020  // this is what we'll use when any model uses $temperature. We'll
1021  // set it in updateTemperature, and initialize it to whatever
1022  // is in devOptions when the instance is constructed.
1024 
1025  // vt at $temperature;
1026  double adms_vt_nom;
1027 
1028 
1029  // This one is for the annoying bogus "XyceADMSInstTemp" parameter
1030  // that we need so we can set it from the device manager when there's no
1031  // "TEMP" parameter to use
1033 
1034 
1035  static std::vector< std::vector<int> > jacStamp;
1036  static std::vector<int> jacMap;
1037  static std::vector< std::vector<int> > jacMap2;
1038 };
1039 
1040 
1041 
1042 namespace AnalogFunctions
1043 {
1044 
1045 // Analog Function exp_soft
1046 template<typename ScalarT> ScalarT exp_soft(ScalarT x)
1047 {
1048 
1049 
1050  ScalarT exp_soft;
1051  ScalarT maxexp;
1052  ScalarT maxarg;
1053  {
1054  maxexp = 1.0e25;
1055  maxarg = log(maxexp);
1056  if ((x<maxarg))
1057  {
1058  exp_soft = exp(x);
1059  }
1060  else
1061  {
1062  exp_soft = (((x+1.0)-maxarg)*maxexp);
1063  }
1064  }
1065  return(exp_soft);
1066 }
1067 
1068 
1069 // Analog Function Vt
1070 template<typename RetScalarT,typename Arg1ScalarT, typename Arg2ScalarT> RetScalarT Vt(Arg1ScalarT U, Arg2ScalarT Ud)
1071 {
1072 
1073 
1074  RetScalarT Vt;
1075  Arg2ScalarT Vch;
1076  Arg2ScalarT VF;
1077  RetScalarT exparg;
1078  {
1079  Vch = (0.1*Ud);
1080  VF = (0.9*Ud);
1081  if ((U<VF))
1082  {
1083  exparg=((U-VF)/Vch);
1084  Vt = (U-(Vch*log((1.0+exp(exparg)))));
1085  }
1086  else
1087  {
1088  exparg=((VF-U)/Vch);
1089  Vt = (VF-(Vch*log((1.0+exp(exparg)))));
1090  }
1091  }
1092  return(Vt);
1093 }
1094 
1095 
1096 // Analog Function diode/
1097 // something of an abuse, we assume arg2, 5, 7 are all of compatible types
1098 template<typename RetScalarT,typename Arg1ScalarT, typename Arg2ScalarT,typename Arg3ScalarT,typename Arg4ScalarT, typename Arg5ScalarT, typename Arg6ScalarT, typename Arg7ScalarT>
1099 RetScalarT diode(Arg1ScalarT U, Arg2ScalarT Is, Arg3ScalarT Ug, Arg4ScalarT N, Arg5ScalarT AREA, Arg6ScalarT TJ, Arg7ScalarT TNOM)
1100 {
1101 
1102 
1103  RetScalarT diode;
1104  RetScalarT exparg1;
1105  RetScalarT exparg2;
1106  RetScalarT VTH0;
1107  Arg6ScalarT VTHJ;
1108  Arg7ScalarT VTHNOM;
1109  double maxi;
1110  Arg3ScalarT Tmax;
1111  Arg6ScalarT TJM;
1112  Arg6ScalarT TJM_arg1;
1113  double KDURCHQ;
1114  RetScalarT lnIs;
1115  {
1116  VTH0 = adms_vt<RetScalarT>((20.0+273.15));
1117  VTHNOM = adms_vt<Arg7ScalarT>((TNOM+273.15));
1118  KDURCHQ = 0.861708692e-4;
1119  lnIs = log((Is*AREA));
1120  maxi = log(static_cast<double>(1e6));
1121  if (((maxi<(Ug/VTHNOM))&&(U<0.0)))
1122  {
1123  Tmax = (((Ug*VTHNOM)/((Ug-(maxi*VTHNOM))*KDURCHQ))-273.15);
1124  TJM = Vt<Arg6ScalarT>(TJ,Tmax);
1125  }
1126  else
1127  {
1128  TJM = TJ;
1129  }
1130  TJM_arg1=(TJM+273.15);
1131  VTHJ = adms_vt(TJM_arg1);
1132  if ((Ug>0.0))
1133  {
1134  exparg1=((((U/(N*VTHJ))+(Ug/VTHNOM))-(Ug/VTHJ))+lnIs);
1135  exparg2=(((Ug/VTHNOM)-(Ug/VTHJ))+lnIs);
1136  diode = (exp_soft(exparg1)-exp_soft(exparg2));
1137  }
1138  else
1139  {
1140  exparg1=((U/(N*VTH0))+lnIs);
1141  diode = (exp_soft(exparg1)-(Is*AREA));
1142  }
1143  }
1144  return(diode);
1145 }
1146 
1147 
1148 // Analog Function MM
1149 template<typename ScalarT> ScalarT MM(ScalarT VBCI, ScalarT VCBO, ScalarT MC, ScalarT VCBLIN, ScalarT BF, ScalarT KC)
1150 {
1151 
1152 
1153  ScalarT MM;
1154  ScalarT FBD;
1155  ScalarT vcbi;
1156  {
1157  if ((((KC>0.0)&&(MC>0.0))&&(VCBO>0.0)))
1158  {
1159  vcbi = VBCI;
1160  FBD = (VCBLIN/VCBO);
1161  if ((VBCI>0.0))
1162  {
1163  MM = 1.0;
1164  }
1165  else
1166  {
1167  if ((VBCI>(-VCBLIN)))
1168  {
1169  if ((MC==1))
1170  {
1171  MM = (1.0/(1.0-(vcbi/(-VCBO))));
1172  }
1173  else
1174  {
1175  MM = (1.0/(1.0-pow((vcbi/(-VCBO)),MC)));
1176  }
1177  }
1178  else
1179  {
1180  if ((VBCI<=(-VCBLIN)))
1181  {
1182  if ((MC==1))
1183  {
1184  MM = ((1.0/(1.0-FBD))-((((1.0/VCBO)*1.0)/pow((1.0-FBD),2.0))*(vcbi+(FBD*VCBO))));
1185  }
1186  else
1187  {
1188  MM = ((1.0/(1.0-pow(FBD,MC)))-((((MC/VCBO)*pow(FBD,(MC-1.0)))/pow((1.0-pow(FBD,MC)),2.0))*(vcbi+(FBD*VCBO))));
1189  }
1190  }
1191  }
1192  }
1193  }
1194  else
1195  {
1196  MM = 1.0;
1197  }
1198  }
1199  return(MM);
1200 }
1201 
1202 
1203 // Analog Function charge
1204 template< typename RetScalarT, typename Arg2ScalarT, typename Arg3ScalarT, typename Arg4ScalarT, typename Arg5ScalarT> RetScalarT charge(RetScalarT U, Arg2ScalarT C0, Arg3ScalarT Ud, Arg4ScalarT m, Arg5ScalarT Area)
1205 {
1206 
1207 
1208  RetScalarT charge;
1209  RetScalarT Vj;
1210  RetScalarT Vjo;
1211  RetScalarT VF;
1212  {
1213  Vj = Vt<RetScalarT>(U,Ud);
1214  Vjo = Vt<RetScalarT>(0.0,Ud);
1215  VF = (0.9*Ud);
1216  if ((m==1.0))
1217  {
1218  charge = ((Area*C0)*((Ud*(log((1.0-(Vjo/Ud)))-log((1.0-(Vj/Ud)))))+((1.0/(1.0-(VF/Ud)))*((U-Vj)+Vjo))));
1219  }
1220  else
1221  {
1222  charge = ((Area*C0)*((((Ud/(1.0-m))*(pow((1.0-(Vjo/Ud)),(1.0-m))-pow((1.0-(Vj/Ud)),(1.0-m))))+(pow((1.0-(VF/Ud)),(-m))*((U-Vj)+Vjo)))-(Ud*(1.0/(1.0-m)))));
1223  }
1224  }
1225  return(charge);
1226 }
1227 
1228 
1229 // Analog Function Vceff
1230 template<typename ScalarT> ScalarT Vceff(ScalarT U, ScalarT VCES)
1231 {
1232 
1233 
1234  ScalarT Vceff;
1235  ScalarT Vth0;
1236  {
1237  Vth0 = 0.025;
1238  if ((U<VCES))
1239  {
1240  Vceff = (Vth0+(Vth0*log((1.0+exp((((U-VCES)/Vth0)-1.0))))));
1241  }
1242  else
1243  {
1244  Vceff = ((U-VCES)+(Vth0*log((1.0+exp((1.0-((U-VCES)/Vth0)))))));
1245  }
1246  }
1247  return(Vceff);
1248 }
1249 
1250 
1251 // Analog Function ICK
1252 template<typename ScalarT> ScalarT ICK(ScalarT U, ScalarT RCI0, ScalarT VLIM, ScalarT InvVPT, ScalarT VCES)
1253 {
1254 
1255 
1256  ScalarT ICK;
1257  ScalarT VC;
1258  ScalarT x;
1259  {
1260  VC = Vceff(U,VCES);
1261  x = ((VC-VLIM)*InvVPT);
1262  ICK = (((VC/RCI0)*(1.0/sqrt((1.0+((VC/VLIM)*(VC/VLIM))))))*(1.0+((x+sqrt(((x*x)+0.001)))/2.0)));
1263  }
1264  return(ICK);
1265 }
1266 
1267 }
1268 
1269 
1270 //-----------------------------------------------------------------------------
1271 // Class : Model
1272 
1273 // Purpose :
1274 // Special Notes :
1275 // Creator :
1276 // Creation Date :
1277 //-----------------------------------------------------------------------------
1278 class Model : public DeviceModel
1279 {
1280  typedef std::vector<Instance *> InstanceVector;
1281 
1282  friend class ParametricData<Model>;
1283  friend class Instance;
1284  friend class InstanceSensitivity;
1285  friend class ModelSensitivity;
1286  friend class Traits;
1287 
1288 public:
1289  Model(
1290  const Configuration & configuration,
1291  const ModelBlock & model_block,
1292  const FactoryBlock & factory_block);
1293 
1294  ~Model();
1295 
1296 private:
1297  Model(const Model &);
1298  Model &operator=(const Model &);
1299 
1300 public:
1301  virtual void forEachInstance(DeviceInstanceOp &op) const /* override */;
1302  virtual std::ostream &printOutInstances(std::ostream &os) const;
1303  bool processParams();
1304  bool processInstanceParams();
1305 
1306 private:
1307 
1308 public:
1309  void addInstance(Instance *instance)
1310  {
1311  instanceContainer.push_back(instance);
1312  }
1313 
1314 private:
1315  std::vector<Instance*> instanceContainer;
1316 
1317 private:
1318 
1319  // This one is for the annoying bogus "XyceADMSInstTemp" parameter
1320  // that we need so we can set it from the device manager when there's no
1321  // "TEMP" model parameter to use
1322  double admsModTemp;
1323  // Begin verilog Model Variables
1324  // Model Parameters
1325  int Mode;
1326  int Noise;
1327  int Debug;
1329  double Temp;
1330  double Rth;
1331  double Cth;
1332  int N;
1333  double L;
1334  double W;
1335  double Jsf;
1336  double nf;
1337  double Vg;
1338  double Jse;
1339  double ne;
1340  double Rbxx;
1341  double Vgb;
1342  double Jsee;
1343  double nee;
1344  double Rbbxx;
1345  double Vgbb;
1346  double Jsr;
1347  double nr;
1348  double Vgr;
1349  double XCjc;
1350  double Jsc;
1351  double nc;
1352  double Rcxx;
1353  double Vgc;
1354  double Bf;
1355  double kBeta;
1356  double Br;
1357  double VAF;
1358  double VAR;
1359  double IKF;
1360  double IKR;
1361  double Mc;
1362  double BVceo;
1363  double kc;
1364  double BVebo;
1365  double Tr;
1366  double Trx;
1367  double Tf;
1368  double Tft;
1369  double Thcs;
1370  double Ahc;
1371  double Cje;
1372  double mje;
1373  double Vje;
1374  double Cjc;
1375  double mjc;
1376  double Vjc;
1377  double kjc;
1378  double Cmin;
1379  double J0;
1380  double XJ0;
1381  double Rci0;
1382  double Jk;
1383  double RJk;
1384  double Vces;
1385  double Rc;
1386  double Re;
1387  double Rb;
1388  double Rb2;
1389  double Lc;
1390  double Le;
1391  double Lb;
1392  double Cq;
1393  double Cpb;
1394  double Cpc;
1395  double Tnom;
1396  int dtype;
1397  // Variables of global_model scope
1398  // end verilog model variables=====
1399 };
1400 
1401 void registerDevice();
1402 
1403 } // namespace ADMSHBT_X
1404 } // namespace Device
1405 } // namespace Xyce
1406 #endif //Xyce_N_DEV_ADMSHBT_X_h
std::vector< AdmsFadType > probeVars
virtual void operator()(const ParameterBase &entity, const std::string &param, std::vector< double > &dfdp, std::vector< double > &dqdp, std::vector< double > &dbdp, std::vector< int > &Findices, std::vector< int > &Qindices, std::vector< int > &Bindices) const
Compute sensitivity of a device instance's outputs to a specified instance parameter.
void registerLIDs(const LocalIdVector &intLIDVecRef, const LocalIdVector &extLIDVecRef)
Pure virtual class to augment a linear system.
std::vector< AdmsFadType > dynamicContributions
#define MC
virtual void forEachInstance(DeviceInstanceOp &op) const
Apply a device instance "op" to all instances associated with this model.
Model & operator=(const Model &)
Base class for all parameters.
Definition: N_DEV_Pars.h:169
void addInstance(Instance *instance)
RetScalarT Vt(Arg1ScalarT U, Arg2ScalarT Ud)
static std::vector< std::vector< int > > jacStamp
double ADMSceil(const T &x)
std::vector< AdmsFadType > staticContributions
RetScalarT charge(RetScalarT U, Arg2ScalarT C0, Arg3ScalarT Ud, Arg4ScalarT m, Arg5ScalarT Area)
RetScalarT diode(Arg1ScalarT U, Arg2ScalarT Is, Arg3ScalarT Ug, Arg4ScalarT N, Arg5ScalarT AREA, Arg6ScalarT TJ, Arg7ScalarT TNOM)
bool updateTemperature(const double &temp=-999.0)
static InstanceSensitivity instSens
void registerJacLIDs(const JacobianStamp &jacLIDVec)
Sacado::Fad::SFad< double, 1 > AdmsSensFadType
void evaluateModelEquations(std::vector< double > &probeVars, const int admsProbeID_V_t_ti, const int admsProbeID_V_b_c, const int admsProbeID_V_c_GND, const int admsProbeID_V_b_GND, const int admsProbeID_V_cx_bii, const int admsProbeID_V_exx_bii, const int admsProbeID_V_ex_bii, const int admsProbeID_V_bii_bi, const int admsProbeID_I_c_ci, const int admsProbeID_I_e_ei, const int admsProbeID_I_b_bi, const int admsProbeID_V_ti_GND, const int admsProbeID_V_ci_ei, const int admsProbeID_V_exx_ei, const int admsProbeID_V_cx_ci, const int admsProbeID_V_ex_ei, const int admsProbeID_V_bii_ei, const int admsProbeID_V_bii_ci, const int admsProbeID_V_bi_ci, const int admsNodeID_c, const int admsNodeID_b, const int admsNodeID_e, const int admsNodeID_t, const int admsNodeID_ei, const int admsNodeID_bi, const int admsNodeID_bii, const int admsNodeID_ci, const int admsNodeID_ti, const int admsNodeID_ex, const int admsNodeID_exx, const int admsNodeID_cx, const int admsBRA_ID_b_bi, const int admsBRA_ID_e_ei, const int admsBRA_ID_c_ci, AdmsSensFadType &instancePar_Temp, bool instancePar_given_Temp, AdmsSensFadType &instancePar_L, bool instancePar_given_L, AdmsSensFadType &instancePar_W, bool instancePar_given_W, int instancePar_N, bool instancePar_given_N, AdmsSensFadType &modelPar_Temp, bool modelPar_given_Temp, AdmsSensFadType &modelPar_Rth, bool modelPar_given_Rth, AdmsSensFadType &modelPar_Cth, bool modelPar_given_Cth, AdmsSensFadType &modelPar_L, bool modelPar_given_L, AdmsSensFadType &modelPar_W, bool modelPar_given_W, AdmsSensFadType &modelPar_Jsf, bool modelPar_given_Jsf, AdmsSensFadType &modelPar_nf, bool modelPar_given_nf, AdmsSensFadType &modelPar_Vg, bool modelPar_given_Vg, AdmsSensFadType &modelPar_Jse, bool modelPar_given_Jse, AdmsSensFadType &modelPar_ne, bool modelPar_given_ne, AdmsSensFadType &modelPar_Rbxx, bool modelPar_given_Rbxx, AdmsSensFadType &modelPar_Vgb, bool modelPar_given_Vgb, AdmsSensFadType &modelPar_Jsee, bool modelPar_given_Jsee, AdmsSensFadType &modelPar_nee, bool modelPar_given_nee, AdmsSensFadType &modelPar_Rbbxx, bool modelPar_given_Rbbxx, AdmsSensFadType &modelPar_Vgbb, bool modelPar_given_Vgbb, AdmsSensFadType &modelPar_Jsr, bool modelPar_given_Jsr, AdmsSensFadType &modelPar_nr, bool modelPar_given_nr, AdmsSensFadType &modelPar_Vgr, bool modelPar_given_Vgr, AdmsSensFadType &modelPar_XCjc, bool modelPar_given_XCjc, AdmsSensFadType &modelPar_Jsc, bool modelPar_given_Jsc, AdmsSensFadType &modelPar_nc, bool modelPar_given_nc, AdmsSensFadType &modelPar_Rcxx, bool modelPar_given_Rcxx, AdmsSensFadType &modelPar_Vgc, bool modelPar_given_Vgc, AdmsSensFadType &modelPar_Bf, bool modelPar_given_Bf, AdmsSensFadType &modelPar_kBeta, bool modelPar_given_kBeta, AdmsSensFadType &modelPar_Br, bool modelPar_given_Br, AdmsSensFadType &modelPar_VAF, bool modelPar_given_VAF, AdmsSensFadType &modelPar_VAR, bool modelPar_given_VAR, AdmsSensFadType &modelPar_IKF, bool modelPar_given_IKF, AdmsSensFadType &modelPar_IKR, bool modelPar_given_IKR, AdmsSensFadType &modelPar_Mc, bool modelPar_given_Mc, AdmsSensFadType &modelPar_BVceo, bool modelPar_given_BVceo, AdmsSensFadType &modelPar_kc, bool modelPar_given_kc, AdmsSensFadType &modelPar_BVebo, bool modelPar_given_BVebo, AdmsSensFadType &modelPar_Tr, bool modelPar_given_Tr, AdmsSensFadType &modelPar_Trx, bool modelPar_given_Trx, AdmsSensFadType &modelPar_Tf, bool modelPar_given_Tf, AdmsSensFadType &modelPar_Tft, bool modelPar_given_Tft, AdmsSensFadType &modelPar_Thcs, bool modelPar_given_Thcs, AdmsSensFadType &modelPar_Ahc, bool modelPar_given_Ahc, AdmsSensFadType &modelPar_Cje, bool modelPar_given_Cje, AdmsSensFadType &modelPar_mje, bool modelPar_given_mje, AdmsSensFadType &modelPar_Vje, bool modelPar_given_Vje, AdmsSensFadType &modelPar_Cjc, bool modelPar_given_Cjc, AdmsSensFadType &modelPar_mjc, bool modelPar_given_mjc, AdmsSensFadType &modelPar_Vjc, bool modelPar_given_Vjc, AdmsSensFadType &modelPar_kjc, bool modelPar_given_kjc, AdmsSensFadType &modelPar_Cmin, bool modelPar_given_Cmin, AdmsSensFadType &modelPar_J0, bool modelPar_given_J0, AdmsSensFadType &modelPar_XJ0, bool modelPar_given_XJ0, AdmsSensFadType &modelPar_Rci0, bool modelPar_given_Rci0, AdmsSensFadType &modelPar_Jk, bool modelPar_given_Jk, AdmsSensFadType &modelPar_RJk, bool modelPar_given_RJk, AdmsSensFadType &modelPar_Vces, bool modelPar_given_Vces, AdmsSensFadType &modelPar_Rc, bool modelPar_given_Rc, AdmsSensFadType &modelPar_Re, bool modelPar_given_Re, AdmsSensFadType &modelPar_Rb, bool modelPar_given_Rb, AdmsSensFadType &modelPar_Rb2, bool modelPar_given_Rb2, AdmsSensFadType &modelPar_Lc, bool modelPar_given_Lc, AdmsSensFadType &modelPar_Le, bool modelPar_given_Le, AdmsSensFadType &modelPar_Lb, bool modelPar_given_Lb, AdmsSensFadType &modelPar_Cq, bool modelPar_given_Cq, AdmsSensFadType &modelPar_Cpb, bool modelPar_given_Cpb, AdmsSensFadType &modelPar_Cpc, bool modelPar_given_Cpc, AdmsSensFadType &modelPar_Tnom, bool modelPar_given_Tnom, int modelPar_Mode, bool modelPar_given_Mode, int modelPar_Noise, bool modelPar_given_Noise, int modelPar_Debug, bool modelPar_given_Debug, int modelPar_DebugPlus, bool modelPar_given_DebugPlus, int modelPar_N, bool modelPar_given_N, int modelPar_dtype, double admsTemperature, double adms_vt_nom, double gmin, std::vector< AdmsSensFadType > &staticContributions, std::vector< AdmsSensFadType > &dynamicContributions, const Instance &theInstance)
virtual void operator()(const ParameterBase &entity, const std::string &param, std::vector< double > &dfdp, std::vector< double > &dqdp, std::vector< double > &dbdp, std::vector< int > &Findices, std::vector< int > &Qindices, std::vector< int > &Bindices) const
Compute sensitivity to a specified model parameter of all device instances of that model's outputs...
The FactoryBlock contains parameters needed by the device, instance and model creation functions...
void loadNodeSymbols(Util::SymbolTable &symbol_table) const
Populates and returns the store name map.
std::vector< std::vector< int > > JacobianStamp
Definition: N_DEV_fwd.h:185
static std::vector< std::vector< int > > jacMap2
std::vector< Instance * > instanceContainer
static ModelSensitivity modSens
bool processParams()
processParams
bool processInstanceParams()
processInstanceParams
virtual std::ostream & printOutInstances(std::ostream &os) const
ScalarT Vceff(ScalarT U, ScalarT VCES)
Sacado::Fad::SFad< double, 19 > AdmsFadType
static const char * deviceTypeName()
The Device class is an interface for device implementations.
Definition: N_DEV_Device.h:101
IdVector LocalIdVector
Definition: N_DEV_fwd.h:187
ScalarT MM(ScalarT VBCI, ScalarT VCBO, ScalarT MC, ScalarT VCBLIN, ScalarT BF, ScalarT KC)
ScalarT ICK(ScalarT U, ScalarT RCI0, ScalarT VLIM, ScalarT InvVPT, ScalarT VCES)
void evaluateInitialModel(AdmsSensFadType &modelPar_Temp, bool modelPar_given_Temp, AdmsSensFadType &modelPar_Rth, bool modelPar_given_Rth, AdmsSensFadType &modelPar_Cth, bool modelPar_given_Cth, AdmsSensFadType &modelPar_L, bool modelPar_given_L, AdmsSensFadType &modelPar_W, bool modelPar_given_W, AdmsSensFadType &modelPar_Jsf, bool modelPar_given_Jsf, AdmsSensFadType &modelPar_nf, bool modelPar_given_nf, AdmsSensFadType &modelPar_Vg, bool modelPar_given_Vg, AdmsSensFadType &modelPar_Jse, bool modelPar_given_Jse, AdmsSensFadType &modelPar_ne, bool modelPar_given_ne, AdmsSensFadType &modelPar_Rbxx, bool modelPar_given_Rbxx, AdmsSensFadType &modelPar_Vgb, bool modelPar_given_Vgb, AdmsSensFadType &modelPar_Jsee, bool modelPar_given_Jsee, AdmsSensFadType &modelPar_nee, bool modelPar_given_nee, AdmsSensFadType &modelPar_Rbbxx, bool modelPar_given_Rbbxx, AdmsSensFadType &modelPar_Vgbb, bool modelPar_given_Vgbb, AdmsSensFadType &modelPar_Jsr, bool modelPar_given_Jsr, AdmsSensFadType &modelPar_nr, bool modelPar_given_nr, AdmsSensFadType &modelPar_Vgr, bool modelPar_given_Vgr, AdmsSensFadType &modelPar_XCjc, bool modelPar_given_XCjc, AdmsSensFadType &modelPar_Jsc, bool modelPar_given_Jsc, AdmsSensFadType &modelPar_nc, bool modelPar_given_nc, AdmsSensFadType &modelPar_Rcxx, bool modelPar_given_Rcxx, AdmsSensFadType &modelPar_Vgc, bool modelPar_given_Vgc, AdmsSensFadType &modelPar_Bf, bool modelPar_given_Bf, AdmsSensFadType &modelPar_kBeta, bool modelPar_given_kBeta, AdmsSensFadType &modelPar_Br, bool modelPar_given_Br, AdmsSensFadType &modelPar_VAF, bool modelPar_given_VAF, AdmsSensFadType &modelPar_VAR, bool modelPar_given_VAR, AdmsSensFadType &modelPar_IKF, bool modelPar_given_IKF, AdmsSensFadType &modelPar_IKR, bool modelPar_given_IKR, AdmsSensFadType &modelPar_Mc, bool modelPar_given_Mc, AdmsSensFadType &modelPar_BVceo, bool modelPar_given_BVceo, AdmsSensFadType &modelPar_kc, bool modelPar_given_kc, AdmsSensFadType &modelPar_BVebo, bool modelPar_given_BVebo, AdmsSensFadType &modelPar_Tr, bool modelPar_given_Tr, AdmsSensFadType &modelPar_Trx, bool modelPar_given_Trx, AdmsSensFadType &modelPar_Tf, bool modelPar_given_Tf, AdmsSensFadType &modelPar_Tft, bool modelPar_given_Tft, AdmsSensFadType &modelPar_Thcs, bool modelPar_given_Thcs, AdmsSensFadType &modelPar_Ahc, bool modelPar_given_Ahc, AdmsSensFadType &modelPar_Cje, bool modelPar_given_Cje, AdmsSensFadType &modelPar_mje, bool modelPar_given_mje, AdmsSensFadType &modelPar_Vje, bool modelPar_given_Vje, AdmsSensFadType &modelPar_Cjc, bool modelPar_given_Cjc, AdmsSensFadType &modelPar_mjc, bool modelPar_given_mjc, AdmsSensFadType &modelPar_Vjc, bool modelPar_given_Vjc, AdmsSensFadType &modelPar_kjc, bool modelPar_given_kjc, AdmsSensFadType &modelPar_Cmin, bool modelPar_given_Cmin, AdmsSensFadType &modelPar_J0, bool modelPar_given_J0, AdmsSensFadType &modelPar_XJ0, bool modelPar_given_XJ0, AdmsSensFadType &modelPar_Rci0, bool modelPar_given_Rci0, AdmsSensFadType &modelPar_Jk, bool modelPar_given_Jk, AdmsSensFadType &modelPar_RJk, bool modelPar_given_RJk, AdmsSensFadType &modelPar_Vces, bool modelPar_given_Vces, AdmsSensFadType &modelPar_Rc, bool modelPar_given_Rc, AdmsSensFadType &modelPar_Re, bool modelPar_given_Re, AdmsSensFadType &modelPar_Rb, bool modelPar_given_Rb, AdmsSensFadType &modelPar_Rb2, bool modelPar_given_Rb2, AdmsSensFadType &modelPar_Lc, bool modelPar_given_Lc, AdmsSensFadType &modelPar_Le, bool modelPar_given_Le, AdmsSensFadType &modelPar_Lb, bool modelPar_given_Lb, AdmsSensFadType &modelPar_Cq, bool modelPar_given_Cq, AdmsSensFadType &modelPar_Cpb, bool modelPar_given_Cpb, AdmsSensFadType &modelPar_Cpc, bool modelPar_given_Cpc, AdmsSensFadType &modelPar_Tnom, bool modelPar_given_Tnom, int modelPar_Mode, bool modelPar_given_Mode, int modelPar_Noise, bool modelPar_given_Noise, int modelPar_Debug, bool modelPar_given_Debug, int modelPar_DebugPlus, bool modelPar_given_DebugPlus, int modelPar_N, bool modelPar_given_N, int modelPar_dtype, double admsTemperature)
static void loadInstanceParameters(ParametricData< Instance > &instance_parameters)
Class Configuration contains device configuration data.
static Tin adms_ternary_op(const bool cond, const Tin &ifTrue, const Tin &ifFalse)
const JacobianStamp & jacobianStamp() const
static Device * factory(const Configuration &configuration, const FactoryBlock &factory_block)
Model(const Configuration &configuration, const ModelBlock &model_block, const FactoryBlock &factory_block)
std::vector< double > Jdxp_dynamic
static void loadModelParameters(ParametricData< Model > &model_parameters)
double ADMSfloor(const T &x)
static T adms_vt(const T temp)
#define CONSTKoverQ
Definition: N_DEV_Const.h:58
Instance & operator=(const Instance &)
Base sensitivity functor.
Definition: N_DEV_Pars.h:148
std::vector< Instance * > InstanceVector
ModelBlock represents a .MODEL line from the netlist.
The DeviceTraits template describes the configuration of a device.
static std::vector< int > jacMap
Manages parameter binding for class C.
Definition: N_DEV_Pars.h:214
InstanceBlock represent a device instance line from the netlist.
Instance(const Configuration &configuration, const InstanceBlock &instance_block, Model &model, const FactoryBlock &factory_block)
void registerStateLIDs(const LocalIdVector &staLIDVecRef)
void evaluateInitialInstance(AdmsSensFadType &instancePar_Temp, bool instancePar_given_Temp, AdmsSensFadType &instancePar_L, bool instancePar_given_L, AdmsSensFadType &instancePar_W, bool instancePar_given_W, int instancePar_N, bool instancePar_given_N, AdmsSensFadType &modelPar_Temp, bool modelPar_given_Temp, AdmsSensFadType &modelPar_Rth, bool modelPar_given_Rth, AdmsSensFadType &modelPar_Cth, bool modelPar_given_Cth, AdmsSensFadType &modelPar_L, bool modelPar_given_L, AdmsSensFadType &modelPar_W, bool modelPar_given_W, AdmsSensFadType &modelPar_Jsf, bool modelPar_given_Jsf, AdmsSensFadType &modelPar_nf, bool modelPar_given_nf, AdmsSensFadType &modelPar_Vg, bool modelPar_given_Vg, AdmsSensFadType &modelPar_Jse, bool modelPar_given_Jse, AdmsSensFadType &modelPar_ne, bool modelPar_given_ne, AdmsSensFadType &modelPar_Rbxx, bool modelPar_given_Rbxx, AdmsSensFadType &modelPar_Vgb, bool modelPar_given_Vgb, AdmsSensFadType &modelPar_Jsee, bool modelPar_given_Jsee, AdmsSensFadType &modelPar_nee, bool modelPar_given_nee, AdmsSensFadType &modelPar_Rbbxx, bool modelPar_given_Rbbxx, AdmsSensFadType &modelPar_Vgbb, bool modelPar_given_Vgbb, AdmsSensFadType &modelPar_Jsr, bool modelPar_given_Jsr, AdmsSensFadType &modelPar_nr, bool modelPar_given_nr, AdmsSensFadType &modelPar_Vgr, bool modelPar_given_Vgr, AdmsSensFadType &modelPar_XCjc, bool modelPar_given_XCjc, AdmsSensFadType &modelPar_Jsc, bool modelPar_given_Jsc, AdmsSensFadType &modelPar_nc, bool modelPar_given_nc, AdmsSensFadType &modelPar_Rcxx, bool modelPar_given_Rcxx, AdmsSensFadType &modelPar_Vgc, bool modelPar_given_Vgc, AdmsSensFadType &modelPar_Bf, bool modelPar_given_Bf, AdmsSensFadType &modelPar_kBeta, bool modelPar_given_kBeta, AdmsSensFadType &modelPar_Br, bool modelPar_given_Br, AdmsSensFadType &modelPar_VAF, bool modelPar_given_VAF, AdmsSensFadType &modelPar_VAR, bool modelPar_given_VAR, AdmsSensFadType &modelPar_IKF, bool modelPar_given_IKF, AdmsSensFadType &modelPar_IKR, bool modelPar_given_IKR, AdmsSensFadType &modelPar_Mc, bool modelPar_given_Mc, AdmsSensFadType &modelPar_BVceo, bool modelPar_given_BVceo, AdmsSensFadType &modelPar_kc, bool modelPar_given_kc, AdmsSensFadType &modelPar_BVebo, bool modelPar_given_BVebo, AdmsSensFadType &modelPar_Tr, bool modelPar_given_Tr, AdmsSensFadType &modelPar_Trx, bool modelPar_given_Trx, AdmsSensFadType &modelPar_Tf, bool modelPar_given_Tf, AdmsSensFadType &modelPar_Tft, bool modelPar_given_Tft, AdmsSensFadType &modelPar_Thcs, bool modelPar_given_Thcs, AdmsSensFadType &modelPar_Ahc, bool modelPar_given_Ahc, AdmsSensFadType &modelPar_Cje, bool modelPar_given_Cje, AdmsSensFadType &modelPar_mje, bool modelPar_given_mje, AdmsSensFadType &modelPar_Vje, bool modelPar_given_Vje, AdmsSensFadType &modelPar_Cjc, bool modelPar_given_Cjc, AdmsSensFadType &modelPar_mjc, bool modelPar_given_mjc, AdmsSensFadType &modelPar_Vjc, bool modelPar_given_Vjc, AdmsSensFadType &modelPar_kjc, bool modelPar_given_kjc, AdmsSensFadType &modelPar_Cmin, bool modelPar_given_Cmin, AdmsSensFadType &modelPar_J0, bool modelPar_given_J0, AdmsSensFadType &modelPar_XJ0, bool modelPar_given_XJ0, AdmsSensFadType &modelPar_Rci0, bool modelPar_given_Rci0, AdmsSensFadType &modelPar_Jk, bool modelPar_given_Jk, AdmsSensFadType &modelPar_RJk, bool modelPar_given_RJk, AdmsSensFadType &modelPar_Vces, bool modelPar_given_Vces, AdmsSensFadType &modelPar_Rc, bool modelPar_given_Rc, AdmsSensFadType &modelPar_Re, bool modelPar_given_Re, AdmsSensFadType &modelPar_Rb, bool modelPar_given_Rb, AdmsSensFadType &modelPar_Rb2, bool modelPar_given_Rb2, AdmsSensFadType &modelPar_Lc, bool modelPar_given_Lc, AdmsSensFadType &modelPar_Le, bool modelPar_given_Le, AdmsSensFadType &modelPar_Lb, bool modelPar_given_Lb, AdmsSensFadType &modelPar_Cq, bool modelPar_given_Cq, AdmsSensFadType &modelPar_Cpb, bool modelPar_given_Cpb, AdmsSensFadType &modelPar_Cpc, bool modelPar_given_Cpc, AdmsSensFadType &modelPar_Tnom, bool modelPar_given_Tnom, int modelPar_Mode, bool modelPar_given_Mode, int modelPar_Noise, bool modelPar_given_Noise, int modelPar_Debug, bool modelPar_given_Debug, int modelPar_DebugPlus, bool modelPar_given_DebugPlus, int modelPar_N, bool modelPar_given_N, int modelPar_dtype, double admsTemperature)