Hi, the ffg code gave the ffg 2 errors:
on both lines * and ** in the code below:
Please what is the cause of this error?
Code:
'ei':cannot convert parameter 1 from double to double[]
Code:
#include <math>
#include "stdafx.h"
#include <fstream>
#include <iomanip>
#include <iostream>
using namespace std;
double a[10000],b[10000],x[10000],expint[10000],beta[10000],dimP2[10000];
double t[50],alpha[50],dimP[50];
int i,j;
double ei(double x[10000])
{
double a0,a1,a2,a3,a4,a5,b1,b2,b3,b4,c1,c2,c3,c4;
a0 = -0.57721566;
a1 = 0.99999193;
a2 = -0.24991055;
a3 = 0.05519968;
a4 = -0.00976004;
a5 = 0.00107857;
b1 = 8.5733287401;
b2 = 18.059016973;
b3 = 8.6347608925;
b4 = 0.2677737343;
c1 = 9.5733223454;
c2 = 25.6329561486;
c3 = 21.0996530827;
c4 = 3.9584969228;
if (x[i]<=0)
{
expint[i] = -999;
}
if (x[i]>=1)
{
a[i] = pow(x[i],4)+(b1*pow(x[i],3))+(b2*pow(x[i],2))+(b3*x[i])+b4;
b[i] = pow(x[i],4)+(c1*pow(x[i],3))+(c2*pow(x[i],2))+(c3*x[i])+c4;
expint[i] = (1/(x[i]*exp(x[i])))*a[i]/b[i];
}
if((0<x[i])&&(x[i]<1))
{
expint[i] = a0+(a1*x[i])+(a2*pow(x[i],2))+(a3*pow(x[i],3))+(a4*pow(x[i],4))+(a5*pow(x[i],5))-log(x[i]);
}
return expint[i];
}
double time_hr()
{
double N=49.0;
for (int i=0;i<50;i++)
{
t[i] = 0.01*exp((i/N)*log(10/0.01));
}
return t[i];
}
double pD()
{
double rw = 0.25;
double ac = 43560;
double A = 80*ac;
double len_b = sqrt(0.5*A);
double len_a = 2*len_b;
double len_ri =0.5*sqrt(pow(len_a,2)+pow(len_b,2));
alpha[i] = (-(pow(rw,2)/(4*A*t[i])));
for(int i=0;i<50;i++)
{
for(int j=0;j<10000;j++)
{
dimP2[j] +=-(0.5*ei(-(1/(4*A*t[i]))*(j+1)*pow(len_ri,2)));//*
}
dimP[i]=(-0.5*ei(alpha[i]))+dimP2[j];//**
}
return dimP[i];
}