My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dmux4to16.core.cpp
Go to the documentation of this file.
1 /*
2  * dmux4to16.core.cpp - device implementations for dmux4to16 module
3  *
4  * This is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2, or (at your option)
7  * any later version.
8  *
9  */
10 
11 #if HAVE_CONFIG_H
12 #include <config.h>
13 #endif
14 
16 #include "component.h"
17 #include "device.h"
18 #include "dmux4to16.core.h"
19 
20 #ifndef CIR_dmux4to16
21 #define CIR_dmux4to16 -1
22 #endif
23 
24 // external nodes
25 #define EN 0
26 #define A 1
27 #define B 2
28 #define C 3
29 #define D 4
30 #define Y15 5
31 #define Y14 6
32 #define Y13 7
33 #define Y12 8
34 #define Y11 9
35 #define Y10 10
36 #define Y9 11
37 #define Y8 12
38 #define Y7 13
39 #define Y6 14
40 #define Y5 15
41 #define Y4 16
42 #define Y3 17
43 #define Y2 18
44 #define Y1 19
45 #define Y0 20
46 // internal nodes
47 #define Y0n1 21
48 #define Y0n2 22
49 #define Y1n1 23
50 #define Y1n2 24
51 #define Y2n1 25
52 #define Y2n2 26
53 #define Y3n1 27
54 #define Y3n2 28
55 #define Y4n1 29
56 #define Y4n2 30
57 #define Y5n1 31
58 #define Y5n2 32
59 #define Y6n1 33
60 #define Y6n2 34
61 #define Y7n1 35
62 #define Y7n2 36
63 #define Y8n1 37
64 #define Y8n2 38
65 #define Y9n1 39
66 #define Y9n2 40
67 #define Y10n1 41
68 #define Y10n2 42
69 #define Y11n1 43
70 #define Y11n2 44
71 #define Y12n1 45
72 #define Y12n2 46
73 #define Y13n1 47
74 #define Y13n2 48
75 #define Y14n1 49
76 #define Y14n2 50
77 #define Y15n1 51
78 #define Y15n2 52
79 
80 // useful macro definitions
81 #define NP(node) real (getV (node))
82 #define BP(pnode,nnode) (NP(pnode) - NP(nnode))
83 #define _load_static_residual2(pnode,nnode,current)\
84  _rhs[pnode] -= current;\
85  _rhs[nnode] += current;
86 #define _load_static_augmented_residual2(pnode,nnode,current)\
87  _rhs[pnode] -= current;\
88  _rhs[nnode] += current;
89 #define _load_static_residual1(node,current)\
90  _rhs[node] -= current;
91 #define _load_static_augmented_residual1(node,current)\
92  _rhs[node] -= current;
93 #define _load_static_jacobian4(pnode,nnode,vpnode,vnnode,conductance)\
94  _jstat[pnode][vpnode] += conductance;\
95  _jstat[nnode][vnnode] += conductance;\
96  _jstat[pnode][vnnode] -= conductance;\
97  _jstat[nnode][vpnode] -= conductance;\
98  if (doHB) {\
99  _ghs[pnode] += conductance * BP(vpnode,vnnode);\
100  _ghs[nnode] -= conductance * BP(vpnode,vnnode);\
101  } else {\
102  _rhs[pnode] += conductance * BP(vpnode,vnnode);\
103  _rhs[nnode] -= conductance * BP(vpnode,vnnode);\
104  }
105 #define _load_static_jacobian2p(node,vpnode,vnnode,conductance)\
106  _jstat[node][vpnode] += conductance;\
107  _jstat[node][vnnode] -= conductance;\
108  if (doHB) {\
109  _ghs[node] += conductance * BP(vpnode,vnnode);\
110  } else {\
111  _rhs[node] += conductance * BP(vpnode,vnnode);\
112  }
113 #define _load_static_jacobian2s(pnode,nnode,node,conductance)\
114  _jstat[pnode][node] += conductance;\
115  _jstat[nnode][node] -= conductance;\
116  if (doHB) {\
117  _ghs[pnode] += conductance * NP(node);\
118  _ghs[nnode] -= conductance * NP(node);\
119  } else {\
120  _rhs[pnode] += conductance * NP(node);\
121  _rhs[nnode] -= conductance * NP(node);\
122  }
123 #define _load_static_jacobian1(node,vnode,conductance)\
124  _jstat[node][vnode] += conductance;\
125  if (doHB) {\
126  _ghs[node] += conductance * NP(vnode);\
127  } else {\
128  _rhs[node] += conductance * NP(vnode);\
129  }
130 #define _load_dynamic_residual2(pnode,nnode,charge)\
131  if (doTR) _charges[pnode][nnode] += charge;\
132  if (doHB) {\
133  _qhs[pnode] -= charge;\
134  _qhs[nnode] += charge;\
135  }
136 #define _load_dynamic_residual1(node,charge)\
137  if (doTR) _charges[node][node] += charge;\
138  if (doHB) {\
139  _qhs[node] -= charge;\
140  }
141 #define _load_dynamic_jacobian4(pnode,nnode,vpnode,vnnode,capacitance)\
142  if (doAC) {\
143  _jdyna[pnode][vpnode] += capacitance;\
144  _jdyna[nnode][vnnode] += capacitance;\
145  _jdyna[pnode][vnnode] -= capacitance;\
146  _jdyna[nnode][vpnode] -= capacitance;\
147  }\
148  if (doTR) {\
149  _caps[pnode][nnode][vpnode][vnnode] += capacitance;\
150  }\
151  if (doHB) {\
152  _chs[pnode] += capacitance * BP(vpnode,vnnode);\
153  _chs[nnode] -= capacitance * BP(vpnode,vnnode);\
154  }
155 #define _load_dynamic_jacobian2s(pnode,nnode,vnode,capacitance)\
156  if (doAC) {\
157  _jdyna[pnode][vnode] += capacitance;\
158  _jdyna[nnode][vnode] -= capacitance;\
159  }\
160  if (doTR) {\
161  _caps[pnode][nnode][vnode][vnode] += capacitance;\
162  }\
163  if (doHB) {\
164  _chs[pnode] += capacitance * NP(vnode);\
165  _chs[nnode] -= capacitance * NP(vnode);\
166  }
167 #define _load_dynamic_jacobian2p(node,vpnode,vnnode,capacitance)\
168  if (doAC) {\
169  _jdyna[node][vpnode] += capacitance;\
170  _jdyna[node][vnnode] -= capacitance;\
171  }\
172  if (doTR) {\
173  _caps[node][node][vpnode][vnnode] += capacitance;\
174  }\
175  if (doHB) {\
176  _chs[node] += capacitance * BP(vpnode,vnnode);\
177  }
178 #define _load_dynamic_jacobian1(node,vnode,capacitance)\
179  if (doAC) {\
180  _jdyna[node][vnode] += capacitance;\
181  }\
182  if (doTR) {\
183  _caps[node][node][vnode][vnode] += capacitance;\
184  }\
185  if (doHB) {\
186  _chs[node] += capacitance * NP(vnode);\
187  }
188 
189 #define _save_whitenoise1(n1,pwr,type)\
190  _white_pwr[n1][n1] += pwr;
191 #define _save_whitenoise2(n1,n2,pwr,type)\
192  _white_pwr[n1][n2] += pwr;
193 #define _save_flickernoise1(n1,pwr,exp,type)\
194  _flicker_pwr[n1][n1] += pwr;\
195  _flicker_exp[n1][n1] += exp;
196 #define _save_flickernoise2(n1,n2,pwr,exp,type)\
197  _flicker_pwr[n1][n2] += pwr;\
198  _flicker_exp[n1][n2] += exp;
199 #define _load_whitenoise2(n1,n2,pwr)\
200  cy (n1,n2) -= pwr/kB/T0; cy (n2,n1) -= pwr/kB/T0;\
201  cy (n1,n1) += pwr/kB/T0; cy (n2,n2) += pwr/kB/T0;
202 #define _load_whitenoise1(n1,pwr)\
203  cy (n1,n1) += pwr/kB/T0;
204 #define _load_flickernoise2(n1,n2,pwr,exp)\
205  cy (n1,n2) -= pwr*pow(_freq,-exp)/kB/T0;\
206  cy (n2,n1) -= pwr*pow(_freq,-exp)/kB/T0;\
207  cy (n1,n1) += pwr*pow(_freq,-exp)/kB/T0;\
208  cy (n2,n2) += pwr*pow(_freq,-exp)/kB/T0;
209 #define _load_flickernoise1(n1,pwr,exp)\
210  cy (n1,n1) += pwr*pow(_freq,-exp)/kB/T0;
211 
212 // derivative helper macros
213 #define m00_hypot(v00,x,y) v00 = xhypot(x,y);
214 #define m10_hypot(v10,v00,x,y) v10 = (x)/(v00);
215 #define m11_hypot(v11,v00,x,y) v11 = (y)/(v00);
216 #define m00_max(v00,x,y) v00 = ((x)>(y))?(x):(y);
217 #define m10_max(v10,v00,x,y) v10 = ((x)>(y))?1.0:0.0;
218 #define m11_max(v11,v00,x,y) v11 = ((x)>(y))?0.0:1.0;
219 #define m00_min(v00,x,y) v00 = ((x)<(y))?(x):(y);
220 #define m10_min(v10,v00,x,y) v10 = ((x)<(y))?1.0:0.0;
221 #define m11_min(v11,v00,x,y) v11 = ((x)<(y))?0.0:1.0;
222 #define m00_pow(v00,x,y) v00 = pow(x,y);
223 #define m10_pow(v10,v00,x,y) v10 = (x==0.0)?0.0:(v00)*(y)/(x);
224 #define m11_pow(v11,v00,x,y) v11 = (x==0.0)?0.0:(log(x)*(v00));
225 
226 #define m00_div(v00,v10,x,y) double v10=1/(y); double v00=(x)*v10;
227 #define m10_div(v10,v00,vv,x,y)
228 #define m11_div(v11,v00,vv,x,y) double v11 = -v00*vv;
229 
230 #define m00_mult(v00,v10,v11,x,y) double v10=(x); double v11=(y); double v00=v10*v11;
231 #define m00_add(v00,x,y) double v00=(x)+(y);
232 
233 #define m00_cos(v00,x) v00 = cos(x);
234 #define m10_cos(v10,v00,x) v10 = (-sin(x));
235 #define m00_sin(v00,x) v00 = sin(x);
236 #define m10_sin(v10,v00,x) v10 = (cos(x));
237 #define m00_tan(v00,x) v00 = tan(x);
238 #define m10_tan(v10,v00,x) v10 = (1.0/cos(x)/cos(x));
239 #define m00_cosh(v00,x) v00 = cosh(x);
240 #define m10_cosh(v10,v00,x) v10 = (sinh(x));
241 #define m00_sinh(v00,x) v00 = sinh(x);
242 #define m10_sinh(v10,v00,x) v10 = (cosh(x));
243 #define m00_tanh(v00,x) v00 = tanh(x);
244 #define m10_tanh(v10,v00,x) v10 = (1.0/cosh(x)/cosh(x));
245 #define m00_acos(v00,x) v00 = acos(x);
246 #define m10_acos(v10,v00,x) v10 = (-1.0/sqrt(1-x*x));
247 #define m00_asin(v00,x) v00 = asin(x);
248 #define m10_asin(v10,v00,x) v10 = (+1.0/sqrt(1-x*x));
249 #define m00_atan(v00,x) v00 = atan(x);
250 #define m10_atan(v10,v00,x) v10 = (+1.0/(1+x*x));
251 #define m00_atanh(v00,x) v00 = atanh(x);
252 #define m10_atanh(v10,v00,x) v10 = (+1.0/(1-x*x));
253 #define m00_logE(v00,x) v00 = log(x);
254 #define m10_logE(v10,v00,x) v10 = (1.0/x);
255 #define m00_log10(v00,x) v00 = log10(x);
256 #define m10_log10(v10,v00,x) v10 = (1.0/x/M_LN10);
257 #define m00_sqrt(v00,x) v00 = sqrt(x);
258 #define m10_sqrt(v10,v00,x) v10 = (0.5/v00);
259 #define m00_fabs(v00,x) v00 = fabs(x);
260 #define m10_fabs(v10,v00,x) v10 = (((x)>=0)?(+1.0):(-1.0));
261 
262 #define m00_exp(v00,x) v00 = exp(x);
263 #define m10_exp(v10,v00,x) v10 = v00;
264 
265 #define m00_abs(v00) ((v00)<(0)?(-(v00)):(v00))
266 #define m00_floor(v00,x) v00 = floor(x);
267 #define m00_limexp(v00,x) v00 = ((x)<80.0?exp(x):exp(80.0)*(x-79.0));
268 #define m10_limexp(v10,v00,x) v10 = ((x)<80.0?(v00):exp(80.0));
269 
270 #define m20_logE(v00) (-1.0/v00/v00)
271 #define m20_exp(v00) exp(v00)
272 #define m20_limexp(v00) ((v00)<80.0?exp(v00):0.0)
273 #define m20_sqrt(v00) (-0.25/(v00)/sqrt(v00))
274 #define m20_fabs(v00) 0.0
275 #define m20_pow(x,y) ((y)*((y)-1.0)*pow(x,y)/(x)/(x))
276 #define m00_vt(x) (kBoverQ*(x))
277 #define m10_vt(x) (kBoverQ)
278 
279 // simulator specific definitions
280 #define _modelname "dmux4to16"
281 #define _instancename getName()
282 #define _circuit_temp (getPropertyDouble("Temp")+273.15)
283 #define _param_given(p) (isPropertyGiven(p)?1:0)
284 
285 
286 // $vt and $vt() functions
287 #define _vt_nom (kBoverQ*_circuit_temp)
288 
289 using namespace device;
290 
291 /* Device constructor. */
293 {
294  type = CIR_dmux4to16;
295 }
296 
297 /* Initialization of model. */
298 void dmux4to16::initModel (void)
299 {
300  // create internal nodes
301  setInternalNode (Y0n1, "Y0n1");
302  setInternalNode (Y0n2, "Y0n2");
303  setInternalNode (Y1n1, "Y1n1");
304  setInternalNode (Y1n2, "Y1n2");
305  setInternalNode (Y2n1, "Y2n1");
306  setInternalNode (Y2n2, "Y2n2");
307  setInternalNode (Y3n1, "Y3n1");
308  setInternalNode (Y3n2, "Y3n2");
309  setInternalNode (Y4n1, "Y4n1");
310  setInternalNode (Y4n2, "Y4n2");
311  setInternalNode (Y5n1, "Y5n1");
312  setInternalNode (Y5n2, "Y5n2");
313  setInternalNode (Y6n1, "Y6n1");
314  setInternalNode (Y6n2, "Y6n2");
315  setInternalNode (Y7n1, "Y7n1");
316  setInternalNode (Y7n2, "Y7n2");
317  setInternalNode (Y8n1, "Y8n1");
318  setInternalNode (Y8n2, "Y8n2");
319  setInternalNode (Y9n1, "Y9n1");
320  setInternalNode (Y9n2, "Y9n2");
321  setInternalNode (Y10n1, "Y10n1");
322  setInternalNode (Y10n2, "Y10n2");
323  setInternalNode (Y11n1, "Y11n1");
324  setInternalNode (Y11n2, "Y11n2");
325  setInternalNode (Y12n1, "Y12n1");
326  setInternalNode (Y12n2, "Y12n2");
327  setInternalNode (Y13n1, "Y13n1");
328  setInternalNode (Y13n2, "Y13n2");
329  setInternalNode (Y14n1, "Y14n1");
330  setInternalNode (Y14n2, "Y14n2");
331  setInternalNode (Y15n1, "Y15n1");
332  setInternalNode (Y15n2, "Y15n2");
333 
334  // get device model parameters
335  loadVariables ();
336  // evaluate global model equations
337  initializeModel ();
338  // evaluate initial step equations
339  initialStep ();
340  // evaluate global instance equations
341  initializeInstance ();
342 }
343 
344 /* Initialization of DC analysis. */
345 void dmux4to16::initDC (void)
346 {
347  allocMatrixMNA ();
348  initModel ();
349  pol = 1;
350  restartDC ();
351  doAC = 1;
352  doTR = 0;
353  doHB = 0;
354 }
355 
356 /* Run when DC is restarted (fallback algorithms). */
358 {
359 }
360 
361 /* Initialize Verilog-AMS code. */
362 void dmux4to16::initVerilog (void)
363 {
364  // initialization of noise variables
365 
366  int i1, i2, i3, i4;
367 
368  // zero charges
369  for (i1 = 0; i1 < 53; i1++) {
370  for (i2 = 0; i2 < 53; i2++) {
371  _charges[i1][i2] = 0.0;
372  } }
373 
374  // zero capacitances
375  for (i1 = 0; i1 < 53; i1++) {
376  for (i2 = 0; i2 < 53; i2++) {
377  for (i3 = 0; i3 < 53; i3++) {
378  for (i4 = 0; i4 < 53; i4++) {
379  _caps[i1][i2][i3][i4] = 0.0;
380  } } } }
381 
382  // zero right hand side, static and dynamic jacobian
383  for (i1 = 0; i1 < 53; i1++) {
384  _rhs[i1] = 0.0;
385  _qhs[i1] = 0.0;
386  _chs[i1] = 0.0;
387  _ghs[i1] = 0.0;
388  for (i2 = 0; i2 < 53; i2++) {
389  _jstat[i1][i2] = 0.0;
390  _jdyna[i1][i2] = 0.0;
391  }
392  }
393 }
394 
395 /* Load device model input parameters. */
396 void dmux4to16::loadVariables (void)
397 {
398  TR = getPropertyDouble ("TR");
399  Delay = getPropertyDouble ("Delay");
400 }
401 
402 /* #define's for translated code */
403 #undef _DDT
404 #define _DDT(q) q
405 #define _DYNAMIC
406 #define _DERIVATE
407 #define _DDX
408 #define _DERIVATEFORDDX
409 
410 /* Evaluate Verilog-AMS equations in model initialization. */
411 void dmux4to16::initializeModel (void)
412 {
413 #if defined(_DYNAMIC)
414 #endif
415 {
416 Rd=1e3;
417 #if defined(_DYNAMIC)
418 Cd=((Delay*1.43)/Rd);
419 #endif
420 }
421 }
422 
423 /* Evaluate Verilog-AMS equations in instance initialization. */
424 void dmux4to16::initializeInstance (void)
425 {
426 }
427 
428 /* Evaluate Verilog-AMS equations in initial step. */
429 void dmux4to16::initialStep (void)
430 {
431 }
432 
433 /* Evaluate Verilog-AMS equations in final step. */
434 void dmux4to16::finalStep (void)
435 {
436 }
437 
438 /* Evaluate Verilog-AMS equations in analog block. */
439 void dmux4to16::calcVerilog (void)
440 {
441 
442 /* ----------------- evaluate verilog analog equations -------------------- */
443 double IY15;
444 #if defined(_DERIVATE)
445 double IY15_VEN_GND;
446 double IY15_VD_GND;
447 double IY15_VC_GND;
448 double IY15_VB_GND;
449 double IY15_VA_GND;
450 #endif
451 double IY14;
452 #if defined(_DERIVATE)
453 double IY14_VEN_GND;
454 double IY14_VD_GND;
455 double IY14_VC_GND;
456 double IY14_VB_GND;
457 double IY14_VA_GND;
458 #endif
459 double IY13;
460 #if defined(_DERIVATE)
461 double IY13_VEN_GND;
462 double IY13_VD_GND;
463 double IY13_VC_GND;
464 double IY13_VB_GND;
465 double IY13_VA_GND;
466 #endif
467 double IY12;
468 #if defined(_DERIVATE)
469 double IY12_VEN_GND;
470 double IY12_VD_GND;
471 double IY12_VC_GND;
472 double IY12_VB_GND;
473 double IY12_VA_GND;
474 #endif
475 double IY11;
476 #if defined(_DERIVATE)
477 double IY11_VEN_GND;
478 double IY11_VD_GND;
479 double IY11_VC_GND;
480 double IY11_VB_GND;
481 double IY11_VA_GND;
482 #endif
483 double IY10;
484 #if defined(_DERIVATE)
485 double IY10_VEN_GND;
486 double IY10_VD_GND;
487 double IY10_VC_GND;
488 double IY10_VB_GND;
489 double IY10_VA_GND;
490 #endif
491 double IY9;
492 #if defined(_DERIVATE)
493 double IY9_VEN_GND;
494 double IY9_VD_GND;
495 double IY9_VC_GND;
496 double IY9_VB_GND;
497 double IY9_VA_GND;
498 #endif
499 double IY8;
500 #if defined(_DERIVATE)
501 double IY8_VEN_GND;
502 double IY8_VD_GND;
503 double IY8_VC_GND;
504 double IY8_VB_GND;
505 double IY8_VA_GND;
506 #endif
507 double IY7;
508 #if defined(_DERIVATE)
509 double IY7_VEN_GND;
510 double IY7_VD_GND;
511 double IY7_VC_GND;
512 double IY7_VB_GND;
513 double IY7_VA_GND;
514 #endif
515 double IY6;
516 #if defined(_DERIVATE)
517 double IY6_VEN_GND;
518 double IY6_VD_GND;
519 double IY6_VC_GND;
520 double IY6_VB_GND;
521 double IY6_VA_GND;
522 #endif
523 double IY5;
524 #if defined(_DERIVATE)
525 double IY5_VEN_GND;
526 double IY5_VD_GND;
527 double IY5_VC_GND;
528 double IY5_VB_GND;
529 double IY5_VA_GND;
530 #endif
531 double IY4;
532 #if defined(_DERIVATE)
533 double IY4_VEN_GND;
534 double IY4_VD_GND;
535 double IY4_VC_GND;
536 double IY4_VB_GND;
537 double IY4_VA_GND;
538 #endif
539 double IY3;
540 #if defined(_DERIVATE)
541 double IY3_VEN_GND;
542 double IY3_VD_GND;
543 double IY3_VC_GND;
544 double IY3_VB_GND;
545 double IY3_VA_GND;
546 #endif
547 double IY2;
548 #if defined(_DERIVATE)
549 double IY2_VEN_GND;
550 double IY2_VD_GND;
551 double IY2_VC_GND;
552 double IY2_VB_GND;
553 double IY2_VA_GND;
554 #endif
555 double IY1;
556 #if defined(_DERIVATE)
557 double IY1_VEN_GND;
558 double IY1_VD_GND;
559 double IY1_VC_GND;
560 double IY1_VB_GND;
561 double IY1_VA_GND;
562 #endif
563 double IY0;
564 #if defined(_DERIVATE)
565 double IY0_VEN_GND;
566 double IY0_VD_GND;
567 double IY0_VC_GND;
568 double IY0_VB_GND;
569 double IY0_VA_GND;
570 #endif
571 double VDI;
572 #if defined(_DERIVATE)
573 double VDI_VD_GND;
574 #endif
575 double VCI;
576 #if defined(_DERIVATE)
577 double VCI_VC_GND;
578 #endif
579 double VBI;
580 #if defined(_DERIVATE)
581 double VBI_VB_GND;
582 #endif
583 double VAI;
584 #if defined(_DERIVATE)
585 double VAI_VA_GND;
586 #endif
587 double VENI;
588 #if defined(_DERIVATE)
589 double VENI_VEN_GND;
590 #endif
591 #if defined(_DERIVATE)
592 VENI_VEN_GND=(-1.0);
593 #endif
594 VENI=(1-NP(EN));
595 #if defined(_DERIVATE)
596 VAI_VA_GND=(-1.0);
597 #endif
598 VAI=(1-NP(A));
599 #if defined(_DERIVATE)
600 VBI_VB_GND=(-1.0);
601 #endif
602 VBI=(1-NP(B));
603 #if defined(_DERIVATE)
604 VCI_VC_GND=(-1.0);
605 #endif
606 VCI=(1-NP(C));
607 #if defined(_DERIVATE)
608 VDI_VD_GND=(-1.0);
609 #endif
610 VDI=(1-NP(D));
611 #if defined(_DERIVATE)
612 IY0_VEN_GND=VENI_VEN_GND*VDI*VCI*VBI*VAI;
613 IY0_VD_GND=(VENI*VDI_VD_GND)*VCI*VBI*VAI;
614 IY0_VC_GND=((VENI*VDI)*VCI_VC_GND)*VBI*VAI;
615 IY0_VB_GND=(((VENI*VDI)*VCI)*VBI_VB_GND)*VAI;
616 IY0_VA_GND=((((VENI*VDI)*VCI)*VBI)*VAI_VA_GND);
617 #endif
618 IY0=((((VENI*VDI)*VCI)*VBI)*VAI);
619 {
620 double m00_tanh(d00_tanh0,(TR*(IY0-0.5)))
621 #if defined(_DERIVATE)
622 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY0-0.5)))
623 #endif
624 _load_static_residual1(Y0n1,((-0.5)*(1+d00_tanh0)));
625 #if defined(_DERIVATE)
626 _load_static_jacobian1(Y0n1,A,((-0.5)*(TR*IY0_VA_GND)*d10_tanh0));
627 _load_static_jacobian1(Y0n1,B,((-0.5)*(TR*IY0_VB_GND)*d10_tanh0));
628 _load_static_jacobian1(Y0n1,C,((-0.5)*(TR*IY0_VC_GND)*d10_tanh0));
629 _load_static_jacobian1(Y0n1,D,((-0.5)*(TR*IY0_VD_GND)*d10_tanh0));
630 _load_static_jacobian1(Y0n1,EN,((-0.5)*(TR*IY0_VEN_GND)*d10_tanh0));
631 #endif
632 }
634 #if defined(_DERIVATE)
636 #endif
638 #if defined(_DERIVATE)
640 #endif
641 #if defined(_DYNAMIC)
643 #if defined(_DERIVATE)
645 #endif
646 #endif
648 #if defined(_DERIVATE)
650 #endif
652 #if defined(_DERIVATE)
654 #endif
655 #if defined(_DERIVATE)
656 IY1_VEN_GND=VENI_VEN_GND*VDI*VCI*VBI*NP(A);
657 IY1_VD_GND=(VENI*VDI_VD_GND)*VCI*VBI*NP(A);
658 IY1_VC_GND=((VENI*VDI)*VCI_VC_GND)*VBI*NP(A);
659 IY1_VB_GND=(((VENI*VDI)*VCI)*VBI_VB_GND)*NP(A);
660 IY1_VA_GND=((((VENI*VDI)*VCI)*VBI));
661 #endif
662 IY1=((((VENI*VDI)*VCI)*VBI)*NP(A));
663 {
664 double m00_tanh(d00_tanh0,(TR*(IY1-0.5)))
665 #if defined(_DERIVATE)
666 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY1-0.5)))
667 #endif
668 _load_static_residual1(Y1n1,((-0.5)*(1+d00_tanh0)));
669 #if defined(_DERIVATE)
670 _load_static_jacobian1(Y1n1,A,((-0.5)*(TR*IY1_VA_GND)*d10_tanh0));
671 _load_static_jacobian1(Y1n1,B,((-0.5)*(TR*IY1_VB_GND)*d10_tanh0));
672 _load_static_jacobian1(Y1n1,C,((-0.5)*(TR*IY1_VC_GND)*d10_tanh0));
673 _load_static_jacobian1(Y1n1,D,((-0.5)*(TR*IY1_VD_GND)*d10_tanh0));
674 _load_static_jacobian1(Y1n1,EN,((-0.5)*(TR*IY1_VEN_GND)*d10_tanh0));
675 #endif
676 }
678 #if defined(_DERIVATE)
680 #endif
682 #if defined(_DERIVATE)
684 #endif
685 #if defined(_DYNAMIC)
687 #if defined(_DERIVATE)
689 #endif
690 #endif
692 #if defined(_DERIVATE)
694 #endif
696 #if defined(_DERIVATE)
698 #endif
699 #if defined(_DERIVATE)
700 IY2_VEN_GND=VENI_VEN_GND*VDI*VCI*NP(B)*VAI;
701 IY2_VD_GND=(VENI*VDI_VD_GND)*VCI*NP(B)*VAI;
702 IY2_VC_GND=((VENI*VDI)*VCI_VC_GND)*NP(B)*VAI;
703 IY2_VB_GND=(((VENI*VDI)*VCI))*VAI;
704 IY2_VA_GND=((((VENI*VDI)*VCI)*NP(B))*VAI_VA_GND);
705 #endif
706 IY2=((((VENI*VDI)*VCI)*NP(B))*VAI);
707 {
708 double m00_tanh(d00_tanh0,(TR*(IY2-0.5)))
709 #if defined(_DERIVATE)
710 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY2-0.5)))
711 #endif
712 _load_static_residual1(Y2n1,((-0.5)*(1+d00_tanh0)));
713 #if defined(_DERIVATE)
714 _load_static_jacobian1(Y2n1,A,((-0.5)*(TR*IY2_VA_GND)*d10_tanh0));
715 _load_static_jacobian1(Y2n1,B,((-0.5)*(TR*IY2_VB_GND)*d10_tanh0));
716 _load_static_jacobian1(Y2n1,C,((-0.5)*(TR*IY2_VC_GND)*d10_tanh0));
717 _load_static_jacobian1(Y2n1,D,((-0.5)*(TR*IY2_VD_GND)*d10_tanh0));
718 _load_static_jacobian1(Y2n1,EN,((-0.5)*(TR*IY2_VEN_GND)*d10_tanh0));
719 #endif
720 }
722 #if defined(_DERIVATE)
724 #endif
726 #if defined(_DERIVATE)
728 #endif
729 #if defined(_DYNAMIC)
731 #if defined(_DERIVATE)
733 #endif
734 #endif
736 #if defined(_DERIVATE)
738 #endif
740 #if defined(_DERIVATE)
742 #endif
743 #if defined(_DERIVATE)
744 IY3_VEN_GND=VENI_VEN_GND*VDI*VCI*NP(B)*NP(A);
745 IY3_VD_GND=(VENI*VDI_VD_GND)*VCI*NP(B)*NP(A);
746 IY3_VC_GND=((VENI*VDI)*VCI_VC_GND)*NP(B)*NP(A);
747 IY3_VB_GND=(((VENI*VDI)*VCI))*NP(A);
748 IY3_VA_GND=((((VENI*VDI)*VCI)*NP(B)));
749 #endif
750 IY3=((((VENI*VDI)*VCI)*NP(B))*NP(A));
751 {
752 double m00_tanh(d00_tanh0,(TR*(IY3-0.5)))
753 #if defined(_DERIVATE)
754 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY3-0.5)))
755 #endif
756 _load_static_residual1(Y3n1,((-0.5)*(1+d00_tanh0)));
757 #if defined(_DERIVATE)
758 _load_static_jacobian1(Y3n1,A,((-0.5)*(TR*IY3_VA_GND)*d10_tanh0));
759 _load_static_jacobian1(Y3n1,B,((-0.5)*(TR*IY3_VB_GND)*d10_tanh0));
760 _load_static_jacobian1(Y3n1,C,((-0.5)*(TR*IY3_VC_GND)*d10_tanh0));
761 _load_static_jacobian1(Y3n1,D,((-0.5)*(TR*IY3_VD_GND)*d10_tanh0));
762 _load_static_jacobian1(Y3n1,EN,((-0.5)*(TR*IY3_VEN_GND)*d10_tanh0));
763 #endif
764 }
766 #if defined(_DERIVATE)
768 #endif
770 #if defined(_DERIVATE)
772 #endif
773 #if defined(_DYNAMIC)
775 #if defined(_DERIVATE)
777 #endif
778 #endif
780 #if defined(_DERIVATE)
782 #endif
784 #if defined(_DERIVATE)
786 #endif
787 #if defined(_DERIVATE)
788 IY4_VEN_GND=VENI_VEN_GND*VDI*NP(C)*VBI*VAI;
789 IY4_VD_GND=(VENI*VDI_VD_GND)*NP(C)*VBI*VAI;
790 IY4_VC_GND=((VENI*VDI))*VBI*VAI;
791 IY4_VB_GND=(((VENI*VDI)*NP(C))*VBI_VB_GND)*VAI;
792 IY4_VA_GND=((((VENI*VDI)*NP(C))*VBI)*VAI_VA_GND);
793 #endif
794 IY4=((((VENI*VDI)*NP(C))*VBI)*VAI);
795 {
796 double m00_tanh(d00_tanh0,(TR*(IY4-0.5)))
797 #if defined(_DERIVATE)
798 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY4-0.5)))
799 #endif
800 _load_static_residual1(Y4n1,((-0.5)*(1+d00_tanh0)));
801 #if defined(_DERIVATE)
802 _load_static_jacobian1(Y4n1,A,((-0.5)*(TR*IY4_VA_GND)*d10_tanh0));
803 _load_static_jacobian1(Y4n1,B,((-0.5)*(TR*IY4_VB_GND)*d10_tanh0));
804 _load_static_jacobian1(Y4n1,C,((-0.5)*(TR*IY4_VC_GND)*d10_tanh0));
805 _load_static_jacobian1(Y4n1,D,((-0.5)*(TR*IY4_VD_GND)*d10_tanh0));
806 _load_static_jacobian1(Y4n1,EN,((-0.5)*(TR*IY4_VEN_GND)*d10_tanh0));
807 #endif
808 }
810 #if defined(_DERIVATE)
812 #endif
814 #if defined(_DERIVATE)
816 #endif
817 #if defined(_DYNAMIC)
819 #if defined(_DERIVATE)
821 #endif
822 #endif
824 #if defined(_DERIVATE)
826 #endif
828 #if defined(_DERIVATE)
830 #endif
831 #if defined(_DERIVATE)
832 IY5_VEN_GND=VENI_VEN_GND*VDI*NP(C)*VBI*NP(A);
833 IY5_VD_GND=(VENI*VDI_VD_GND)*NP(C)*VBI*NP(A);
834 IY5_VC_GND=((VENI*VDI))*VBI*NP(A);
835 IY5_VB_GND=(((VENI*VDI)*NP(C))*VBI_VB_GND)*NP(A);
836 IY5_VA_GND=((((VENI*VDI)*NP(C))*VBI));
837 #endif
838 IY5=((((VENI*VDI)*NP(C))*VBI)*NP(A));
839 {
840 double m00_tanh(d00_tanh0,(TR*(IY5-0.5)))
841 #if defined(_DERIVATE)
842 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY5-0.5)))
843 #endif
844 _load_static_residual1(Y5n1,((-0.5)*(1+d00_tanh0)));
845 #if defined(_DERIVATE)
846 _load_static_jacobian1(Y5n1,A,((-0.5)*(TR*IY5_VA_GND)*d10_tanh0));
847 _load_static_jacobian1(Y5n1,B,((-0.5)*(TR*IY5_VB_GND)*d10_tanh0));
848 _load_static_jacobian1(Y5n1,C,((-0.5)*(TR*IY5_VC_GND)*d10_tanh0));
849 _load_static_jacobian1(Y5n1,D,((-0.5)*(TR*IY5_VD_GND)*d10_tanh0));
850 _load_static_jacobian1(Y5n1,EN,((-0.5)*(TR*IY5_VEN_GND)*d10_tanh0));
851 #endif
852 }
854 #if defined(_DERIVATE)
856 #endif
858 #if defined(_DERIVATE)
860 #endif
861 #if defined(_DYNAMIC)
863 #if defined(_DERIVATE)
865 #endif
866 #endif
868 #if defined(_DERIVATE)
870 #endif
872 #if defined(_DERIVATE)
874 #endif
875 #if defined(_DERIVATE)
876 IY6_VEN_GND=VENI_VEN_GND*VDI*NP(C)*NP(B)*VAI;
877 IY6_VD_GND=(VENI*VDI_VD_GND)*NP(C)*NP(B)*VAI;
878 IY6_VC_GND=((VENI*VDI))*NP(B)*VAI;
879 IY6_VB_GND=(((VENI*VDI)*NP(C)))*VAI;
880 IY6_VA_GND=((((VENI*VDI)*NP(C))*NP(B))*VAI_VA_GND);
881 #endif
882 IY6=((((VENI*VDI)*NP(C))*NP(B))*VAI);
883 {
884 double m00_tanh(d00_tanh0,(TR*(IY6-0.5)))
885 #if defined(_DERIVATE)
886 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY6-0.5)))
887 #endif
888 _load_static_residual1(Y6n1,((-0.5)*(1+d00_tanh0)));
889 #if defined(_DERIVATE)
890 _load_static_jacobian1(Y6n1,A,((-0.5)*(TR*IY6_VA_GND)*d10_tanh0));
891 _load_static_jacobian1(Y6n1,B,((-0.5)*(TR*IY6_VB_GND)*d10_tanh0));
892 _load_static_jacobian1(Y6n1,C,((-0.5)*(TR*IY6_VC_GND)*d10_tanh0));
893 _load_static_jacobian1(Y6n1,D,((-0.5)*(TR*IY6_VD_GND)*d10_tanh0));
894 _load_static_jacobian1(Y6n1,EN,((-0.5)*(TR*IY6_VEN_GND)*d10_tanh0));
895 #endif
896 }
898 #if defined(_DERIVATE)
900 #endif
902 #if defined(_DERIVATE)
904 #endif
905 #if defined(_DYNAMIC)
907 #if defined(_DERIVATE)
909 #endif
910 #endif
912 #if defined(_DERIVATE)
914 #endif
916 #if defined(_DERIVATE)
918 #endif
919 #if defined(_DERIVATE)
920 IY7_VEN_GND=VENI_VEN_GND*VDI*NP(C)*NP(B)*NP(A);
921 IY7_VD_GND=(VENI*VDI_VD_GND)*NP(C)*NP(B)*NP(A);
922 IY7_VC_GND=((VENI*VDI))*NP(B)*NP(A);
923 IY7_VB_GND=(((VENI*VDI)*NP(C)))*NP(A);
924 IY7_VA_GND=((((VENI*VDI)*NP(C))*NP(B)));
925 #endif
926 IY7=((((VENI*VDI)*NP(C))*NP(B))*NP(A));
927 {
928 double m00_tanh(d00_tanh0,(TR*(IY7-0.5)))
929 #if defined(_DERIVATE)
930 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY7-0.5)))
931 #endif
932 _load_static_residual1(Y7n1,((-0.5)*(1+d00_tanh0)));
933 #if defined(_DERIVATE)
934 _load_static_jacobian1(Y7n1,A,((-0.5)*(TR*IY7_VA_GND)*d10_tanh0));
935 _load_static_jacobian1(Y7n1,B,((-0.5)*(TR*IY7_VB_GND)*d10_tanh0));
936 _load_static_jacobian1(Y7n1,C,((-0.5)*(TR*IY7_VC_GND)*d10_tanh0));
937 _load_static_jacobian1(Y7n1,D,((-0.5)*(TR*IY7_VD_GND)*d10_tanh0));
938 _load_static_jacobian1(Y7n1,EN,((-0.5)*(TR*IY7_VEN_GND)*d10_tanh0));
939 #endif
940 }
942 #if defined(_DERIVATE)
944 #endif
946 #if defined(_DERIVATE)
948 #endif
949 #if defined(_DYNAMIC)
951 #if defined(_DERIVATE)
953 #endif
954 #endif
956 #if defined(_DERIVATE)
958 #endif
960 #if defined(_DERIVATE)
962 #endif
963 #if defined(_DERIVATE)
964 IY8_VEN_GND=VENI_VEN_GND*NP(D)*VCI*VBI*VAI;
965 IY8_VD_GND=(VENI)*VCI*VBI*VAI;
966 IY8_VC_GND=((VENI*NP(D))*VCI_VC_GND)*VBI*VAI;
967 IY8_VB_GND=(((VENI*NP(D))*VCI)*VBI_VB_GND)*VAI;
968 IY8_VA_GND=((((VENI*NP(D))*VCI)*VBI)*VAI_VA_GND);
969 #endif
970 IY8=((((VENI*NP(D))*VCI)*VBI)*VAI);
971 {
972 double m00_tanh(d00_tanh0,(TR*(IY8-0.5)))
973 #if defined(_DERIVATE)
974 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY8-0.5)))
975 #endif
976 _load_static_residual1(Y8n1,((-0.5)*(1+d00_tanh0)));
977 #if defined(_DERIVATE)
978 _load_static_jacobian1(Y8n1,A,((-0.5)*(TR*IY8_VA_GND)*d10_tanh0));
979 _load_static_jacobian1(Y8n1,B,((-0.5)*(TR*IY8_VB_GND)*d10_tanh0));
980 _load_static_jacobian1(Y8n1,C,((-0.5)*(TR*IY8_VC_GND)*d10_tanh0));
981 _load_static_jacobian1(Y8n1,D,((-0.5)*(TR*IY8_VD_GND)*d10_tanh0));
982 _load_static_jacobian1(Y8n1,EN,((-0.5)*(TR*IY8_VEN_GND)*d10_tanh0));
983 #endif
984 }
986 #if defined(_DERIVATE)
988 #endif
990 #if defined(_DERIVATE)
992 #endif
993 #if defined(_DYNAMIC)
995 #if defined(_DERIVATE)
997 #endif
998 #endif
1000 #if defined(_DERIVATE)
1002 #endif
1004 #if defined(_DERIVATE)
1006 #endif
1007 #if defined(_DERIVATE)
1008 IY9_VEN_GND=VENI_VEN_GND*NP(D)*VCI*VBI*NP(A);
1009 IY9_VD_GND=(VENI)*VCI*VBI*NP(A);
1010 IY9_VC_GND=((VENI*NP(D))*VCI_VC_GND)*VBI*NP(A);
1011 IY9_VB_GND=(((VENI*NP(D))*VCI)*VBI_VB_GND)*NP(A);
1012 IY9_VA_GND=((((VENI*NP(D))*VCI)*VBI));
1013 #endif
1014 IY9=((((VENI*NP(D))*VCI)*VBI)*NP(A));
1015 {
1016 double m00_tanh(d00_tanh0,(TR*(IY9-0.5)))
1017 #if defined(_DERIVATE)
1018 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY9-0.5)))
1019 #endif
1020 _load_static_residual1(Y9n1,((-0.5)*(1+d00_tanh0)));
1021 #if defined(_DERIVATE)
1022 _load_static_jacobian1(Y9n1,A,((-0.5)*(TR*IY9_VA_GND)*d10_tanh0));
1023 _load_static_jacobian1(Y9n1,B,((-0.5)*(TR*IY9_VB_GND)*d10_tanh0));
1024 _load_static_jacobian1(Y9n1,C,((-0.5)*(TR*IY9_VC_GND)*d10_tanh0));
1025 _load_static_jacobian1(Y9n1,D,((-0.5)*(TR*IY9_VD_GND)*d10_tanh0));
1026 _load_static_jacobian1(Y9n1,EN,((-0.5)*(TR*IY9_VEN_GND)*d10_tanh0));
1027 #endif
1028 }
1030 #if defined(_DERIVATE)
1032 #endif
1034 #if defined(_DERIVATE)
1036 #endif
1037 #if defined(_DYNAMIC)
1039 #if defined(_DERIVATE)
1041 #endif
1042 #endif
1044 #if defined(_DERIVATE)
1046 #endif
1048 #if defined(_DERIVATE)
1050 #endif
1051 #if defined(_DERIVATE)
1052 IY10_VEN_GND=VENI_VEN_GND*NP(D)*VCI*NP(B)*VAI;
1053 IY10_VD_GND=(VENI)*VCI*NP(B)*VAI;
1054 IY10_VC_GND=((VENI*NP(D))*VCI_VC_GND)*NP(B)*VAI;
1055 IY10_VB_GND=(((VENI*NP(D))*VCI))*VAI;
1056 IY10_VA_GND=((((VENI*NP(D))*VCI)*NP(B))*VAI_VA_GND);
1057 #endif
1058 IY10=((((VENI*NP(D))*VCI)*NP(B))*VAI);
1059 {
1060 double m00_tanh(d00_tanh0,(TR*(IY10-0.5)))
1061 #if defined(_DERIVATE)
1062 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY10-0.5)))
1063 #endif
1064 _load_static_residual1(Y10n1,((-0.5)*(1+d00_tanh0)));
1065 #if defined(_DERIVATE)
1066 _load_static_jacobian1(Y10n1,A,((-0.5)*(TR*IY10_VA_GND)*d10_tanh0));
1067 _load_static_jacobian1(Y10n1,B,((-0.5)*(TR*IY10_VB_GND)*d10_tanh0));
1068 _load_static_jacobian1(Y10n1,C,((-0.5)*(TR*IY10_VC_GND)*d10_tanh0));
1069 _load_static_jacobian1(Y10n1,D,((-0.5)*(TR*IY10_VD_GND)*d10_tanh0));
1070 _load_static_jacobian1(Y10n1,EN,((-0.5)*(TR*IY10_VEN_GND)*d10_tanh0));
1071 #endif
1072 }
1074 #if defined(_DERIVATE)
1076 #endif
1078 #if defined(_DERIVATE)
1080 #endif
1081 #if defined(_DYNAMIC)
1083 #if defined(_DERIVATE)
1085 #endif
1086 #endif
1088 #if defined(_DERIVATE)
1090 #endif
1092 #if defined(_DERIVATE)
1094 #endif
1095 #if defined(_DERIVATE)
1096 IY11_VEN_GND=VENI_VEN_GND*NP(D)*VCI*NP(B)*NP(A);
1097 IY11_VD_GND=(VENI)*VCI*NP(B)*NP(A);
1098 IY11_VC_GND=((VENI*NP(D))*VCI_VC_GND)*NP(B)*NP(A);
1099 IY11_VB_GND=(((VENI*NP(D))*VCI))*NP(A);
1100 IY11_VA_GND=((((VENI*NP(D))*VCI)*NP(B)));
1101 #endif
1102 IY11=((((VENI*NP(D))*VCI)*NP(B))*NP(A));
1103 {
1104 double m00_tanh(d00_tanh0,(TR*(IY11-0.5)))
1105 #if defined(_DERIVATE)
1106 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY11-0.5)))
1107 #endif
1108 _load_static_residual1(Y11n1,((-0.5)*(1+d00_tanh0)));
1109 #if defined(_DERIVATE)
1110 _load_static_jacobian1(Y11n1,A,((-0.5)*(TR*IY11_VA_GND)*d10_tanh0));
1111 _load_static_jacobian1(Y11n1,B,((-0.5)*(TR*IY11_VB_GND)*d10_tanh0));
1112 _load_static_jacobian1(Y11n1,C,((-0.5)*(TR*IY11_VC_GND)*d10_tanh0));
1113 _load_static_jacobian1(Y11n1,D,((-0.5)*(TR*IY11_VD_GND)*d10_tanh0));
1114 _load_static_jacobian1(Y11n1,EN,((-0.5)*(TR*IY11_VEN_GND)*d10_tanh0));
1115 #endif
1116 }
1118 #if defined(_DERIVATE)
1120 #endif
1122 #if defined(_DERIVATE)
1124 #endif
1125 #if defined(_DYNAMIC)
1127 #if defined(_DERIVATE)
1129 #endif
1130 #endif
1132 #if defined(_DERIVATE)
1134 #endif
1136 #if defined(_DERIVATE)
1138 #endif
1139 #if defined(_DERIVATE)
1140 IY12_VEN_GND=VENI_VEN_GND*NP(D)*NP(C)*VBI*VAI;
1141 IY12_VD_GND=(VENI)*NP(C)*VBI*VAI;
1142 IY12_VC_GND=((VENI*NP(D)))*VBI*VAI;
1143 IY12_VB_GND=(((VENI*NP(D))*NP(C))*VBI_VB_GND)*VAI;
1144 IY12_VA_GND=((((VENI*NP(D))*NP(C))*VBI)*VAI_VA_GND);
1145 #endif
1146 IY12=((((VENI*NP(D))*NP(C))*VBI)*VAI);
1147 {
1148 double m00_tanh(d00_tanh0,(TR*(IY12-0.5)))
1149 #if defined(_DERIVATE)
1150 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY12-0.5)))
1151 #endif
1152 _load_static_residual1(Y12n1,((-0.5)*(1+d00_tanh0)));
1153 #if defined(_DERIVATE)
1154 _load_static_jacobian1(Y12n1,A,((-0.5)*(TR*IY12_VA_GND)*d10_tanh0));
1155 _load_static_jacobian1(Y12n1,B,((-0.5)*(TR*IY12_VB_GND)*d10_tanh0));
1156 _load_static_jacobian1(Y12n1,C,((-0.5)*(TR*IY12_VC_GND)*d10_tanh0));
1157 _load_static_jacobian1(Y12n1,D,((-0.5)*(TR*IY12_VD_GND)*d10_tanh0));
1158 _load_static_jacobian1(Y12n1,EN,((-0.5)*(TR*IY12_VEN_GND)*d10_tanh0));
1159 #endif
1160 }
1162 #if defined(_DERIVATE)
1164 #endif
1166 #if defined(_DERIVATE)
1168 #endif
1169 #if defined(_DYNAMIC)
1171 #if defined(_DERIVATE)
1173 #endif
1174 #endif
1176 #if defined(_DERIVATE)
1178 #endif
1180 #if defined(_DERIVATE)
1182 #endif
1183 #if defined(_DERIVATE)
1184 IY13_VEN_GND=VENI_VEN_GND*NP(D)*NP(C)*VBI*NP(A);
1185 IY13_VD_GND=(VENI)*NP(C)*VBI*NP(A);
1186 IY13_VC_GND=((VENI*NP(D)))*VBI*NP(A);
1187 IY13_VB_GND=(((VENI*NP(D))*NP(C))*VBI_VB_GND)*NP(A);
1188 IY13_VA_GND=((((VENI*NP(D))*NP(C))*VBI));
1189 #endif
1190 IY13=((((VENI*NP(D))*NP(C))*VBI)*NP(A));
1191 {
1192 double m00_tanh(d00_tanh0,(TR*(IY13-0.5)))
1193 #if defined(_DERIVATE)
1194 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY13-0.5)))
1195 #endif
1196 _load_static_residual1(Y13n1,((-0.5)*(1+d00_tanh0)));
1197 #if defined(_DERIVATE)
1198 _load_static_jacobian1(Y13n1,A,((-0.5)*(TR*IY13_VA_GND)*d10_tanh0));
1199 _load_static_jacobian1(Y13n1,B,((-0.5)*(TR*IY13_VB_GND)*d10_tanh0));
1200 _load_static_jacobian1(Y13n1,C,((-0.5)*(TR*IY13_VC_GND)*d10_tanh0));
1201 _load_static_jacobian1(Y13n1,D,((-0.5)*(TR*IY13_VD_GND)*d10_tanh0));
1202 _load_static_jacobian1(Y13n1,EN,((-0.5)*(TR*IY13_VEN_GND)*d10_tanh0));
1203 #endif
1204 }
1206 #if defined(_DERIVATE)
1208 #endif
1210 #if defined(_DERIVATE)
1212 #endif
1213 #if defined(_DYNAMIC)
1215 #if defined(_DERIVATE)
1217 #endif
1218 #endif
1220 #if defined(_DERIVATE)
1222 #endif
1224 #if defined(_DERIVATE)
1226 #endif
1227 #if defined(_DERIVATE)
1228 IY14_VEN_GND=VENI_VEN_GND*NP(D)*NP(C)*NP(B)*VAI;
1229 IY14_VD_GND=(VENI)*NP(C)*NP(B)*VAI;
1230 IY14_VC_GND=((VENI*NP(D)))*NP(B)*VAI;
1231 IY14_VB_GND=(((VENI*NP(D))*NP(C)))*VAI;
1232 IY14_VA_GND=((((VENI*NP(D))*NP(C))*NP(B))*VAI_VA_GND);
1233 #endif
1234 IY14=((((VENI*NP(D))*NP(C))*NP(B))*VAI);
1235 {
1236 double m00_tanh(d00_tanh0,(TR*(IY14-0.5)))
1237 #if defined(_DERIVATE)
1238 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY14-0.5)))
1239 #endif
1240 _load_static_residual1(Y14n1,((-0.5)*(1+d00_tanh0)));
1241 #if defined(_DERIVATE)
1242 _load_static_jacobian1(Y14n1,A,((-0.5)*(TR*IY14_VA_GND)*d10_tanh0));
1243 _load_static_jacobian1(Y14n1,B,((-0.5)*(TR*IY14_VB_GND)*d10_tanh0));
1244 _load_static_jacobian1(Y14n1,C,((-0.5)*(TR*IY14_VC_GND)*d10_tanh0));
1245 _load_static_jacobian1(Y14n1,D,((-0.5)*(TR*IY14_VD_GND)*d10_tanh0));
1246 _load_static_jacobian1(Y14n1,EN,((-0.5)*(TR*IY14_VEN_GND)*d10_tanh0));
1247 #endif
1248 }
1250 #if defined(_DERIVATE)
1252 #endif
1254 #if defined(_DERIVATE)
1256 #endif
1257 #if defined(_DYNAMIC)
1259 #if defined(_DERIVATE)
1261 #endif
1262 #endif
1264 #if defined(_DERIVATE)
1266 #endif
1268 #if defined(_DERIVATE)
1270 #endif
1271 #if defined(_DERIVATE)
1272 IY15_VEN_GND=VENI_VEN_GND*NP(D)*NP(C)*NP(B)*NP(A);
1273 IY15_VD_GND=(VENI)*NP(C)*NP(B)*NP(A);
1274 IY15_VC_GND=((VENI*NP(D)))*NP(B)*NP(A);
1275 IY15_VB_GND=(((VENI*NP(D))*NP(C)))*NP(A);
1276 IY15_VA_GND=((((VENI*NP(D))*NP(C))*NP(B)));
1277 #endif
1278 IY15=((((VENI*NP(D))*NP(C))*NP(B))*NP(A));
1279 {
1280 double m00_tanh(d00_tanh0,(TR*(IY15-0.5)))
1281 #if defined(_DERIVATE)
1282 double m10_tanh(d10_tanh0,d00_tanh0,(TR*(IY15-0.5)))
1283 #endif
1284 _load_static_residual1(Y15n1,((-0.5)*(1+d00_tanh0)));
1285 #if defined(_DERIVATE)
1286 _load_static_jacobian1(Y15n1,A,((-0.5)*(TR*IY15_VA_GND)*d10_tanh0));
1287 _load_static_jacobian1(Y15n1,B,((-0.5)*(TR*IY15_VB_GND)*d10_tanh0));
1288 _load_static_jacobian1(Y15n1,C,((-0.5)*(TR*IY15_VC_GND)*d10_tanh0));
1289 _load_static_jacobian1(Y15n1,D,((-0.5)*(TR*IY15_VD_GND)*d10_tanh0));
1290 _load_static_jacobian1(Y15n1,EN,((-0.5)*(TR*IY15_VEN_GND)*d10_tanh0));
1291 #endif
1292 }
1294 #if defined(_DERIVATE)
1296 #endif
1298 #if defined(_DERIVATE)
1300 #endif
1301 #if defined(_DYNAMIC)
1303 #if defined(_DERIVATE)
1305 #endif
1306 #endif
1308 #if defined(_DERIVATE)
1310 #endif
1312 #if defined(_DERIVATE)
1314 #endif
1315 
1316 /* ------------------ end of verilog analog equations --------------------- */
1317 
1318 /* ------------------ evaluate verilog noise equations -------------------- */
1319 
1320 /* ------------------- end of verilog noise equations --------------------- */
1321 }
1322 
1323 /* Perform DC iteration. */
1325 {
1326  // evaluate Verilog code
1327  initVerilog ();
1328  calcVerilog ();
1329 
1330  // fill right hand side and static jacobian
1331  for (int i1 = 0; i1 < 53; i1++) {
1332  setI (i1, _rhs[i1]);
1333  for (int i2 = 0; i2 < 53; i2++) {
1334  setY (i1, i2, _jstat[i1][i2]);
1335  }
1336  }
1337 }
1338 
1339 /* Save operating points. */
1341 {
1342  // save global instance operating points
1343 }
1344 
1345 /* Load operating points. */
1347 {
1348 }
1349 
1350 /* Calculate operating points. */
1352 {
1353 }
1354 
1355 /* Initialization of AC analysis. */
1357 {
1358  allocMatrixMNA ();
1359 }
1360 
1361 /* Perform AC calculations. */
1362 void dmux4to16::calcAC (nr_double_t frequency)
1363 {
1364  setMatrixY (calcMatrixY (frequency));
1365 }
1366 
1367 /* Compute Y-matrix for AC analysis. */
1368 matrix dmux4to16::calcMatrixY (nr_double_t frequency)
1369 {
1370  _freq = frequency;
1372  matrix y (53);
1373 
1374  for (int i1 = 0; i1 < 53; i1++) {
1375  for (int i2 = 0; i2 < 53; i2++) {
1376  y (i1,i2) = rect (_jstat[i1][i2], _jdyna[i1][i2] * 2 * M_PI * _freq);
1377  }
1378  }
1379 
1380  return y;
1381 }
1382 
1383 /* Initialization of S-parameter analysis. */
1385 {
1386  allocMatrixS ();
1387 }
1388 
1389 /* Perform S-parameter calculations. */
1390 void dmux4to16::calcSP (nr_double_t frequency)
1391 {
1392  setMatrixS (ytos (calcMatrixY (frequency)));
1393 }
1394 
1395 /* Initialization of transient analysis. */
1397 {
1398  setStates (2 * 53 * 53);
1399  initDC ();
1400 }
1401 
1402 /* Perform transient analysis iteration step. */
1403 void dmux4to16::calcTR (nr_double_t)
1404 {
1405  doHB = 0;
1406  doAC = 1;
1407  doTR = 1;
1408  calcDC ();
1409 
1410  int i1, i2, i3, i4, state;
1411 
1412  // 2-node charge integrations
1413  for (i1 = 0; i1 < 53; i1++) {
1414  for (i2 = 0; i2 < 53; i2++) {
1415  state = 2 * (i2 + 53 * i1);
1416  if (i1 != i2)
1417  if (_charges[i1][i2] != 0.0)
1418  transientCapacitanceQ (state, i1, i2, _charges[i1][i2]);
1419  } }
1420 
1421  // 1-node charge integrations
1422  for (i1 = 0; i1 < 53; i1++) {
1423  state = 2 * (i1 + 53 * i1);
1424  if (_charges[i1][i1] != 0.0)
1425  transientCapacitanceQ (state, i1, _charges[i1][i1]);
1426  }
1427 
1428  // charge: 2-node, voltage: 2-node
1429  for (i1 = 0; i1 < 53; i1++) {
1430  for (i2 = 0; i2 < 53; i2++) {
1431  if (i1 != i2)
1432  for (i3 = 0; i3 < 53; i3++) {
1433  for (i4 = 0; i4 < 53; i4++) {
1434  if (i3 != i4)
1435  if (_caps[i1][i2][i3][i4] != 0.0)
1436  transientCapacitanceC (i1, i2, i3, i4, _caps[i1][i2][i3][i4], BP(i3,i4));
1437  } } } }
1438 
1439  // charge: 2-node, voltage: 1-node
1440  for (i1 = 0; i1 < 53; i1++) {
1441  for (i2 = 0; i2 < 53; i2++) {
1442  if (i1 != i2)
1443  for (i3 = 0; i3 < 53; i3++) {
1444  if (_caps[i1][i2][i3][i3] != 0.0)
1445  transientCapacitanceC2Q (i1, i2, i3, _caps[i1][i2][i3][i3], NP(i3));
1446  } } }
1447 
1448  // charge: 1-node, voltage: 2-node
1449  for (i1 = 0; i1 < 53; i1++) {
1450  for (i3 = 0; i3 < 53; i3++) {
1451  for (i4 = 0; i4 < 53; i4++) {
1452  if (i3 != i4)
1453  if (_caps[i1][i1][i3][i4] != 0.0)
1454  transientCapacitanceC2V (i1, i3, i4, _caps[i1][i1][i3][i4], BP(i3,i4));
1455  } } }
1456 
1457  // charge: 1-node, voltage: 1-node
1458  for (i1 = 0; i1 < 53; i1++) {
1459  for (i3 = 0; i3 < 53; i3++) {
1460  if (_caps[i1][i1][i3][i3] != 0.0)
1461  transientCapacitanceC (i1, i3, _caps[i1][i1][i3][i3], NP(i3));
1462  } }
1463 }
1464 
1465 /* Compute Cy-matrix for AC noise analysis. */
1466 matrix dmux4to16::calcMatrixCy (nr_double_t frequency)
1467 {
1468  _freq = frequency;
1469  matrix cy (53);
1470 
1471 
1472  return cy;
1473 }
1474 
1475 /* Perform AC noise computations. */
1476 void dmux4to16::calcNoiseAC (nr_double_t frequency)
1477 {
1478  setMatrixN (calcMatrixCy (frequency));
1479 }
1480 
1481 /* Perform S-parameter noise computations. */
1482 void dmux4to16::calcNoiseSP (nr_double_t frequency)
1483 {
1484  setMatrixN (cytocs (calcMatrixCy (frequency) * z0, getMatrixS ()));
1485 }
1486 
1487 /* Initialization of HB analysis. */
1489 {
1490  initDC ();
1491  allocMatrixHB ();
1492 }
1493 
1494 /* Perform HB analysis. */
1496 {
1497  doHB = 1;
1498  doAC = 1;
1499  doTR = 0;
1500 
1501  // jacobian dI/dV and currents get filled
1502  calcDC ();
1504 
1505  // fill in HB matrices
1506  for (int i1 = 0; i1 < 53; i1++) {
1507  setQ (i1, _qhs[i1]); // charges
1508  setCV (i1, _chs[i1]); // jacobian dQ/dV * V
1509  setGV (i1, _ghs[i1]); // jacobian dI/dV * V
1510  for (int i2 = 0; i2 < 53; i2++) {
1511  setQV (i1, i2, _jdyna[i1][i2]); // jacobian dQ/dV
1512  }
1513  }
1514 }
1515 
1516 #include "dmux4to16.defs.h"