- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
void main_calc(double *j0, double *v0, double *r0, double *L, double *L1, double *w0, double *gamma1, int *Num, double **array, int *Ng)
{
double *jc, *Pvh, *h, *vf, *R, *j0, *v0, *r0, *L,*L1, *w0, *gamma1, cm, vfm, *xi, *w, *b, *BB, *Num, E, v, z, t, k1[2], k2[2], k3[2], k4[2],TimeF,C0[mmax][pmax], gamma2[mmax][pmax];
const double PI = 3.14159265358979323;
int i, m, j, k, p, Size1, Size2;
const int mmax = 3000, pmax = 20;
double *jc2, *Pvih;
double CJ, x;
int i1;
/*j0=new double;
v0=new double;
r0=new double;
L=new double;
L1=new double;
w0=new double;
gamma1=new double;
Num=new int;*/
ofstream fil;
fil.open("current");
Pvh = new double[*Num];
h = new double[*Num];
vf = new double[*Num];
R = new double[*Num];
//entry(j0,v0,r0,L,L1,w0,gamma1,Num, Pvh, h, vf, R);
TimeF = *Ng*dt;
for (i = 0; i < *Num; i++){
Pvh[i] = array[0][i];
h[i] = array[1][i];
vf[i] = array[2][i];
R[i] = array[3][i];
}
Size1 = *L1 / dz1;
for (i = 0; i<*Num; i++) {
if (TimeF<(2 * PI / (h[i] * (*w0)))) {
TimeF = (2 * PI / (h[i] * (*w0)));
}
}
cout << "TimeF=" << TimeF << endl;
Size2 = 20 * PI / (*w0*dt1);
if (Size1>mmax) { cout << "Error: increase mmax!" << endl; }
cout << "Size1=" << Size1 << " Size2=" << Size2 << endl;
//C0=new double[(Size1+5)*(Size2+5)];
//gamma2=new double[(Size1+5)*(Size2+5)];
jc = new double[*Ng];
jc2 = new double[*Ng];
b = new double[*Num];
w = new double[*Num];
xi = new double[*Num];
BB = new double[*Num];
ofstream fil2;
fil2.open("w");
for (i = 0; i<*Num; i++) {
w[i] = h[i] * (*w0);
fil2 << w[i] << endl;
b[i] = w[i] / vf[i];
cm = 3.0; vfm = vf[i] / 1e8;
xi[i] = w[i] * sqrt(1.0 / (cm*cm) + 1.0 / (vfm*vfm)) / 1e8;
BB[i] = (I0(xi[i] * (*r0))*I0(xi[i] * (*r0)) - I1(xi[i] * (*r0))*I1(xi[i] * (*r0)) - 1.0);
BB[i] = b[i] * sqrt(2.0*R[i] * Pvh[i] / (BB[i]));
}
fil2.close();
m = 0;
t = 0;
do {
m = m + 1;
t = t + dt;
jc[m] = 0.0;
} while (t<TimeF);
//cout <<F1n(0.03,0,jc,BB,w,b,xi,r0) << endl;