Jspice3
ltramisc.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1990 Jaijeet S. Roychowdhury
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <math.h>
10 #include "ltradefs.h"
11 #include "util.h"
12 
13 #ifndef M_PI
14 #define M_PI 3.14159265
15 #endif
16 
17 
18 #ifdef __STDC__
19 static double intlinfunc(double,double,double,double,double,double);
20 static double twiceintlinfunc(double,double,double,double,double,double,double);
21 static double thriceintlinfunc(double,double,double,double,double,double,double,double);
22 static double bessI0(double);
23 static double bessI1(double);
24 static double bessXX(double);
25 static double bessI1xOverX(double);
26 static double bessYY(double, double);
27 static double bessZZ(double, double);
28 static double ltra_rlcH1dashTwiceIntFunc(double,double);
29 static double ltra_rlcH3dashIntFunc(double,double,double);
30 static double ltra_rcH1dashTwiceIntFunc(double,double);
31 static double ltra_rcH2TwiceIntFunc(double,double);
32 #else
33 static double intlinfunc();
34 static double twiceintlinfunc();
35 static double thriceintlinfunc();
36 static double thriceintlinfunc();
37 static double bessI0();
38 static double bessI1();
39 static double bessXX();
40 static double bessI1xOverX();
41 static double bessYY();
42 static double bessZZ();
43 static double ltra_rlcH1dashTwiceIntFunc();
44 static double ltra_rlcH3dashIntFunc();
45 static double ltra_rcH1dashTwiceIntFunc();
46 static double ltra_rcH2TwiceIntFunc();
47 #endif
48 
49 /*
50  * Miscellaneous functions to do with lossy lines
51  */
52 
53 
54 /*
55  * LTRArcCoeffsSetup sets up the all coefficient lists for
56  * the special case where L=G=0
57  */
58 
59 void
60 LTRArcCoeffsSetup(ckt,InModel)
61 
62 CKTcircuit *ckt;
63 GENmodel *InModel;
64 {
65  LTRAmodel *model = (LTRAmodel*)InModel;
66  double delta1, delta2;
67  double h1dummy1, h1dummy2;
68  double h2dummy1, h2dummy2;
69  double h3dummy1, h3dummy2;
70  double lolimit1, lolimit2, hilimit1, hilimit2;
71  double h1lovalue1, h1lovalue2, h1hivalue1, h1hivalue2;
72  double h2lovalue1, h2lovalue2, h2hivalue1, h2hivalue2;
73  double h3lovalue1, h3lovalue2, h3hivalue1, h3hivalue2;
74  double temp, temp2, temp3, temp4, temp5;
75  double h1relval, h2relval, h3relval;
76  int doh1 = 1, doh2 = 1, doh3 = 1;
77  int i, auxindex;
78 
79  auxindex = ckt->CKTtimeIndex;
80 
81  /* the first coefficients */
82 
83  delta1 = ckt->CKTtime - *(ckt->CKTtimePoints + auxindex);
84  lolimit1 = 0.0;
85  hilimit1 = delta1;
86 
87  h1lovalue1 = 0.0;
88  h1hivalue1 = sqrt(4*model->LTRAcByR*hilimit1/M_PI);
89  h1dummy1 = h1hivalue1/delta1;
90  h1relval = FABS(h1dummy1*model->LTRAchopReltol);
91  model->LTRAh1dashFirstCoeff = h1dummy1;
92 
93  temp = model->LTRArclsqr/(4*hilimit1);
94  temp2 = (temp >= 100.0 ? 0.0 : erfc(sqrt(temp)));
95  temp3 = exp(-temp);
96  temp4 = sqrt(model->LTRArclsqr);
97  temp5 = sqrt(model->LTRAcByR);
98 
99  h2lovalue1 = 0.0;
100  if (hilimit1 != 0.0)
101  h2hivalue1 = (hilimit1 + model->LTRArclsqr*0.5)*temp2 -
102  sqrt(hilimit1*model->LTRArclsqr/M_PI)*temp3;
103  else
104  h2hivalue1 = 0.0;
105 
106  h2dummy1 = h2hivalue1/delta1;
107  h2relval = FABS(h2dummy1*model->LTRAchopReltol);
108  model->LTRAh2FirstCoeff = h2dummy1;
109 
110  h3lovalue1 = 0.0;
111  if (hilimit1 != 0.0) {
112  temp = 2*sqrt(hilimit1/M_PI)*temp3 - temp4*temp2;
113  h3hivalue1 = temp5*temp;
114  }
115  else
116  h3hivalue1 = 0.0;
117 
118  h3dummy1 = h3hivalue1/delta1;
119  h3relval = FABS(h3dummy1*model->LTRAchopReltol);
120  model->LTRAh3dashFirstCoeff = h3dummy1;
121 
122  /* the coefficients for the rest of the timepoints */
123 
124  for (i = auxindex; i > 0; i--) {
125 
126  delta2 = delta1; /* previous delta1 */
127  lolimit2 = lolimit1; /* previous lolimit1 */
128  hilimit2 = hilimit1; /* previous hilimit1 */
129 
130  delta1 = *(ckt->CKTtimePoints + i) - *(ckt->CKTtimePoints + i - 1);
131  lolimit1 = hilimit2;
132  hilimit1 = ckt->CKTtime - *(ckt->CKTtimePoints + i - 1);
133 
134  if (doh1) {
135  h1lovalue2 = h1lovalue1; /* previous lovalue1 */
136  h1hivalue2 = h1hivalue1; /* previous hivalue1 */
137  h1dummy2 = h1dummy1; /* previous dummy1 */
138 
139  h1lovalue1 = h1hivalue2;
140  h1hivalue1 = sqrt(4*model->LTRAcByR*hilimit1/M_PI);
141  h1dummy1 = (h1hivalue1 - h1lovalue1)/delta1;
142  *(model->LTRAh1dashCoeffs + i) = h1dummy1 - h1dummy2;
143  if (FABS(*(model->LTRAh1dashCoeffs + i)) < h1relval) doh1 = 0;
144  }
145  else
146  *(model->LTRAh1dashCoeffs + i) = 0.0;
147 
148  if (doh2 || doh3) {
149  temp = model->LTRArclsqr/(4*hilimit1);
150  temp2 = (temp >= 100.0 ? 0.0 : erfc(sqrt(temp)));
151  temp3 = exp(-temp);
152  }
153 
154  if (doh2) {
155  h2lovalue2 = h2lovalue1; /* previous lovalue1 */
156  h2hivalue2 = h2hivalue1; /* previous hivalue1 */
157  h2dummy2 = h2dummy1; /* previous dummy1 */
158 
159  h2lovalue1 = h2hivalue2;
160  if (hilimit1 != 0.0)
161  h2hivalue1 = (hilimit1 + model->LTRArclsqr*0.5)*temp2 -
162  sqrt(hilimit1*model->LTRArclsqr/M_PI)*temp3;
163  else
164  h2hivalue1 = 0.0;
165  h2dummy1 = (h2hivalue1 - h2lovalue1)/delta1;
166  *(model->LTRAh2Coeffs + i) = h2dummy1 - h2dummy2;
167  if (FABS(*(model->LTRAh2Coeffs + i)) < h2relval) doh2 = 0;
168  }
169  else
170  *(model->LTRAh2Coeffs + i) = 0.0;
171 
172  if (doh3) {
173  h3lovalue2 = h3lovalue1; /* previous lovalue1 */
174  h3hivalue2 = h3hivalue1; /* previous hivalue1 */
175  h3dummy2 = h3dummy1; /* previous dummy1 */
176 
177  h3lovalue1 = h3hivalue2;
178  if (hilimit1 != 0.0) {
179  temp = 2*sqrt(hilimit1/M_PI)*temp3 - temp4*temp2;
180  h3hivalue1 = temp5*temp;
181  }
182  else
183  h3hivalue1 = 0.0;
184  h3dummy1 = (h3hivalue1 - h3lovalue1)/delta1;
185  *(model->LTRAh3dashCoeffs + i) = h3dummy1 - h3dummy2;
186  if (FABS(*(model->LTRAh3dashCoeffs + i)) < h3relval) doh3 = 0;
187  }
188  else
189  *(model->LTRAh3dashCoeffs + i) = 0.0;
190  }
191 }
192 
193 
194 void
195 LTRArlcCoeffsSetup(ckt,InModel)
196 
197 CKTcircuit *ckt;
198 GENmodel *InModel;
199 {
200  LTRAmodel *model = (LTRAmodel*)InModel;
201  unsigned exact;
202  double lolimit1, lolimit2, hilimit1, hilimit2;
203  double delta1, delta2;
204  double h1dummy1, h1dummy2;
205  double h1lovalue1, h1lovalue2, h1hivalue1, h1hivalue2;
206  double h2dummy1, h2dummy2;
207  double h2lovalue1, h2lovalue2, h2hivalue1, h2hivalue2;
208  double h3dummy1, h3dummy2;
209  double h3lovalue1, h3lovalue2, h3hivalue1, h3hivalue2;
210  double exparg, besselarg, bessi1overxterm, bessi0term;
211  double expbetaTterm, alphasqTterm;
212  double h1relval, h2relval, h3relval;
213  int doh1 = 1, doh2 = 1, doh3 = 1;
214  int i, auxindex;
215 
216  /*
217  * we assume a piecewise linear function, and we calculate the
218  * coefficients using this assumption in the integration of the
219  * function
220  */
221 
222  if (model->LTRAtd == 0.0) {
223  auxindex = ckt->CKTtimeIndex;
224  }
225  else {
226 
227  if (ckt->CKTtime - model->LTRAtd <= 0.0) {
228  auxindex = 0;
229  }
230  else {
231  exact = 0;
232  for (i = ckt->CKTtimeIndex; i >= 0; i--) {
233  if (ckt->CKTtime - *(ckt->CKTtimePoints + i) ==
234  model->LTRAtd) {
235  exact = 1;
236  break;
237  }
238  if (ckt->CKTtime - *(ckt->CKTtimePoints + i) >
239  model->LTRAtd) break;
240  }
241 
242 #ifdef LTRADEBUG
243  if ((i < 0) || ((i == 0) && (exact == 1)))
244  printf("LTRAcoeffSetup: i <= 0: some mistake!\n");
245 #endif
246 
247  if (exact == 1) {
248  auxindex = i-1;
249  }
250  else {
251  auxindex = i;
252  }
253  }
254  }
255  /* the first coefficient */
256 
257  if (auxindex != 0) {
258  lolimit1 = model->LTRAtd;
259  hilimit1 = ckt->CKTtime - *(ckt->CKTtimePoints + auxindex);
260  delta1 = hilimit1 - lolimit1;
261 
262  h2lovalue1 = LTRArlcH2Func(model->LTRAtd,(GENmodel*)model);
263  besselarg = (hilimit1 > model->LTRAtd) ?
264  model->LTRAalpha*sqrt(hilimit1*hilimit1 -
265  model->LTRAtd*model->LTRAtd) : 0.0;
266  exparg = -model->LTRAbeta*hilimit1;
267  bessi1overxterm = bessYY(besselarg, exparg);
268  alphasqTterm = model->LTRAalpha*model->LTRAalpha*model->LTRAtd;
269  h2hivalue1 =
270  ((model->LTRAalpha == 0.0) || (hilimit1 < model->LTRAtd)) ? 0.0:
271  alphasqTterm*bessi1overxterm;
272 
273  h2dummy1 = twiceintlinfunc(lolimit1,hilimit1,lolimit1,h2lovalue1,
274  h2hivalue1,lolimit1,hilimit1)/delta1;
275  model->LTRAh2FirstCoeff = h2dummy1;
276  h2relval = FABS(model->LTRAchopReltol*h2dummy1);
277 
278  h3lovalue1 = 0.0; /* E3dash should be consistent with this */
279  bessi0term = bessZZ(besselarg, exparg);
280  expbetaTterm = exp(-model->LTRAbeta*model->LTRAtd);
281  h3hivalue1 =
282  ((hilimit1 <= model->LTRAtd) || (model->LTRAbeta == 0.0)) ? 0.0:
283  bessi0term - expbetaTterm;
284  h3dummy1 = intlinfunc(lolimit1,hilimit1,h3lovalue1,
285  h3hivalue1,lolimit1,hilimit1)/delta1;
286  model->LTRAh3dashFirstCoeff = h3dummy1;
287  h3relval = FABS(h3dummy1*model->LTRAchopReltol);
288  }
289  else {
290  model->LTRAh2FirstCoeff = model->LTRAh3dashFirstCoeff = 0.0;
291  }
292 
293  lolimit1 = 0.0;
294  hilimit1 = ckt->CKTtime - *(ckt->CKTtimePoints + ckt->CKTtimeIndex);
295  delta1 = hilimit1 - lolimit1;
296  exparg = -model->LTRAbeta*hilimit1;
297 
298  h1lovalue1 = 0.0;
299  h1hivalue1 = (model->LTRAbeta == 0.0)? hilimit1:
300  ((hilimit1 == 0.0) ? 0.0 : bessXX(-exparg)*hilimit1 - hilimit1);
301  h1dummy1 = h1hivalue1/delta1;
302  model->LTRAh1dashFirstCoeff = h1dummy1;
303  h1relval = FABS(h1dummy1*model->LTRAchopReltol);
304 
305 
306  /* the coefficients for the rest of the timepoints */
307 
308  for (i = ckt->CKTtimeIndex; i > 0; i--) {
309 
310  if (doh1 || doh2 || doh3) {
311  lolimit2 = lolimit1; /* previous lolimit1 */
312  hilimit2 = hilimit1; /* previous hilimit1 */
313  delta2 = delta1; /* previous delta1 */
314 
315  lolimit1 = hilimit2;
316  hilimit1 = ckt->CKTtime - *(ckt->CKTtimePoints + i - 1);
317  delta1 =
318  *(ckt->CKTtimePoints + i) - *(ckt->CKTtimePoints + i - 1);
319 
320  exparg = -model->LTRAbeta*hilimit1;
321  }
322 
323  if (doh1) {
324  h1lovalue2 = h1lovalue1; /* previous lovalue1 */
325  h1hivalue2 = h1hivalue1; /* previous hivalue1 */
326  h1dummy2 = h1dummy1; /* previous dummy1 */
327 
328  h1lovalue1 = h1hivalue2;
329  h1hivalue1 = (model->LTRAbeta == 0.0)? hilimit1:
330  ((hilimit1 == 0.0) ? 0.0:
331  bessXX(-exparg)*hilimit1 - hilimit1);
332  h1dummy1 = (h1hivalue1 - h1lovalue1)/delta1;
333 
334  *(model->LTRAh1dashCoeffs + i) = h1dummy1 - h1dummy2;
335  if (FABS(*(model->LTRAh1dashCoeffs + i)) <= h1relval) doh1 = 0;
336  }
337  else
338  *(model->LTRAh1dashCoeffs + i) = 0.0;
339 
340  if (i <= auxindex) {
341 
342  if (doh2 || doh3)
343  besselarg = (hilimit1 > model->LTRAtd) ?
344  model->LTRAalpha*sqrt(hilimit1*hilimit1 -
345  model->LTRAtd*model->LTRAtd) : 0.0;
346 
347  if (doh2) {
348  h2lovalue2 = h2lovalue1; /* previous lovalue1 */
349  h2hivalue2 = h2hivalue1; /* previous hivalue1 */
350  h2dummy2 = h2dummy1; /* previous dummy1 */
351 
352  h2lovalue1 = h2hivalue2;
353  bessi1overxterm = bessYY(besselarg, exparg);
354  h2hivalue1 =
355  ((model->LTRAalpha == 0.0) ||
356  (hilimit1 < model->LTRAtd)) ? 0.0 :
357  alphasqTterm*bessi1overxterm;
358  h2dummy1 = twiceintlinfunc(lolimit1,hilimit1,lolimit1,
359  h2lovalue1,h2hivalue1,lolimit1,hilimit1)/delta1;
360 
361  *(model->LTRAh2Coeffs + i) = h2dummy1 - h2dummy2 +
362  intlinfunc(lolimit2,hilimit2,
363  h2lovalue2,h2hivalue2,lolimit2,hilimit2);
364  if (FABS(*(model->LTRAh2Coeffs + i)) <= h2relval) doh2 = 0;
365  }
366  else
367  *(model->LTRAh2Coeffs + i) = 0.0;
368 
369  if (doh3) {
370  h3lovalue2 = h3lovalue1; /* previous lovalue1 */
371  h3hivalue2 = h3hivalue1; /* previous hivalue1 */
372  h3dummy2 = h3dummy1; /* previous dummy1 */
373 
374  h3lovalue1 = h3hivalue2;
375  bessi0term = bessZZ(besselarg, exparg);
376  h3hivalue1 =
377  ((hilimit1 <= model->LTRAtd) ||
378  (model->LTRAbeta == 0.0)) ? 0.0 :
379  bessi0term - expbetaTterm;
380  h3dummy1 = intlinfunc(lolimit1,hilimit1,h3lovalue1,
381  h3hivalue1,lolimit1,hilimit1)/delta1;
382 
383  *(model->LTRAh3dashCoeffs + i) = h3dummy1 - h3dummy2;
384  if (FABS(*(model->LTRAh3dashCoeffs + i)) <= h3relval)
385  doh3 = 0;
386  }
387  else
388  *(model->LTRAh3dashCoeffs + i) = 0.0;
389  }
390  }
391  model->LTRAauxIndex = auxindex;
392 }
393 
394 
395 double
396 LTRArlcH2Func(time,InModel)
397 
398 double time;
399 GENmodel *InModel;
400 {
401  LTRAmodel *model = (LTRAmodel*)InModel;
402  double besselarg, exparg, returnval;
403 
404  /*
405  * result = 0, time < T
406  * = (alpha*T*e^{-beta*time})/sqrt(t^2 - T^2) *
407  * I_1(alpha*sqrt(t^2 - T^2))
408  */
409 
410  if (model->LTRAalpha == 0.0) return(0.0);
411  if (time < model->LTRAtd) return(0.0);
412 
413  if (time != model->LTRAtd) {
414  besselarg = model->LTRAalpha*
415  sqrt(time*time - model->LTRAtd*model->LTRAtd);
416  }
417  else {
418  besselarg = 0.0;
419  }
420  exparg = -model->LTRAbeta*time;
421 
422  returnval = model->LTRAalpha*model->LTRAalpha*model->LTRAtd*
423  exp(exparg)*bessI1xOverX(besselarg);
424  return (returnval);
425 }
426 
427 
428 double
429 LTRArlcH3dashFunc(time,T,alpha,beta)
430 
431 double time,T,alpha,beta;
432 {
433  double exparg, besselarg, returnval;
434 
435  /*
436  * result = 0, time < T
437  * = alpha*e^{-beta*time}*(t/sqrt(t^2-T^2)*
438  * I_1(alpha*sqrt(t^2-T^2)) - I_0(alpha*sqrt(t^2-T^2)))
439  */
440 
441  if (alpha == 0.0) return(0.0);
442  if (time < T) return(0.0);
443 
444  exparg = - beta*time;
445  if (time != T) {
446  besselarg = alpha*sqrt(time*time - T*T);
447  }
448  else {
449  besselarg = 0.0;
450  }
451 
452  returnval = alpha*time*bessI1xOverX(besselarg) - bessI0(besselarg);
453  returnval *= alpha*exp(exparg);
454  return (returnval);
455 }
456 
457 /*
458  * LTRAstraightLineCheck - takes the co-ordinates of three points,
459  * finds the area of the triangle enclosed by these points and
460  * compares this area with the area of the quadrilateral formed by
461  * the line between the first point and the third point, the
462  * perpendiculars from the first and third points to the x-axis, and
463  * the x-axis. If within reltol, then it returns 1, else 0. The
464  * purpose of this function is to determine if three points lie
465  * acceptably close to a straight line. This area criterion is used
466  * because it is related to integrals and convolution
467  */
468 
469 int
470 LTRAstraightLineCheck(x1,y1,x2,y2,x3,y3,reltol,abstol)
471 double x1,y1,x2,y2,x3,y3,reltol,abstol;
472 
473 {
474 double TRarea, QUADarea1,QUADarea2,QUADarea3, area;
475 
476  /* this should work if y1,y2,y3 all have the same sign and x1,x2,x3
477  * are in increasing order
478  */
479 
480  QUADarea1 = (FABS(y2)+FABS(y1))*0.5*FABS(x2-x1);
481  QUADarea2 = (FABS(y3)+FABS(y2))*0.5*FABS(x3-x2);
482  QUADarea3 = (FABS(y3)+FABS(y1))*0.5*FABS(x3-x1);
483  TRarea = FABS(QUADarea3 - QUADarea1 - QUADarea2);
484  area = QUADarea1 + QUADarea2;
485  if (area*reltol + abstol > TRarea)
486  return(1);
487  return(0);
488 }
489 
490 
491 /* i is the index of the latest value,
492  * a,b,c values correspond to values at t_{i-2}, t{i-1} and t_i
493  */
494 
495 #define SECONDDERIV(i,a,b,c) (oof = (i==ckt->CKTtimeIndex+1?curtime:\
496 *(ckt->CKTtimePoints+i)),\
497 (( c - b )/(oof-*(ckt->CKTtimePoints+i-1)) -\
498 ( b - a )/(*(ckt->CKTtimePoints+i-1)-\
499 *(ckt->CKTtimePoints+i-2)))/(oof - \
500 *(ckt->CKTtimePoints+i-2)))
501 
502 /*
503  * LTRAlteCalculate - returns sum of the absolute values of the total
504  * local truncation error of the 2 equations for the LTRAline
505  */
506 
507 
508 double
509 LTRAlteCalculate(ckt,genmodel,geninstance,curtime)
510 
511 CKTcircuit *ckt;
512 GENmodel *genmodel;
513 GENinstance *geninstance;
514 double curtime;
515 {
516  LTRAmodel *model = (LTRAmodel *) genmodel;
517  LTRAinstance *instance = (LTRAinstance *) geninstance;
518  double h1dashTfirstCoeff;
519  double h2TfirstCoeff;
520  double h3dashTfirstCoeff;
521  double dashdash;
522  double oof;
523  double hilimit1, lolimit1, hivalue1, lovalue1, f1i, g1i;
524  double eq1LTE = 0.0, eq2LTE = 0.0;
525  int auxindex, tdover, i, exact;
526 
527  switch(model->LTRAspecialCase) {
528 
529  case LTRA_MOD_LC:
530  case LTRA_MOD_RG:
531  return(0.0);
532 
533  case LTRA_MOD_RLC:
534 
535  if (curtime > model->LTRAtd) {
536  tdover = 1;
537 
538  exact = 0;
539  for (i = ckt->CKTtimeIndex ; i>= 0; i--) {
540  if (curtime - *(ckt->CKTtimePoints + i) ==
541  model->LTRAtd) {
542  exact = 1;
543  break;
544  }
545  if (curtime - *(ckt->CKTtimePoints + i)
546  > model->LTRAtd)
547  break;
548  }
549 
550 #ifdef LTRADEBUG
551  if ((i < 0) || ((i==0) && (exact==1)))
552  printf("LTRAlteCalculate: i <= 0: some mistake!\n");
553 #endif
554 
555  if (exact == 1) {
556  auxindex = i-1;
557  }
558  else {
559  auxindex = i;
560  }
561 
562  }
563  else {
564  tdover = 0;
565  }
566 
567  hilimit1 = curtime - *(ckt->CKTtimePoints + ckt->CKTtimeIndex);
568  lolimit1 = 0.0;
569  hivalue1 = ltra_rlcH1dashTwiceIntFunc(hilimit1,model->LTRAbeta);
570  lovalue1 = 0.0;
571 
572  f1i = hivalue1;
573  g1i = intlinfunc(lolimit1,hilimit1,lovalue1,hivalue1,
574  lolimit1,hilimit1);
575  h1dashTfirstCoeff = 0.5 * f1i *
576  (curtime - *(ckt->CKTtimePoints+ckt->CKTtimeIndex)) - g1i;
577 
578  if (tdover) {
579  hilimit1 = curtime - *(ckt->CKTtimePoints + auxindex);
580  lolimit1 = *(ckt->CKTtimePoints + ckt->CKTtimeIndex) -
581  *(ckt->CKTtimePoints + auxindex);
582  lolimit1 = MAX(model->LTRAtd,lolimit1);
583 
584  /* are the following really doing the operations in the
585  write-up? */
586  hivalue1 = LTRArlcH2Func(hilimit1,(GENmodel*)model);
587  lovalue1 = LTRArlcH2Func(lolimit1,(GENmodel*)model);
588  f1i = twiceintlinfunc(lolimit1,hilimit1,lolimit1,lovalue1,
589  hivalue1,lolimit1,hilimit1);
590  g1i = thriceintlinfunc(lolimit1,hilimit1,lolimit1,lolimit1,
591  lovalue1,hivalue1,lolimit1,hilimit1);
592  h2TfirstCoeff = 0.5*f1i*(curtime-model->LTRAtd -
593  *(ckt->CKTtimePoints+auxindex)) - g1i;
594 
595  hivalue1 = ltra_rlcH3dashIntFunc(hilimit1,model->LTRAtd,
596  model->LTRAbeta);
597  lovalue1 = ltra_rlcH3dashIntFunc(lolimit1,model->LTRAtd,
598  model->LTRAbeta);
599  f1i = intlinfunc(lolimit1,hilimit1,lovalue1,hivalue1,
600  lolimit1,hilimit1);
601  g1i = twiceintlinfunc(lolimit1,hilimit1,lolimit1,lovalue1,
602  hivalue1,lolimit1,hilimit1);
603  h3dashTfirstCoeff = 0.5*f1i*(curtime - model->LTRAtd -
604  *(ckt->CKTtimePoints+auxindex)) - g1i;
605  }
606 
607 
608  /* LTEs for convolution with v1 */
609  /* get divided differences for v1 (2nd derivative estimates) */
610 
611  /*
612  * no need to subtract operating point values because
613  * taking differences anyway
614  */
615 
616  dashdash = SECONDDERIV(ckt->CKTtimeIndex+1,
617  *(instance->LTRAv1+ckt->CKTtimeIndex-1),
618  *(instance->LTRAv1+ckt->CKTtimeIndex),
619  *(ckt->CKTrhsOld + instance->LTRAposNode1) -
620  *(ckt->CKTrhsOld + instance->LTRAnegNode1));
621  eq1LTE += model->LTRAadmit*FABS(dashdash *
622  h1dashTfirstCoeff);
623 
624  /* not bothering to interpolate since everything is approximate
625  anyway */
626 
627  if (tdover) {
628 
629  dashdash = SECONDDERIV(auxindex+1,
630  *(instance->LTRAv1 + auxindex - 1),
631  *(instance->LTRAv1 + auxindex),
632  *(instance->LTRAv1 + auxindex + 1)) ;
633 
634  eq2LTE += model->LTRAadmit*FABS(dashdash *
635  h3dashTfirstCoeff);
636  }
637  /* end LTEs for convolution with v1 */
638 
639  /* LTEs for convolution with v2 */
640  /* get divided differences for v2 (2nd derivative estimates) */
641 
642  dashdash = SECONDDERIV(ckt->CKTtimeIndex+1,
643  *(instance->LTRAv2+ckt->CKTtimeIndex-1),
644  *(instance->LTRAv2+ckt->CKTtimeIndex),
645  *(ckt->CKTrhsOld + instance->LTRAposNode2) -
646  *(ckt->CKTrhsOld + instance->LTRAnegNode2));
647 
648  eq2LTE += model->LTRAadmit*FABS(dashdash *
649  h1dashTfirstCoeff);
650 
651 
652  if (tdover) {
653  dashdash = SECONDDERIV(auxindex+1,
654  *(instance->LTRAv2 + auxindex - 1),
655  *(instance->LTRAv2 + auxindex),
656  *(instance->LTRAv2 + auxindex + 1)) ;
657 
658  eq1LTE += model->LTRAadmit*FABS(dashdash *
659  h3dashTfirstCoeff);
660  }
661 
662  /* end LTEs for convolution with v2 */
663 
664  /* LTE for convolution with i1 */
665  /* get divided differences for i1 (2nd derivative estimates) */
666 
667  if (tdover) {
668  dashdash = SECONDDERIV(auxindex+1,
669  *(instance->LTRAi1 + auxindex - 1),
670  *(instance->LTRAi1 + auxindex),
671  *(instance->LTRAi1 + auxindex + 1)) ;
672 
673  eq2LTE += FABS(dashdash * h2TfirstCoeff);
674  }
675  /* end LTE for convolution with i1 */
676 
677  /* LTE for convolution with i2 */
678  /* get divided differences for i2 (2nd derivative estimates) */
679 
680  if (tdover) {
681  dashdash = SECONDDERIV(auxindex+1,
682  *(instance->LTRAi2 + auxindex - 1),
683  *(instance->LTRAi2 + auxindex),
684  *(instance->LTRAi2 + auxindex + 1)) ;
685 
686  eq1LTE += FABS(dashdash * h2TfirstCoeff);
687  }
688  /* end LTE for convolution with i1 */
689 
690  break;
691 
692  case LTRA_MOD_RC:
693 
694  hilimit1 = curtime - *(ckt->CKTtimePoints + ckt->CKTtimeIndex);
695  lolimit1 = 0.0;
696 
697  hivalue1 = ltra_rcH1dashTwiceIntFunc(hilimit1,model->LTRAcByR);
698  lovalue1 = 0.0;
699 
700  f1i = hivalue1;
701  g1i = intlinfunc(lolimit1,hilimit1,lovalue1,hivalue1,lolimit1,
702  hilimit1);
703 /*
704  h1dashTfirstCoeff = 0.5*f1i*(curtime -
705  *(ckt->CKTtimePoints+ckt->CKTtimeIndex)) - g1i;
706 */
707  h2TfirstCoeff = 0.5*f1i*(curtime -
708  *(ckt->CKTtimePoints+ckt->CKTtimeIndex)) - g1i;
709 
710  hivalue1 = ltra_rcH2TwiceIntFunc(hilimit1,model->LTRArclsqr);
711  lovalue1 = 0.0;
712 
713  f1i = hivalue1;
714  g1i = intlinfunc(lolimit1,hilimit1,lovalue1,hivalue1,lolimit1,
715  hilimit1);
716  h1dashTfirstCoeff = 0.5*f1i*(curtime -
717  *(ckt->CKTtimePoints+ckt->CKTtimeIndex)) - g1i;
718 
719  hivalue1 = ltra_rcH2TwiceIntFunc(hilimit1,model->LTRArclsqr);
720  lovalue1 = 0.0;
721 
722  f1i = hivalue1;
723  g1i = intlinfunc(lolimit1,hilimit1,lovalue1,
724  hivalue1,lolimit1,hilimit1);
725 /*
726  h1dashTfirstCoeff = 0.5*f1i*(curtime -
727  *(ckt->CKTtimePoints+ckt->CKTtimeIndex)) - g1i;
728 */
729  h3dashTfirstCoeff = 0.5*f1i*(curtime -
730  *(ckt->CKTtimePoints+ckt->CKTtimeIndex)) - g1i;
731 
732 
733  /* LTEs for convolution with v1 */
734  /* get divided differences for v1 (2nd derivative estimates) */
735 
736  /*
737  * no need to subtract operating point values because
738  * taking differences anyway
739  */
740 
741  dashdash = SECONDDERIV(ckt->CKTtimeIndex+1,
742  *(instance->LTRAv1+ckt->CKTtimeIndex-1),
743  *(instance->LTRAv1+ckt->CKTtimeIndex),
744  *(ckt->CKTrhsOld + instance->LTRAposNode1) -
745  *(ckt->CKTrhsOld + instance->LTRAnegNode1));
746  eq1LTE += FABS(dashdash * h1dashTfirstCoeff);
747  eq2LTE += FABS(dashdash * h3dashTfirstCoeff);
748 
749  /* end LTEs for convolution with v1 */
750 
751  /* LTEs for convolution with v2 */
752  /* get divided differences for v2 (2nd derivative estimates) */
753 
754  dashdash = SECONDDERIV(ckt->CKTtimeIndex+1,
755  *(instance->LTRAv2+ckt->CKTtimeIndex-1),
756  *(instance->LTRAv2+ckt->CKTtimeIndex),
757  *(ckt->CKTrhsOld + instance->LTRAposNode2) -
758  *(ckt->CKTrhsOld + instance->LTRAnegNode2));
759 
760  eq2LTE += FABS(dashdash * h1dashTfirstCoeff);
761  eq1LTE += FABS(dashdash * h3dashTfirstCoeff);
762 
763  /* end LTEs for convolution with v2 */
764 
765  /* LTE for convolution with i1 */
766  /* get divided differences for i1 (2nd derivative estimates) */
767 
768  dashdash = SECONDDERIV(ckt->CKTtimeIndex+1,
769  *(instance->LTRAi1 + ckt->CKTtimeIndex - 1),
770  *(instance->LTRAi1 + ckt->CKTtimeIndex),
771  *(ckt->CKTrhsOld + instance->LTRAbrEq1));
772 
773  eq2LTE += FABS(dashdash * h2TfirstCoeff);
774 
775  /* end LTE for convolution with i1 */
776 
777  /* LTE for convolution with i2 */
778  /* get divided differences for i2 (2nd derivative estimates) */
779 
780  dashdash = SECONDDERIV(ckt->CKTtimeIndex+1,
781  *(instance->LTRAi2 + ckt->CKTtimeIndex - 1),
782  *(instance->LTRAi2 + ckt->CKTtimeIndex),
783  *(ckt->CKTrhsOld + instance->LTRAbrEq2));
784 
785  eq1LTE += FABS(dashdash * h2TfirstCoeff);
786 
787  /* end LTE for convolution with i1 */
788 
789  break;
790 
791  default:
792  return (1);
793  }
794 
795 #ifdef LTRADEBUG
796  fprintf(stdout,"%s: LTE/input for Eq1 at time %g is: %g\n",
797  instance->LTRAname, curtime, eq1LTE/instance->LTRAinput1);
798  fprintf(stdout,"%s: LTE/input for Eq2 at time %g is: %g\n",
799  instance->LTRAname, curtime, eq2LTE/instance->LTRAinput1);
800  fprintf(stdout,"\n");
801 #endif
802 
803  return (FABS(eq1LTE) + FABS(eq2LTE));
804 }
805 
806 
807 
808 /* intlinfunc returns int lolimit-hilimit h(tau) dtau, where
809  * h(tau) is assumed to be linear, with values lovalue and hivalue
810  * tau = t1 and t2 respectively
811  * this is used only locally
812  */
813 
814 static double
815 intlinfunc(lolimit,hilimit,lovalue,hivalue,t1,t2)
816 
817 double lolimit, hilimit, lovalue, hivalue, t1,t2;
818 {
819  double width, m;
820 
821  width = t2 - t1;
822  if (width == 0.0) return(0.0);
823  m = (hivalue - lovalue)/width;
824 
825  return ((hilimit-lolimit)*lovalue + 0.5*m*((hilimit-t1)*(hilimit-t1)
826  - (lolimit - t1)*(lolimit - t1)));
827 }
828 
829 
830 /* twiceintlinfunc returns int lolimit-hilimit int otherlolimit-tau
831  * h(tau') d tau' d tau , where
832  * h(tau') is assumed to be linear, with values lovalue and hivalue
833  * tau = t1 and t2 respectively
834  * this is used only locally
835  */
836 
837 static double
838 twiceintlinfunc(lolimit,hilimit,otherlolimit,lovalue,hivalue,t1,t2)
839 
840 double lolimit, hilimit, lovalue, hivalue, t1,t2, otherlolimit;
841 {
842  double width, m, dummy;
843  double temp1, temp2, temp3;
844 
845  width = t2 - t1;
846  if (width == 0.0) return(0.0);
847  m = (hivalue - lovalue)/width;
848 
849  temp1 = hilimit - t1;
850  temp2 = lolimit - t1;
851  temp3 = otherlolimit - t1;
852  dummy = lovalue*((hilimit - otherlolimit)*(hilimit - otherlolimit) -
853  (lolimit - otherlolimit)*(lolimit - otherlolimit));
854  dummy += m*((temp1*temp1*temp1 - temp2*temp2*temp2)/3.0 -
855  temp3*temp3*(hilimit - lolimit));
856  return(dummy*0.5);
857 }
858 
859 
860 /* thriceintlinfunc returns int lolimit-hilimit int secondlolimit-tau
861  * int thirdlolimit-tau' h(tau'') d tau'' d tau' d tau , where
862  * h(tau'') is assumed to be linear, with values lovalue and hivalue
863  * tau = t1 and t2 respectively
864  * this is used only locally
865  */
866 
867 static double
868 thriceintlinfunc(lolimit,hilimit,secondlolimit,thirdlolimit,lovalue,
869  hivalue,t1,t2)
870 
871 double lolimit, hilimit, lovalue, hivalue, t1,t2, secondlolimit,
872  thirdlolimit;
873 {
874  double width, m, dummy;
875  double temp1, temp2, temp3, temp4;
876  double temp5, temp6, temp7, temp8, temp9, temp10;
877 
878  width = t2 - t1;
879  if (width == 0.0) return(0.0);
880  m = (hivalue - lovalue)/width;
881 
882  temp1 = hilimit - t1;
883  temp2 = lolimit - t1;
884  temp3 = secondlolimit - t1;
885  temp4 = thirdlolimit - t1;
886  temp5 = hilimit - thirdlolimit;
887  temp6 = lolimit - thirdlolimit;
888  temp7 = secondlolimit - thirdlolimit;
889  temp8 = hilimit - lolimit;
890  temp9 = hilimit - secondlolimit;
891  temp10 = lolimit - secondlolimit;
892  dummy = lovalue*((temp5*temp5*temp5 - temp6*temp6*temp6)/3 -
893  temp7*temp5*temp8);
894  dummy += m*(((temp1*temp1*temp1*temp1 - temp2*temp2*temp2*temp2)*0.25 -
895  temp3*temp3*temp3*temp8)/3 - temp4*temp4*0.5*(temp9*temp9 -
896  temp10*temp10));
897  return(dummy*0.5);
898 }
899 
900 
901 /*
902  *
903  * These are from the book Numerical Recipes in C
904  *
905  */
906 
907 static double
909 
910 double x;
911 {
912  double ax,ans;
913  double y;
914 
915  if ((ax = fabs(x)) < 3.75) {
916  y = x/3.75;
917  y *= y;
918  ans = 1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492
919  +y*(0.2659732+y*(0.360768e-1+y*0.45813e-2)))));
920  }
921  else {
922  y = 3.75/ax;
923  ans = (exp(ax)/sqrt(ax))*(0.39894228+y*(0.1328592e-1
924  +y*(0.225319e-2+y*(-0.157565e-2+y*(0.916281e-2
925  +y*(-0.2057706e-1+y*(0.2635537e-1+y*(-0.1647633e-1
926  +y*0.392377e-2))))))));
927  }
928  return (ans);
929 }
930 
931 
932 /*
933 static double
934 bessI1(x)
935 
936 double x;
937 {
938  double ax,ans;
939  double y;
940 
941  if ((ax = fabs(x)) < 3.75) {
942  y = x/3.75;
943  y *= y;
944  ans = ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934
945  +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3))))));
946  }
947  else {
948  y = 3.75/ax;
949  ans = 0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1
950  -y*0.420059e-2));
951  ans = 0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2
952  +y*(0.163801e-2+y*(-0.1031555e-1+y*ans))));
953  ans *= (exp(ax)/sqrt(ax));
954  }
955  return (x < 0.0 ? -ans : ans);
956 }
957 */
958 
959 
960 // return (bessI1(x) + bessI0(x))*exp(-x) assuming x > 0
961 //
962 static double
963 bessXX(double x)
964 {
965  double ax = fabs(x);
966  if (ax < 3.75) {
967  double y = x/3.75;
968  y *= y;
969  double ans1 = 1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492
970  +y*(0.2659732+y*(0.360768e-1+y*0.45813e-2)))));
971  double ans2 = ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934
972  +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3))))));
973  if (x > 0)
974  ans1 += ans2;
975  else
976  ans1 -= ans2;
977  return (ans1 * exp(-x));
978  }
979  else {
980  double y = 3.75/ax;
981  double ans1 = (0.39894228+y*(0.1328592e-1
982  +y*(0.225319e-2+y*(-0.157565e-2+y*(0.916281e-2
983  +y*(-0.2057706e-1+y*(0.2635537e-1+y*(-0.1647633e-1
984  +y*0.392377e-2))))))));
985  double ans2 = 0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1
986  -y*0.420059e-2));
987  ans2 = 0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2
988  +y*(0.163801e-2+y*(-0.1031555e-1+y*ans2))));
989  if (x > 0)
990  ans1 += ans2;
991  else
992  ans1 -= ans2;
993  ans1 /= sqrt(ax);
994  return (ans1);
995  }
996 }
997 
998 
999 static double
1001 
1002 double x;
1003 {
1004  double ax,ans;
1005  double y;
1006 
1007  if ((ax = fabs(x)) < 3.75) {
1008  y = x/3.75;
1009  y *= y;
1010  ans = 0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934
1011  +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3)))));
1012  }
1013  else {
1014  y = 3.75/ax;
1015  ans = 0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1
1016  -y*0.420059e-2));
1017  ans = 0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2
1018  +y*(0.163801e-2+y*(-0.1031555e-1+y*ans))));
1019  ans *= (exp(ax)/(ax*sqrt(ax)));
1020  }
1021  return (ans);
1022 }
1023 
1024 
1025 static double
1026 bessYY(double x, double z)
1027 {
1028  double ans, ax = fabs(x);
1029  if (ax < 3.75) {
1030  double y = x/3.75;
1031  y *= y;
1032  ans = 0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934
1033  +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3)))));
1034  ans *= exp(z);
1035  }
1036  else {
1037  double y = 3.75/ax;
1038  ans = 0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1
1039  -y*0.420059e-2));
1040  ans = 0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2
1041  +y*(0.163801e-2+y*(-0.1031555e-1+y*ans))));
1042  ans *= (exp(ax + z)/(ax*sqrt(ax)));
1043  }
1044  return (ans);
1045 }
1046 
1047 
1048 static double
1049 bessZZ(double x, double z)
1050 {
1051  double ans, ax = fabs(x);
1052  if (ax < 3.75) {
1053  double y = x/3.75;
1054  y *= y;
1055  ans = 1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492
1056  +y*(0.2659732+y*(0.360768e-1+y*0.45813e-2)))));
1057  ans *= exp(z);
1058  }
1059  else {
1060  double y = 3.75/ax;
1061  ans = (exp(ax + z)/sqrt(ax))*(0.39894228+y*(0.1328592e-1
1062  +y*(0.225319e-2+y*(-0.157565e-2+y*(0.916281e-2
1063  +y*(-0.2057706e-1+y*(0.2635537e-1+y*(-0.1647633e-1
1064  +y*0.392377e-2))))))));
1065  }
1066  return (ans);
1067 }
1068 
1069 
1070 /* ltra_rlcH1dashTwiceIntFunc - twice repeated integral of h1dash for the
1071  * special case of G = 0
1072  */
1073 
1074 static double
1076 
1077 double time,beta;
1078 {
1079  double arg, returnval;
1080 
1081  /* result = time * e^{- beta*time} * {I_0(beta*time) +
1082  * I_1(beta*time)} - time
1083  */
1084 
1085  if (beta == 0.0) return (time);
1086  arg = beta*time;
1087  if (arg == 0.0) return (0.0);
1088 
1089  returnval = (bessXX(arg)*time - time);
1090  return (returnval);
1091 }
1092 
1093 
1094 /* ltra_rlcH3dashIntFunc - twice repeated integral of h1dash for the
1095  * special case of G = 0
1096  */
1097 
1098 static double
1100 
1101 double time, T, beta;
1102 {
1103  double exparg, besselarg;
1104  double returnval;
1105 
1106  if (time <= T) return(0.0);
1107  if (beta == 0.0) return(0.0);
1108  exparg = -beta*time;
1109  besselarg = beta*sqrt(time*time - T*T);
1110  returnval = (bessZZ(besselarg, exparg) - exp(-beta*T));
1111  return (returnval);
1112 }
1113 
1114 
1115 static double
1117 
1118 double time, cbyr;
1119 {
1120  return (sqrt(4*cbyr*time/M_PI));
1121 }
1122 
1123 
1124 static double
1126 
1127 double time, rclsqr;
1128 {
1129  double temp;
1130 
1131  if (time != 0.0) {
1132  temp = rclsqr/(4*time);
1133  return ((time + rclsqr*0.5)*erfc(sqrt(temp)) -
1134  sqrt(time*rclsqr/M_PI)*exp(-temp));
1135  }
1136  return(0.0);
1137 }
static double bessI0()
void LTRArcCoeffsSetup(CKTcircuit *ckt, GENmodel *InModel)
Definition: ltramisc.c:60
static double intlinfunc()
static double bessI1xOverX()
static double ltra_rlcH1dashTwiceIntFunc()
#define MAX(a, b)
Definition: spdefs.h:135
double LTRAalpha
Definition: ltradefs.h:114
static double bessYY()
static void dummy()
Definition: mfbcursr.c:550
double LTRAchopReltol
Definition: ltradefs.h:129
static double e
Definition: vectors.c:17
#define LTRA_MOD_RG
Definition: ltradefs.h:163
int LTRAnegNode1
Definition: ltradefs.h:26
double LTRAh3dashFirstCoeff
Definition: ltradefs.h:98
double LTRAinput1
Definition: ltradefs.h:31
double LTRAh2FirstCoeff
Definition: ltradefs.h:96
static double ltra_rcH1dashTwiceIntFunc()
FILE * m
Definition: proc2mod.c:47
static double thriceintlinfunc()
#define LTRA_MOD_LC
Definition: ltradefs.h:164
static double bessI1()
static double ltra_rcH2TwiceIntFunc()
double * LTRAi2
Definition: ltradefs.h:42
#define M_PI
Definition: ltramisc.c:14
void LTRArlcCoeffsSetup(CKTcircuit *ckt, GENmodel *InModel)
Definition: ltramisc.c:195
double LTRArlcH3dashFunc(double time, double T, double alpha, double beta)
Definition: ltramisc.c:429
double LTRArlcH2Func(double time, GENmodel *InModel)
Definition: ltramisc.c:396
IFuid LTRAname
Definition: ltradefs.h:23
double * LTRAv2
Definition: ltradefs.h:41
int LTRAbrEq1
Definition: ltradefs.h:29
double * LTRAh2Coeffs
Definition: ltradefs.h:102
int LTRAstraightLineCheck(double x1, double y1, double x2, double y2, double x3, double y3, double reltol, double abstol)
Definition: ltramisc.c:470
double LTRAcByR
Definition: ltradefs.h:117
int LTRAposNode1
Definition: ltradefs.h:25
double * LTRAi1
Definition: ltradefs.h:40
double erfc()
static char model[32]
Definition: subckt.c:76
double LTRAbeta
Definition: ltradefs.h:115
#define FABS(a)
Definition: util.h:41
int LTRAnegNode2
Definition: ltradefs.h:28
double LTRAlteCalculate(CKTcircuit *ckt, GENmodel *genmodel, GENinstance *geninstance, double curtime)
Definition: ltramisc.c:509
double LTRArclsqr
Definition: ltradefs.h:118
double * LTRAh3dashCoeffs
Definition: ltradefs.h:103
double LTRAtd
Definition: ltradefs.h:111
static double ltra_rlcH3dashIntFunc()
int LTRAauxIndex
Definition: ltradefs.h:127
double LTRAadmit
Definition: ltradefs.h:113
#define LTRA_MOD_RLC
Definition: ltradefs.h:161
int LTRAbrEq2
Definition: ltradefs.h:30
static double twiceintlinfunc()
double * LTRAh1dashCoeffs
Definition: ltradefs.h:101
static double bessZZ()
int LTRAposNode2
Definition: ltradefs.h:27
static double bessXX()
#define LTRA_MOD_RC
Definition: ltradefs.h:162
double * LTRAv1
Definition: ltradefs.h:39
double LTRAh1dashFirstCoeff
Definition: ltradefs.h:94
#define SECONDDERIV(i, a, b, c)
Definition: ltramisc.c:495
int LTRAspecialCase
Definition: ltradefs.h:158