Sie sind auf Seite 1von 3

double[][] val = db.

getOffsetTableData(); //get offset table data


//get sin phi and cos phi
ArrayList<Double> sinPhi = mcObj.getSinPhi(val, 1);
ArrayList<Double> cosPhi = mcObj.getCosPhi(val, 1);

double sectArea = mcObj.sectionalArea(val, 1);

double[] initGuess = mcObj.getInitGuess(val, sectArea, 1);

//get intial conditions


ArrayList<Double> thetaVal = mcObj.getThetaVal(val, cosPhi, sinPhi,
initGuess, 1);

System.out.println("theta val");
for(int i = 0; i<thetaVal.size();i++){
System.out.println(thetaVal.get(i));
}

//remove ms from initial guess coef


double[] newInitGuess = new double[initGuess.length-1];
for(int i = 0; i<newInitGuess.length; i++){
newInitGuess[i] = initGuess[i];
}

//form matrix b
double[][] bArr = mcObj.formMatrixB(val, thetaVal, newInitGuess, 1);

//form matrix a
double[][] aArr = mcObj.formMatrixA(thetaVal);

//solve the matrix


double[][] resArr = mcObj.solveMatrix(aArr, bArr);

//computing new conformal mapping coefficient using the gotten angles


from newton rapsons
double[] newCoef = mcObj.getConformMappingCoef(resArr);

//first coef after initial guess


System.out.println("Mapping Coef");
for(int i = 0; i<newCoef.length; i++){
System.out.println(newCoef[i]);
}
//getting new theta values using the first conformal mapping coeffiencts
ArrayList<Double> thetaVal1 = mcObj.getThetaVal(val, cosPhi, sinPhi,
newCoef, 1);

//get the first error


ArrayList<Double> x01 = mcObj.getX0(newInitGuess, thetaVal);
ArrayList<Double> y01 = mcObj.getY0(newInitGuess, thetaVal);
double error1 = mcObj.stopConditionLHS(val, x01, y01, 1);

//get the second error


ArrayList<Double> x02 = mcObj.getX0(newCoef, thetaVal1);
ArrayList<Double> y02 = mcObj.getY0(newCoef, thetaVal1);
double error2 = mcObj.stopConditionLHS(val, x02, y02, 1);
double stopConLHS = Math.abs(Double.parseDouble(format.format(error2 -
error1)));
System.out.println("stop condition lhs "+stopConLHS);

double bmax = mcObj.getB(val,1);


double dmax = mcObj.getD(val);

System.out.println("b1 = "+bmax+" d1 = "+dmax);

double stopConRHS =
Double.parseDouble(format.format(mcObj.stopConditionRHS(bmax, dmax,thetaVal)));
System.out.println("Stop Con RHS "+stopConRHS);

while(stopConLHS > stopConRHS){//loooping condition

ArrayList<Double> thetaVal2 = mcObj.getThetaVal(val, cosPhi, sinPhi,


newCoef, 1);
System.out.println("theta val");
for(int j = 0; j<thetaVal2.size();j++){
System.out.println(thetaVal2.get(j));
}

//form matrix b
double[][] bArr1 = mcObj.formMatrixB(val, thetaVal2, newCoef, 1);

//form matrix a
double[][] aArr1 = mcObj.formMatrixA(thetaVal2);

//solve the matri


double[][] resArr1 = mcObj.solveMatrix(aArr1, bArr1);

double[] newCoef1 = mcObj.getConformMappingCoef(resArr1);


//coef inside while loop
System.out.println("map coef");
for(int j= 0; j<newCoef1.length; j++){
System.out.println(newCoef1[j]);
}

//get the first error


ArrayList<Double> x03 = mcObj.getX0(newCoef, thetaVal1);
ArrayList<Double> y03 = mcObj.getY0(newCoef, thetaVal1);
double error3 = mcObj.stopConditionLHS(val, x03, y03, 1);

//get the second error


ArrayList<Double> x04 = mcObj.getX0(newCoef1, thetaVal2);
ArrayList<Double> y04 = mcObj.getY0(newCoef1, thetaVal2);
double error4 = mcObj.stopConditionLHS(val, x04, y04, 1);

double stopConLHS1 = Math.abs(Double.parseDouble(format.format(error4 -


error3)));
System.out.println("Stop cond LHS "+stopConLHS1);
stopConRHS =
Math.abs(Double.parseDouble(format.format(mcObj.stopConditionRHS(bmax,
dmax,thetaVal2))));

System.out.println("Stop Con RHS "+stopConRHS);


++count;
System.out.println("count "+count);

newCoef = newCoef1;
//System.arraycopy(newCoef1, 0, newCoef, 0, newCoef.length);
}

System.out.println("Final coef");
for(int i = 1; i<newCoef.length; i++){
System.out.println(newCoef[i]/newCoef[0]);
}
System.out.println("final ms "+newCoef[0]);

Das könnte Ihnen auch gefallen