CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Helmholtz.h
Go to the documentation of this file.
1 #ifndef HELMHOLTZ_H
2 #define HELMHOLTZ_H
3 
4 #include <iostream>
5 #include <vector>
6 #include "math.h"
7 #include "CoolPropTools.h"
8 #include "CPExceptions.h"
9 #include "rapidjson_CoolProp.h"
10 
11 #ifdef __ISWINDOWS__
12  #define _USE_MATH_DEFINES
13  #include "float.h"
14 #else
15  #ifndef DBL_EPSILON
16  #include <limits>
17  #define DBL_EPSILON std::numeric_limits<double>::epsilon()
18  #endif
19 #endif
20 
21 
22 
24 class phi_BC{
25 public:
26  phi_BC(){};
27  virtual ~phi_BC(){};
28  // Term and its derivatives
32  virtual double base(double tau,double delta) = 0;
36  virtual double dTau(double tau,double delta) = 0;
40  virtual double dTau2(double tau, double delta) = 0;
44  virtual double dDelta_dTau(double tau, double delta) = 0;
48  virtual double dDelta(double tau, double delta) = 0;
52  virtual double dDelta2(double tau, double delta) = 0;
56  virtual double dDelta2_dTau(double tau, double delta) = 0;
60  virtual double dDelta_dTau2(double tau, double delta) = 0;
64  virtual double dTau3(double tau, double delta) = 0;
68  virtual double dDelta3(double tau, double delta) = 0;
69 
70  virtual void to_json(rapidjson::Value &el, rapidjson::Document &doc) = 0;
71 };
72 
76 void check_derivatives(phi_BC * phi, double tau, double delta, double ddelta = 1e-10, double dtau = 1e-10);
77 
91 class phir_power : public phi_BC{
92 
93 private:
94 
95 public:
96  unsigned int iStart,iEnd;
97  std::vector<double> n,
98  d,
99  t,
100  l //< The powers for delta in the exp terms
101  ;
102  // Default Constructor
104  // Constructors
105  phir_power(std::vector<double>,std::vector<double>,std::vector<double>,int,int);
106  phir_power(std::vector<double>,std::vector<double>,std::vector<double>,std::vector<double>,int,int);
107  // Add a dummy value at the end of the function since compiler sees std::vector<double> and double[] as being the same type
108  phir_power(const double[],const double[],const double[],int,int,int);
109  phir_power(double[], double[], double[],int,int,int);
110  phir_power(const double[], const double[], const double[], const double[],int,int,int);
111  phir_power(double[],double[],double[],double[],int,int,int);
112  //std::string to_json();
113 
115  void cache();
116 
119 
121 
122  double base(double tau, double delta) throw();
123  double dDelta(double tau, double delta) throw();
124  double dTau(double tau, double delta) throw();
125 
126  double dDelta2(double tau, double delta) throw();
127  double dDelta_dTau(double tau, double delta) throw();
128  double dTau2(double tau, double delta) throw();
129 
130  double dDelta3(double tau, double delta) throw();
131  double dDelta2_dTau(double tau, double delta) throw();
132  double dDelta_dTau2(double tau, double delta) throw();
133  double dTau3(double tau, double delta) throw();
134 
136  std::vector<double> dDeltaV(std::vector<double> tau, std::vector<double> delta) throw();
137  std::vector<double> dDelta2V(std::vector<double> tau, std::vector<double> delta) throw();
138  std::vector<double> dTau2V(std::vector<double> tau, std::vector<double> delta) throw();
139  std::vector<double> dDelta_dTauV(std::vector<double> tau, std::vector<double> delta) throw();
140 
142  double A(double log_tau, double log_delta, double delta, int i) throw();
143  double dA_dDelta(double log_tau, double log_delta, double delta, int i) throw();
144  double dA_dTau(double log_tau, double log_delta, double delta, int i) throw();
145  double d2A_dTau2(double log_tau, double log_delta, double delta, int i) throw();
146  double d2A_dDelta2(double log_tau, double log_delta, double delta, int i) throw();
147  double d2A_dDelta_dTau(double log_tau, double log_delta, double delta, int i) throw();
148 };
149 
150 
159 class phir_exponential : public phi_BC{
160 private:
161  std::vector<double> n,
162  d,
163  t,
164  l,
165  g;
166  unsigned int iStart,iEnd;
167 public:
168  // Constructors
169  phir_exponential(std::vector<double>,std::vector<double>,std::vector<double>,std::vector<double>,std::vector<double>,int,int);
170  phir_exponential(const double[], const double[], const double[], const double[],const double[],int,int,int);
171  phir_exponential(double[],double[],double[],double[],double[],int,int,int);
172 
175 
177 
178  double base(double tau, double delta) throw();
179  double dDelta(double tau, double delta) throw();
180  double dTau(double tau, double delta) throw();
181 
182  double dDelta2(double tau, double delta) throw();
183  double dDelta_dTau(double tau, double delta) throw();
184  double dTau2(double tau, double delta) throw();
185 
186  double dDelta3(double tau, double delta) throw();
187  double dDelta2_dTau(double tau, double delta) throw();
188  double dDelta_dTau2(double tau, double delta) throw();
189  double dTau3(double tau, double delta) throw();
190 };
191 
200 class phir_gaussian : public phi_BC{
201 private:
202  std::vector<double> n,d,t,alpha,epsilon,beta,gamma;
203  unsigned int iStart,iEnd;
204 public:
205  // Default Constructor
207  // Constructors
208  phir_gaussian(std::vector<double> a_in,
209  std::vector<double> d_in,
210  std::vector<double> t_in,
211  std::vector<double> alpha_in,
212  std::vector<double> epsilon_in,
213  std::vector<double> beta_in,
214  std::vector<double> gamma_in,
215  unsigned int iStart_in, unsigned int iEnd_in);
216  phir_gaussian(double a_in[],
217  double d_in[],
218  double t_in[],
219  double alpha_in[],
220  double epsilon_in[],
221  double beta_in[],
222  double gamma_in[],
223  unsigned int iStart_in, unsigned int iEnd_in, unsigned int N);
224  phir_gaussian(const double a_in[],
225  const double d_in[],
226  const double t_in[],
227  const double alpha_in[],
228  const double epsilon_in[],
229  const double beta_in[],
230  const double gamma_in[],
231  unsigned int iStart_in, unsigned int iEnd_in, unsigned int N);
232 
233  // Destructor
235 
237 
238  // Term and its derivatives
239  double base(double tau, double delta) throw();
240  double dDelta(double tau, double delta) throw();
241  double dTau(double tau, double delta) throw();
242 
243  double dDelta2(double tau, double delta) throw();
244  double dDelta_dTau(double tau, double delta) throw();
245  double dTau2(double tau, double delta) throw();
246 
247  double dDelta3(double tau, double delta) throw();
248  double dDelta2_dTau(double tau, double delta) throw();
249  double dDelta_dTau2(double tau, double delta) throw();
250  double dTau3(double tau, double delta) throw();
251 
252 };
253 
262 private:
263  std::vector<double> n,d,t,eta,epsilon,beta,gamma;
264  unsigned int iStart,iEnd;
265 public:
266  // Default Constructor
268  // Constructors
269  phir_GERG2008_gaussian(std::vector<double> a_in,
270  std::vector<double> d_in,
271  std::vector<double> t_in,
272  std::vector<double> eta_in,
273  std::vector<double> epsilon_in,
274  std::vector<double> beta_in,
275  std::vector<double> gamma_in,
276  unsigned int iStart_in,
277  unsigned int iEnd_in);
278  phir_GERG2008_gaussian(double a_in[],
279  double d_in[],
280  double t_in[],
281  double eta_in[],
282  double epsilon_in[],
283  double beta_in[],
284  double gamma_in[],
285  unsigned int iStart_in,
286  unsigned int iEnd_in,
287  unsigned int N);
288  // Destructor
290 
292 
293  // Term and its derivatives
294  double base(double tau, double delta);
295  double dDelta(double tau, double delta);
296  double dTau(double tau, double delta);
297 
298  double dDelta2(double tau, double delta);
299  double dDelta_dTau(double tau, double delta);
300  double dTau2(double tau, double delta);
301 
302  double dDelta3(double tau, double delta){throw ValueError();};
303  double dDelta2_dTau(double tau, double delta){throw ValueError();};
304  double dDelta_dTau2(double tau, double delta){throw ValueError();};
305  double dTau3(double tau, double delta){throw ValueError();};
306 };
307 
314 class phir_critical : public phi_BC{
315 
316 private:
317  std::vector<double> n,d,t,a,b,A,B,C,D,beta;
318  int iStart,iEnd;
319 public:
320  // Constructors
321  phir_critical(std::vector<double> n_in, std::vector<double> d_in, std::vector<double> t_in,
322  std::vector<double> a_in, std::vector<double> b_in, std::vector<double> beta_in,
323  std::vector<double> A_in, std::vector<double> B_in, std::vector<double> C_in,
324  std::vector<double> D_in, int iStart_in, int iEnd_in);
325 
326  phir_critical(double n[], double d[], double t[],
327  double a[], double b[], double beta[],
328  double A[], double B[], double C[],
329  double D[], int iStart, int iEnd, int N);
330 
332 
333  //Destructor
335 
336  // Term and its derivatives
337  double base(double tau, double delta) throw();
338  double dDelta(double tau, double delta) throw();
339  double dTau(double tau, double delta) throw();
340 
341  double dDelta2(double tau, double delta) throw();
342  double dDelta_dTau(double tau, double delta) throw();
343  double dTau2(double tau, double delta) throw();
344 
345  double dDelta3(double tau, double delta) throw();
346  double dDelta2_dTau(double tau, double delta) throw();
347  double dDelta_dTau2(double tau, double delta) throw();
348  double dTau3(double tau, double delta) throw();
349 };
350 
361 class phir_Lemmon2005 : public phi_BC{
362  /*
363  Terms are of the form
364  n * delta ^d * tau^t if l == 0 and m == 0
365  n * delta ^d * tau^t * exp(-delta^l) if l != 0 and m = 0
366  n * delta ^d * tau^t * exp(-delta^l) * exp(-tau^m) if l != 0 and m != 0
367  Constructor must be called with std::vector instances of double type
368  */
369 private:
370  std::vector<double> n,
371  d,
372  t,
373  l,
374  m;
375  unsigned int iStart,iEnd;
376 public:
377  // Constructors
378  phir_Lemmon2005(std::vector<double>,std::vector<double>,std::vector<double>,std::vector<double>,std::vector<double>,int,int);
379  // Add a dummy value at the end of the function since compiler sees std::vector<double> and double[] as being the same type
380  phir_Lemmon2005(const double[], const double[], const double[], const double[],const double[],int,int,int);
381  phir_Lemmon2005(double[],double[],double[],double[],double[],int,int,int);
382 
385 
387 
388  double base(double tau, double delta) throw();
389  double dDelta(double tau, double delta) throw();
390  double dTau(double tau, double delta) throw();
391 
392  double dDelta2(double tau, double delta) throw();
393  double dDelta_dTau(double tau, double delta) throw();
394  double dTau2(double tau, double delta) throw();
395 
396  double dDelta3(double tau, double delta) throw();
397  double dDelta2_dTau(double tau, double delta) throw();
398  double dDelta_dTau2(double tau, double delta) throw();
399  double dTau3(double tau, double delta) throw();
400 };
401 
403 
404 protected:
406 public:
407  // Constructor
409 
410  //Destructor
412 
414 
415  std::string to_json();
416 
417  double Deltabar(double tau, double delta);
418  double dDeltabar_ddelta__consttau(double tau, double delta);
419  double d2Deltabar_ddelta2__consttau(double tau, double delta);
420  double dDeltabar_dtau__constdelta(double tau, double delta);
421  double d2Deltabar_dtau2__constdelta(double tau, double delta);
422  double d2Deltabar_ddelta_dtau(double tau, double delta);
423  double d3Deltabar_dtau3__constdelta(double tau, double delta);
424  double d3Deltabar_ddelta_dtau2(double tau, double delta);
425  double d3Deltabar_ddelta3__consttau(double tau, double delta);
426  double d3Deltabar_ddelta2_dtau(double tau, double delta);
427 
428  double X(double delta, double Deltabar);
429  double dX_dDeltabar__constdelta(double delta, double Deltabar);
430  double dX_ddelta__constDeltabar(double delta, double Deltabar);
431  double dX_dtau(double tau, double delta);
432  double dX_ddelta(double tau, double delta);
433  double d2X_dtau2(double tau, double delta);
434  double d2X_ddeltadtau(double tau, double delta);
435  double d2X_ddelta2(double tau, double delta);
436 
437  double d3X_dtau3(double tau, double delta);
438  double d3X_ddelta3(double tau, double delta);
439  double d3X_ddeltadtau2(double tau, double delta);
440  double d3X_ddelta2dtau(double tau, double delta);
441 
442  double g(double eta);
443  double dg_deta(double eta);
444  double d2g_deta2(double eta);
445  double d3g_deta3(double eta);
446  double eta(double delta);
447 
448  double base(double tau, double delta);
449  double dDelta(double tau, double delta);
450  double dTau(double tau, double delta);
451 
452  double dDelta2(double tau, double delta);
453  double dDelta_dTau(double tau, double delta);
454  double dTau2(double tau, double delta);
455 
456  double dDelta3(double tau, double delta);
457  double dDelta2_dTau(double tau, double delta);
458  double dDelta_dTau2(double tau, double delta);
459  double dTau3(double tau, double delta);
460 };
461 
463 
464 public:
465  phir_SAFT_associating_2B(double m, double epsilonbar, double vbarn, double kappabar)
466  {
467  this->a = 2;
468  this->m = m;
469  this->epsilonbar = epsilonbar;
470  this->vbarn = vbarn;
471  this->kappabar = kappabar;
472  };
473 };
475 
476 public:
477  phir_SAFT_associating_1(double m, double epsilonbar, double vbarn, double kappabar)
478  {
479  this->a = 1;
480  this->m = m;
481  this->epsilonbar = epsilonbar;
482  this->vbarn = vbarn;
483  this->kappabar = kappabar;
484  };
485 };
486 
493 class phi0_lead : public phi_BC{
494  /*
495  constructor: phi0_lead(double a1, double a2)
496  */
497 private:
498  double c1,c2; // Use these variables internally
499 public:
500  // Constructor
501  phi0_lead(double a1, double a2){c1=a1; c2=a2;};
502 
503  //Destructor
505 
507  el.AddMember("type","IdealGasHelmholtzLead",doc.GetAllocator());
508  el.AddMember("a1",c1,doc.GetAllocator());
509  el.AddMember("a2",c2,doc.GetAllocator());
510  };
511 
512  // Term and its derivatives
513  double base(double tau, double delta){return log(delta)+c1+c2*tau;};
514  double dTau(double tau, double delta){return c2;};
515  double dTau2(double tau, double delta){return 0.0;};
516  double dDelta(double tau, double delta){return 1.0/delta;};
517  double dDelta2(double tau, double delta){return -1.0/delta/delta;};
518  double dDelta2_dTau(double tau, double delta){return 0.0;};
519  double dDelta_dTau(double tau, double delta){return 0.0;};
520  double dDelta_dTau2(double tau, double delta){return 0.0;};
521  double dTau3(double tau, double delta){return 0.0;};
522  double dDelta3(double tau, double delta){return 2/delta/delta/delta;};
523 };
524 
533 private:
534  double c1,c2; // Use these variables internally
535 public:
536  // Constructor
537  phi0_enthalpy_entropy_offset(double a1, double a2){c1=a1; c2=a2;};
538 
539  //Destructor
541 
543  el.AddMember("type","IdealGasEnthalpyEntropyOffset",doc.GetAllocator());
544  el.AddMember("a1",c1,doc.GetAllocator());
545  el.AddMember("a2",c2,doc.GetAllocator());
546  };
547 
548  // Term and its derivatives
549  double base(double tau, double delta){return c1+c2*tau;};
550  double dTau(double tau, double delta){return c2;};
551  double dTau2(double tau, double delta){return 0.0;};
552  double dDelta(double tau, double delta){return 1.0/delta;};
553  double dDelta2(double tau, double delta){return -1.0/delta/delta;};
554  double dDelta2_dTau(double tau, double delta){return 0.0;};
555  double dDelta_dTau(double tau, double delta){return 0.0;};
556  double dDelta_dTau2(double tau, double delta){return 0.0;};
557  double dTau3(double tau, double delta){return 0.0;};
558  double dDelta3(double tau, double delta){return 2/delta/delta/delta;};
559 };
560 
561 
568 class phi0_logtau : public phi_BC{
569  /*
570  Term is of the form a1*log(tau)
571  Constructor: phi0_logtau(double a1)
572  */
573 private:
574  double c1; // Use these variables internally
575 public:
576  // Constructor
577  phi0_logtau(double a1){c1=a1;};
578 
579  //Destructor
581 
583  el.AddMember("type","IdealGasHelmholtzLogTau",doc.GetAllocator());
584  el.AddMember("a",c1,doc.GetAllocator());
585  };
586 
587  // Term and its derivatives
588  double base(double tau, double delta){return c1*log(tau);};
589  double dTau(double tau, double delta){return c1/tau;};
590  double dTau2(double tau, double delta){return -c1/tau/tau;};
591  double dDelta(double tau, double delta){return 0.0;};
592  double dDelta2(double tau, double delta){return 0.0;};
593  double dDelta2_dTau(double tau, double delta){return 0.0;};
594  double dDelta_dTau(double tau, double delta){return 0.0;};
595  double dDelta_dTau2(double tau, double delta){return 0.0;};
596  double dTau3(double tau, double delta){return 2*c1/tau/tau/tau;};
597  double dDelta3(double tau, double delta){return 0;};
598 };
599 
601  /*
602  Term is of the form a_0*log(1-exp(-theta_0*tau))
603  Constructors:
604  phi0_Planck_Einstein(std::vector<double> a_in, std::vector<double> theta_in, int iStart_in, int iEnd_in)
605  phi0_Planck_Einstein(double a_in, double theta_in)
606  */
607 private:
608  std::vector<double> a,theta; // Use these variables internally
609  int iStart, iEnd;
610 public:
611  // Constructor with std::vector instances
612  phi0_Planck_Einstein(std::vector<double> a_in, std::vector<double> theta_in, int iStart_in, int iEnd_in)
613  {
614  a=a_in; theta=theta_in; iStart = iStart_in; iEnd = iEnd_in;
615  };
616  phi0_Planck_Einstein(double a_in[], double theta_in[], int iStart_in, int iEnd_in, int N)
617  {
618  a=std::vector<double>(a_in,a_in+N);
619  theta=std::vector<double>(theta_in,theta_in+N);
620  iStart = iStart_in; iEnd = iEnd_in;
621  };
622  phi0_Planck_Einstein(const double a_in[], const double theta_in[], int iStart_in, int iEnd_in, int N)
623  {
624  a=std::vector<double>(a_in,a_in+N);
625  theta=std::vector<double>(theta_in,theta_in+N);
626  iStart = iStart_in; iEnd = iEnd_in;
627  };
628  // Constructor with doubles
629  phi0_Planck_Einstein(double a_in, double theta_in)
630  {
631  a=std::vector<double> (1,a_in);
632  theta=std::vector<double> (1,theta_in);
633  iStart = 0; iEnd = 0;
634  };
635 
636  //Destructor
638 
640 
641  // Term and its derivatives
642  double base(double tau, double delta);
643  double dTau(double tau, double delta);
644  double dTau2(double tau, double delta);
645  double dTau3(double tau, double delta);
646  double dDelta(double tau, double delta){return 0.0;};
647  double dDelta2(double tau, double delta){return 0.0;};
648  double dDelta2_dTau(double tau, double delta){return 0.0;};
649  double dDelta_dTau(double tau, double delta){return 0.0;};
650  double dDelta_dTau2(double tau, double delta){return 0.0;};
651  double dDelta3(double tau, double delta){return 0;};
652 };
653 
655  /*
656  Term is of the form a_0*log(c+exp(theta_0*tau))
657  Constructor:
658  phi0_Planck_Einstein2(double a_in, double theta_in, double c_in)
659  */
660 private:
661  std::vector<double> a,theta,c; // Use these variables internally
662  int iStart, iEnd;
663 public:
664  // Constructor
665  phi0_Planck_Einstein2(double a, double theta, double c)
666  {
667  this->a=std::vector<double> (1,a);
668  this->theta=std::vector<double> (1,theta);
669  this->c=std::vector<double> (1,c);
670  iStart = 0; iEnd = 0;
671  };
672 
673  //Destructor
675 
677 
678  // Term and its derivatives
679  double base(double tau, double delta);
680  double dTau(double tau, double delta);
681  double dTau2(double tau, double delta);
682  double dTau3(double tau, double delta);
683  double dDelta(double tau, double delta){return 0.0;};
684  double dDelta2(double tau, double delta){return 0.0;};
685  double dDelta2_dTau(double tau, double delta){return 0.0;};
686  double dDelta_dTau(double tau, double delta){return 0.0;};
687  double dDelta_dTau2(double tau, double delta){return 0.0;};
688  double dDelta3(double tau, double delta){return 0.0;};
689 };
690 
691 /*
692 Term is of the form a*tau^b
693 Constructor:
694  phi0_power(std::vector<double> a, std::vector<double> b, int iStart, int iEnd)
695 */
696 class phi0_power : public phi_BC{
697 
698 private:
699  std::vector<double> a,b; // Use these variables internally
700  int iStart, iEnd;
701 public:
702  // Constructor
703  phi0_power(std::vector<double> a, std::vector<double> b, int iStart, int iEnd)
704  {
705  this->a=a;
706  this->b=b;
707  this->iStart = iStart;
708  this->iEnd = iEnd;
709  };
710  phi0_power(double a[], double b[], int iStart, int iEnd, int N)
711  {
712  this->a = std::vector<double>(a,a+N);
713  this->b = std::vector<double>(b,b+N);
714  this->iStart = iStart;
715  this->iEnd = iEnd;
716  };
717  phi0_power(const double a[], const double b[], int iStart, int iEnd, int N)
718  {
719  this->a = std::vector<double>(a,a+N);
720  this->b = std::vector<double>(b,b+N);
721  this->iStart = iStart;
722  this->iEnd = iEnd;
723  };
724  // Constructor with just double values
725  phi0_power(double a, double b)
726  {
727  this->a=std::vector<double>(1,a);
728  this->b=std::vector<double>(1,b);
729  iStart = 0;
730  iEnd = 0;
731  };
732 
733  //Destructor
735 
737  {
738  el.AddMember("type","IdealGasHelmholtzPower",doc.GetAllocator());
740  for (int i=iStart;i<=iEnd;i++)
741  {
742  _n.PushBack(a[i],doc.GetAllocator());
743  _t.PushBack(b[i],doc.GetAllocator());
744  }
745  el.AddMember("n",_n,doc.GetAllocator());
746  el.AddMember("t",_t,doc.GetAllocator());
747  };
748 
749  // Term and its derivatives
750  double base(double tau, double delta)
751  {
752  double summer=0;
753  for (int i=iStart;i<=iEnd;i++){
754  summer += a[i]*pow(tau,b[i]);
755  }
756  return summer;
757  };
758  double dTau(double tau, double delta)
759  {
760  double summer=0;
761 
762  for (int i=iStart;i<=iEnd;i++) {
763  summer += a[i]*b[i]*pow(tau,b[i]-1);
764  }
765  return summer;
766  };
767  double dTau2(double tau, double delta)
768  {
769  double summer=0;
770  for (int i=iStart; i<=iEnd; i++){
771  summer += a[i]*b[i]*(b[i]-1)*pow(tau,b[i]-2);
772  }
773  return summer;
774  };
775  double dTau3(double tau, double delta)
776  {
777  double summer=0;
778  for (int i=iStart; i<=iEnd; i++){
779  summer += a[i]*b[i]*(b[i]-1)*(b[i]-2)*pow(tau,b[i]-3);
780  }
781  return summer;
782  };
783  double dDelta(double tau, double delta){return 0.0;};
784  double dDelta2(double tau, double delta){return 0.0;};
785  double dDelta2_dTau(double tau, double delta){return 0.0;};
786  double dDelta_dTau(double tau, double delta){return 0.0;};
787  double dDelta_dTau2(double tau, double delta){return 0.0;};
788  double dDelta3(double tau, double delta){return 0.0;};
789 };
790 
792 class phi0_cp0_constant : public phi_BC{
793  /*
794 
795  Maxima code for this term:
796  assume(T>0)$
797  assume(T0>0)$
798  assume(T-T0>0)$
799  a:(1/T)*integrate(c,T,T0,T)-integrate(c/T,T,T0,T)$
800  subst(Tc/tau,T,a)$
801  subst(Tc/tau0,T0,%)$
802  b:ratsimp(logcontract(%));
803  db:ratsimp(diff(b,tau));
804  db2:ratsimp(diff(%,tau));
805 
806  */
807 private:
808  double c,Tc,T0,tau0; // Use these variables internally
809 public:
810 
812  phi0_cp0_constant(double c, double Tc, double T0) { this->c=c; this->T0=T0; this->Tc=Tc; this->tau0=Tc/T0;};
813 
816 
818  {
819  el.AddMember("type","IdealGasHelmholtzCP0Constant",doc.GetAllocator());
820  el.AddMember("cp_over_R",c,doc.GetAllocator());
821  el.AddMember("Tc",Tc,doc.GetAllocator());
822  el.AddMember("T0",T0,doc.GetAllocator());
823  };
824 
825  // Term and its derivatives
826  double base(double tau, double delta){
827  return c-c*tau/tau0+c*log(tau/tau0);
828  };
829  double dTau(double tau, double delta)
830  {
831  return c/tau-c/tau0;
832  };
833  double dTau2(double tau, double delta)
834  {
835  return -c/(tau*tau);
836  };
837  double dTau3(double tau, double delta)
838  {
839  return 2*c/(tau*tau*tau);
840  };
841  double dDelta(double tau, double delta){return 0.0;};
842  double dDelta2(double tau, double delta){return 0.0;};
843  double dDelta2_dTau(double tau, double delta){return 0.0;};
844  double dDelta_dTau(double tau, double delta){return 0.0;};
845  double dDelta_dTau2(double tau, double delta){return 0.0;};
846  double dDelta3(double tau, double delta){return 0.0;};
847 };
848 
850 
881 class phi0_cp0_poly : public phi_BC{
882 private:
883  std::vector<double> a,tv;
884  double Tc,T0,tau0; // Use these variables internally
885  int iStart, iEnd;
886 public:
888  phi0_cp0_poly(double a, double t, double Tc, double T0) {
889  this->a=std::vector<double>(1,a);
890  this->tv=std::vector<double>(1,t);
891  this->Tc=Tc; this->T0=T0; iStart=0; iEnd=0; tau0=Tc/T0;
892  };
893 
895  phi0_cp0_poly(std::vector<double> a, std::vector<double> t, double Tc, double T0, int iStart, int iEnd) {
896  this->a=a; this->tv=t; this->Tc = Tc; this->T0=T0; this->iStart=iStart; this->iEnd=iEnd; tau0=Tc/T0;
897  };
898 
901 
903 
904  // Term and its derivatives
905  double base(double tau, double delta){
906  double sum=0;
907  for (int i = iStart; i<=iEnd; i++){
908  double t=tv[i];
909  if (fabs(t)<10*DBL_EPSILON)
910  {
911  sum += a[i]-a[i]*tau/tau0+a[i]*log(tau/tau0);
912  }
913  else if (fabs(t+1) < 10*DBL_EPSILON)
914  {
915  sum += a[i]*tau/Tc*log(tau0/tau)+a[i]/Tc*(tau-tau0);
916  }
917  else
918  {
919  sum += -a[i]*pow(Tc,t)*pow(tau,-t)/(t*(t+1))-a[i]*pow(T0,t+1)*tau/(Tc*(t+1))+a[i]*pow(T0,t)/t;
920  }
921  }
922  return sum;
923  };
924  double dTau(double tau, double delta);
925  double dTau2(double tau, double delta);
926  double dDelta(double tau, double delta){return 0.0;};
927  double dDelta2(double tau, double delta){return 0.0;};
928  double dDelta2_dTau(double tau, double delta){return 0.0;};
929  double dDelta_dTau(double tau, double delta){return 0.0;};
930  double dDelta_dTau2(double tau, double delta){return 0.0;};
931  double dTau3(double tau, double delta);
932  double dDelta3(double tau, double delta){return 0.0;};
933 };
934 
939 class phi0_cp0_AlyLee : public phi_BC{
940 private:
941  std::vector<double> a;
942  double Tc,tau0,T0,R_u; // Use these variables internally
943 public:
944 
946  phi0_cp0_AlyLee(std::vector<double> _a, double _Tc, double _T0, double _R) {
947  a=_a; Tc = _Tc; T0=_T0; tau0=Tc/T0; R_u = _R;
948  };
949 
952 
954 
955  double base(double tau, double delta);
956  double dTau(double tau, double delta);
957  double dTau2(double tau, double delta);
958  double dDelta(double tau, double delta){return 0.0;};
959  double dDelta2(double tau, double delta){return 0.0;};
960  double dDelta2_dTau(double tau, double delta){return 0.0;};
961  double dDelta_dTau(double tau, double delta){return 0.0;};
962  double cp0(double tau);
963  double anti_deriv_cp0_tau(double tau);
964  double anti_deriv_cp0_tau2(double tau);
965  double dDelta_dTau2(double tau, double delta){return 0.0;};
966  double dTau3(double tau, double delta);
967  double dDelta3(double tau, double delta){return 0.0;};
968 };
969 
970 #endif
double d3Deltabar_dtau3__constdelta(double tau, double delta)
Definition: Helmholtz.cpp:1524
double d3Deltabar_ddelta_dtau2(double tau, double delta)
Definition: Helmholtz.cpp:1528
std::vector< double > dTau2V(std::vector< double > tau, std::vector< double > delta)
Definition: Helmholtz.cpp:330
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:597
phir_exponential(std::vector< double >, std::vector< double >, std::vector< double >, std::vector< double >, std::vector< double >, int, int)
Definition: Helmholtz.cpp:414
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:455
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:517
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.cpp:783
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:846
double dDeltabar_dtau__constdelta(double tau, double delta)
Definition: Helmholtz.cpp:1512
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:1384
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:558
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.cpp:185
phi0_lead(double a1, double a2)
Definition: Helmholtz.h:501
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.cpp:530
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:787
virtual double dTau(double tau, double delta)=0
double A(double log_tau, double log_delta, double delta, int i)
Derivatives for a single term for use in fitter.
Definition: Helmholtz.cpp:257
double base(double tau, double delta)
Definition: Helmholtz.cpp:893
double dDelta(double tau, double delta)
Definition: Helmholtz.h:591
double dTau3(double tau, double delta)
Definition: Helmholtz.h:775
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:903
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:785
double dDelta(double tau, double delta)
Definition: Helmholtz.h:841
virtual double dDelta2(double tau, double delta)=0
double dDelta(double tau, double delta)
Definition: Helmholtz.h:516
double dX_dtau(double tau, double delta)
Definition: Helmholtz.cpp:1555
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:688
phir_SAFT_associating_2B(double m, double epsilonbar, double vbarn, double kappabar)
Definition: Helmholtz.h:465
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:961
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:842
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:1721
double dDelta(double tau, double delta)
Definition: Helmholtz.cpp:1063
double dDelta(double tau, double delta)
Definition: Helmholtz.h:552
virtual double dDelta2_dTau(double tau, double delta)=0
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.cpp:247
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:681
double d2A_dDelta_dTau(double log_tau, double log_delta, double delta, int i)
Definition: Helmholtz.cpp:286
double d3Deltabar_ddelta3__consttau(double tau, double delta)
Definition: Helmholtz.cpp:1536
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.cpp:482
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.cpp:1359
double dDelta(double tau, double delta)
Definition: Helmholtz.cpp:199
phi0_Planck_Einstein(std::vector< double > a_in, std::vector< double > theta_in, int iStart_in, int iEnd_in)
Definition: Helmholtz.h:612
void cache()
Cache some terms for internal use.
Definition: Helmholtz.cpp:117
double dA_dDelta(double log_tau, double log_delta, double delta, int i)
Definition: Helmholtz.cpp:264
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:139
std::vector< double > dDelta2V(std::vector< double > tau, std::vector< double > delta)
Definition: Helmholtz.cpp:321
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.cpp:1103
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:520
double dDelta2(double tau, double delta)
Definition: Helmholtz.cpp:1073
double d2Deltabar_ddelta_dtau(double tau, double delta)
Definition: Helmholtz.cpp:1520
double dTau2(double tau, double delta)
Definition: Helmholtz.h:833
double d2g_deta2(double eta)
Definition: Helmholtz.cpp:1700
double dTau(double tau, double delta)
Definition: Helmholtz.h:514
double dDelta(double tau, double delta)
Definition: Helmholtz.h:958
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:157
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.cpp:233
virtual void to_json(rapidjson::Value &el, rapidjson::Document &doc)=0
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:686
double dDelta3(double tau, double delta)
Definition: Helmholtz.cpp:1278
double X(double delta, double Deltabar)
Definition: Helmholtz.cpp:1541
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:1875
double dDelta2(double tau, double delta)
Definition: Helmholtz.cpp:1733
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:923
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:302
phir_Lemmon2005(std::vector< double >, std::vector< double >, std::vector< double >, std::vector< double >, std::vector< double >, int, int)
Definition: Helmholtz.cpp:573
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:556
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:929
double dX_ddelta(double tau, double delta)
Definition: Helmholtz.cpp:1560
double dX_ddelta__constDeltabar(double delta, double Deltabar)
Definition: Helmholtz.cpp:1550
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.cpp:989
double dDelta(double tau, double delta)
Definition: Helmholtz.h:926
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:913
double dTau3(double tau, double delta)
Definition: Helmholtz.h:596
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:635
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:650
double dDelta2(double tau, double delta)
Definition: Helmholtz.cpp:502
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.h:506
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.cpp:1757
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:965
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:592
double anti_deriv_cp0_tau(double tau)
Definition: Helmholtz.cpp:2017
double d2Deltabar_ddelta2__consttau(double tau, double delta)
Definition: Helmholtz.cpp:1508
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:553
double d2X_ddeltadtau(double tau, double delta)
Definition: Helmholtz.cpp:1578
double dA_dTau(double log_tau, double log_delta, double delta, int i)
Definition: Helmholtz.cpp:296
phi0_Planck_Einstein(double a_in, double theta_in)
Definition: Helmholtz.h:629
double dTau2(double tau, double delta)
Definition: Helmholtz.h:767
phi0_cp0_poly(double a, double t, double Tc, double T0)
Constructor with just a single double value.
Definition: Helmholtz.h:888
phi0_Planck_Einstein2(double a, double theta, double c)
Definition: Helmholtz.h:665
phi0_cp0_constant(double c, double Tc, double T0)
Constructor with just a single double value.
Definition: Helmholtz.h:812
~phi0_cp0_poly()
Destructor.
Definition: Helmholtz.h:900
double d2X_dtau2(double tau, double delta)
Definition: Helmholtz.cpp:1566
double anti_deriv_cp0_tau2(double tau)
Definition: Helmholtz.cpp:2008
double dDelta2(double tau, double delta)
Definition: Helmholtz.cpp:740
double base(double tau, double delta)
Definition: Helmholtz.h:826
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:1154
virtual double base(double tau, double delta)=0
std::vector< double > d
The power for the delta terms.
Definition: Helmholtz.h:97
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:464
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:522
GenericValue & AddMember(GenericValue &name, GenericValue &value, Allocator &allocator)
Add a member (name-value pair) to the object.
Definition: document.h:258
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:303
phi0_cp0_poly(std::vector< double > a, std::vector< double > t, double Tc, double T0, int iStart, int iEnd)
Constructor with std::vectors.
Definition: Helmholtz.h:895
double dDelta(double tau, double delta)
Definition: Helmholtz.cpp:1194
std::string to_json()
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.cpp:1217
double dTau3(double tau, double delta)
Definition: Helmholtz.h:837
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:648
double base(double tau, double delta)
Definition: Helmholtz.cpp:1711
double d3X_ddeltadtau2(double tau, double delta)
Definition: Helmholtz.cpp:1627
double dDelta3(double tau, double delta)
Definition: Helmholtz.cpp:514
virtual double dDelta_dTau2(double tau, double delta)=0
double base(double tau, double delta)
Definition: Helmholtz.h:588
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:1403
double d3X_ddelta3(double tau, double delta)
Definition: Helmholtz.cpp:1672
double dTau(double tau, double delta)
Definition: Helmholtz.h:550
unsigned int iEnd
Definition: Helmholtz.h:96
double cp0(double tau)
Definition: Helmholtz.cpp:2038
double dDeltabar_ddelta__consttau(double tau, double delta)
Definition: Helmholtz.cpp:1504
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:2071
double dDelta(double tau, double delta)
Definition: Helmholtz.h:646
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:554
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:786
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:553
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:647
virtual double dDelta(double tau, double delta)=0
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.h:582
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:518
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.cpp:700
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:148
GenericValue & PushBack(GenericValue &value, Allocator &allocator)
Append a value at the end of the array.
Definition: document.h:396
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:1884
std::vector< double > l
Definition: Helmholtz.h:97
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:2048
unsigned int iStart
Definition: Helmholtz.h:96
~phi0_cp0_constant()
Destructor.
Definition: Helmholtz.h:815
double dX_dDeltabar__constdelta(double delta, double Deltabar)
Definition: Helmholtz.cpp:1545
double dTau(double tau, double delta)
Definition: Helmholtz.h:589
double dDelta(double tau, double delta)
Definition: Helmholtz.h:683
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:932
phi0_power(std::vector< double > a, std::vector< double > b, int iStart, int iEnd)
Definition: Helmholtz.h:703
double base(double tau, double delta)
Definition: Helmholtz.h:750
A document for parsing JSON text as DOM.
Definition: document.h:691
double dDelta2(double tau, double delta)
Definition: Helmholtz.cpp:208
virtual ~phi_BC()
Definition: Helmholtz.h:27
double base(double tau, double delta)
Definition: Helmholtz.cpp:1930
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:394
phi0_enthalpy_entropy_offset(double a1, double a2)
Definition: Helmholtz.h:537
double dTau(double tau, double delta)
Definition: Helmholtz.h:758
double base(double tau, double delta)
Definition: Helmholtz.cpp:1997
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:788
double d2Deltabar_dtau2__constdelta(double tau, double delta)
Definition: Helmholtz.cpp:1516
virtual double dTau2(double tau, double delta)=0
std::vector< double > dDelta_dTauV(std::vector< double > tau, std::vector< double > delta)
Definition: Helmholtz.cpp:339
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:2113
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:1420
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:843
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:960
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:1958
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:1749
virtual double dTau3(double tau, double delta)=0
double dDelta3(double tau, double delta)
Definition: Helmholtz.cpp:1777
double d2X_ddelta2(double tau, double delta)
Definition: Helmholtz.cpp:1591
double d3X_ddelta2dtau(double tau, double delta)
Definition: Helmholtz.cpp:1646
std::vector< double > t
The powers for the tau terms.
Definition: Helmholtz.h:97
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.cpp:1767
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:2001
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:2042
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:1940
phi0_Planck_Einstein(double a_in[], double theta_in[], int iStart_in, int iEnd_in, int N)
Definition: Helmholtz.h:616
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:927
Allocator & GetAllocator()
Get the allocator of this document.
Definition: document.h:758
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:928
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.cpp:804
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:651
double g(double eta)
Definition: Helmholtz.cpp:1692
~phi0_lead()
Definition: Helmholtz.h:504
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:1015
double base(double tau, double delta)
Definition: Helmholtz.cpp:1866
phi_BC()
Definition: Helmholtz.h:26
double dDelta(double tau, double delta)
Definition: Helmholtz.cpp:492
double d3g_deta3(double eta)
Definition: Helmholtz.cpp:1704
double base(double tau, double delta)
Definition: Helmholtz.h:513
double dTau2(double tau, double delta)
Definition: Helmholtz.h:515
phi0_power(double a, double b)
Definition: Helmholtz.h:725
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:1093
double d2A_dDelta2(double log_tau, double log_delta, double delta, int i)
Definition: Helmholtz.cpp:277
double dTau3(double tau, double delta)
Definition: Helmholtz.h:305
phi0_Planck_Einstein(const double a_in[], const double theta_in[], int iStart_in, int iEnd_in, int N)
Definition: Helmholtz.h:622
double base(double tau, double delta)
Definition: Helmholtz.cpp:1181
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:593
phir_SAFT_associating_1(double m, double epsilonbar, double vbarn, double kappabar)
Definition: Helmholtz.h:477
#define DBL_EPSILON
Definition: Helmholtz.h:17
Term in the ideal-gas specific heat equation that is polynomial term.
Definition: Helmholtz.h:881
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:868
double dTau3(double tau, double delta)
Definition: Helmholtz.h:521
double base(double tau, double delta)
Definition: Helmholtz.cpp:446
double dDelta2(double tau, double delta)
Definition: Helmholtz.cpp:948
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:1949
double base(double tau, double delta)
Definition: Helmholtz.h:549
double dDelta3(double tau, double delta)
Definition: Helmholtz.cpp:217
double dDelta(double tau, double delta)
Definition: Helmholtz.cpp:721
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.cpp:1740
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.cpp:1311
phi0_power(const double a[], const double b[], int iStart, int iEnd, int N)
Definition: Helmholtz.h:717
double base(double tau, double delta)
Definition: Helmholtz.cpp:130
double eta(double delta)
Definition: Helmholtz.cpp:1708
double dDelta3(double tau, double delta)
Definition: Helmholtz.cpp:760
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:845
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.h:817
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:304
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:687
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:1853
std::vector< double > dDeltaV(std::vector< double > tau, std::vector< double > delta)
Vectorized form so iteration happens at c++ level.
Definition: Helmholtz.cpp:312
double dTau3(double tau, double delta)
Definition: Helmholtz.h:557
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:519
double dTau(double tau, double delta)
Definition: Helmholtz.h:829
phi0_cp0_AlyLee(std::vector< double > _a, double _Tc, double _T0, double _R)
Constructor with std::vectors.
Definition: Helmholtz.h:946
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:2092
double d3X_dtau3(double tau, double delta)
Definition: Helmholtz.cpp:1613
virtual double dDelta3(double tau, double delta)=0
double dDelta(double tau, double delta)
Definition: Helmholtz.cpp:938
This is the abstract base class upon which each residual Helmholtz energy class is built...
Definition: Helmholtz.h:24
double dg_deta(double eta)
Definition: Helmholtz.cpp:1696
double Deltabar(double tau, double delta)
Definition: Helmholtz.cpp:1500
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:1968
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:784
Term in the ideal-gas specific heat equation that is constant.
Definition: Helmholtz.h:792
phir_critical(std::vector< double > n_in, std::vector< double > d_in, std::vector< double > t_in, std::vector< double > a_in, std::vector< double > b_in, std::vector< double > beta_in, std::vector< double > A_in, std::vector< double > B_in, std::vector< double > C_in, std::vector< double > D_in, int iStart_in, int iEnd_in)
Definition: Helmholtz.cpp:1115
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:649
double dDelta3(double tau, double delta)
Definition: Helmholtz.h:967
double d3Deltabar_ddelta2_dtau(double tau, double delta)
Definition: Helmholtz.cpp:1532
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:473
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:684
void check_derivatives(phi_BC *phi, double tau, double delta, double ddelta=1e-10, double dtau=1e-10)
Definition: Helmholtz.cpp:24
Represents a JSON value. Use Value for UTF8 encoding and default allocator.
Definition: document.h:30
double dTau3(double tau, double delta)
Definition: Helmholtz.cpp:1893
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:2055
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:1904
double dDelta(double tau, double delta)
Definition: Helmholtz.h:783
double dTau2(double tau, double delta)
Definition: Helmholtz.h:590
double dTau2(double tau, double delta)
Definition: Helmholtz.h:551
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.cpp:169
double dTau2(double tau, double delta)
Definition: Helmholtz.cpp:1726
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.cpp:969
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.cpp:542
std::vector< double > n
The coefficients multiplying each term.
Definition: Helmholtz.h:97
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.h:736
double d2A_dTau2(double log_tau, double log_delta, double delta, int i)
Definition: Helmholtz.cpp:303
double base(double tau, double delta)
Definition: Helmholtz.cpp:1053
double base(double tau, double delta)
Definition: Helmholtz.cpp:605
double dDelta3(double tau, double delta)
Definition: Helmholtz.cpp:958
void to_json(rapidjson::Value &el, rapidjson::Document &doc)
Definition: Helmholtz.h:542
phi0_power(double a[], double b[], int iStart, int iEnd, int N)
Definition: Helmholtz.h:710
double dDelta2(double tau, double delta)
Definition: Helmholtz.cpp:1256
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:930
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:844
phi0_logtau(double a1)
Definition: Helmholtz.h:577
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:594
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:619
double dDelta_dTau2(double tau, double delta)
Definition: Helmholtz.h:595
double dDelta(double tau, double delta)
Definition: Helmholtz.cpp:1716
double base(double tau, double delta)
Definition: Helmholtz.h:905
virtual double dDelta_dTau(double tau, double delta)=0
~phi0_cp0_AlyLee()
Destructor.
Definition: Helmholtz.h:951
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.cpp:979
double dDelta2(double tau, double delta)
Definition: Helmholtz.h:959
double dDelta2_dTau(double tau, double delta)
Definition: Helmholtz.h:685
double dDelta_dTau(double tau, double delta)
Definition: Helmholtz.h:555
double dTau(double tau, double delta)
Definition: Helmholtz.cpp:1083