using System; using System.Collections.Generic; namespace Deltares.Stability.Calculation.Inner { public class TDesignpointExternalLevel { // internal data private double FAlfaH = 0; private double FBeta = 0; private double FDecimate = 0; private double FDelta = 0; private double FDeltaFactor = 0; private double FDesignLevel = 0; private TDump FDump = null; // FExceedfrequency: Double; private TExternalLevelFrequency FExceed; private TExceedingFrequencySet FExceedfrequencyParameter; private double FHOntwerp = 0; private double FHwaterAlfa = 0; private double[] FImportBetas; private double[] FImportWaterlevels; private int FNPLSets = 0; private TprobabilisticData FProbData; private int FloopCount = 0; public TDump Dump { get { return FDump; } set { FDump = value; } } public double Beta { get { return FBeta; } set { FBeta = value; } } public double HOntwerp { get { return FHOntwerp; } set { FHOntwerp = value; } } public int LoopCount { get { return FloopCount; } set { FloopCount = value; } } public double HwaterAlfa { get { return FHwaterAlfa; } set { FHwaterAlfa = value; } } public double AlfaH { get { return FAlfaH; } set { FAlfaH = value; } } public TExternalLevelFrequency Exceed { get { return FExceed; } set { FExceed = value; } } public void AddexternalLevelData() { // Short cut List LProbResults = FDump.ProbResults; // Get levels and beta's from the dump FDesignLevel = FExceed.DesignLevel; FExceedfrequencyParameter = Exceed.ExceedingFrequency; FDecimate = FExceed.DecimationHeigth; FNPLSets = LProbResults.Count; FImportBetas = new double[FNPLSets]; FImportWaterlevels = new double[FNPLSets]; for (int i = 0; i < LProbResults.Count; i ++) { FImportBetas[i] = LProbResults[i].beta; FImportWaterlevels[i] = LProbResults[i].WaterLevel; } // Sort beta's (needed for interpolation) SortBetas(); if (LProbResults.Count > 0) { CalculateDesignpointExternalWater(); } } // FWaterlevels: TDoubleArray; // ======================================================================================================================= // // Procedure : GetSlope // // Declared in unit : ProbWat (Internal) // // Description : Calculates the slope of a curve at a xcoor // // Last Update 000627 : (Best) Created // // Name Type Function // ---- ---- -------- // Parameters - IN : Heigth Double Heigth of point // // Pre-condition : // // Post-condition : // // Comments : None // // Example call : // .... // 2007-09-05 Best // ======================================================================================================================= private double GetSlope(double heigth) { double result; int i; result = 0; if ((heigth <= FImportWaterlevels[1])) { result = slope(FImportWaterlevels[0], FImportBetas[0], FImportWaterlevels[1], FImportBetas[1]); } else if (heigth >= FImportWaterlevels[FNPLSets - 2]) { result = slope(FImportWaterlevels[FNPLSets - 2], FImportBetas[FNPLSets - 2], FImportWaterlevels[FNPLSets - 1], FImportBetas[FNPLSets - 1]); } else { for (i = 1; i <= FNPLSets - 3; i ++) { if ((heigth >= FImportWaterlevels[i]) && (heigth <= FImportWaterlevels[i + 1])) { result = slope(FImportWaterlevels[i], FImportBetas[i], FImportWaterlevels[i + 1], FImportBetas[i + 1]); } } } return result; } // ======================================================================================================================= // Date ID Modification // 2003-05-28 Best Created // ======================================================================================================================= private double GetNearestLevel(double HOntwerp, ref int ASetNumber) { double result; int i; double value; bool ready; ready = false; value = FImportWaterlevels[0]; if ((HOntwerp <= FImportWaterlevels[0])) { value = FImportWaterlevels[0]; ASetNumber = 0; } else if ((HOntwerp >= FImportWaterlevels[FNPLSets - 1])) { value = FImportWaterlevels[FNPLSets - 1]; ASetNumber = FNPLSets - 1; } else { i = -1; do { i ++; if ((HOntwerp > FImportWaterlevels[i]) && (HOntwerp < FImportWaterlevels[i + 1])) { ready = true; if ((Math.Abs(HOntwerp - FImportWaterlevels[i]) < Math.Abs(HOntwerp - FImportWaterlevels[i + 1]))) { value = FImportWaterlevels[i]; ASetNumber = i; } else { value = FImportWaterlevels[i + 1]; ASetNumber = i + 1; } } } while (!(ready || (i == FNPLSets - 2))); } result = value; return result; } // ======================================================================================================================= // Date ID Modification // 2003-05-28 Best Created // ======================================================================================================================= private double GetInverse(double axu) { double result; double value; value = Math.Exp(-Math.Exp(axu)); result = MStabDatafunctions.NormalDistrInverse(value); return result; } // ======================================================================================================================= // Date ID Modification // 2003-05-28 Best Created // ======================================================================================================================= private double GetGamma(double alfa, double axu, double Inverse) { double result; double pdf; // probability density function from gumbel pdf = alfa*Math.Exp(axu - Math.Exp(axu)); result = Math.Exp(-0.5*Inverse*Inverse)/(pdf*Math.Sqrt(2*Math.PI)*FDecimate); return result; } // ======================================================================================================================= // // Procedure : Slope // // Declared in unit : ProbWat (Internal) // // Description : Calculates the slope (a:b) betweem 2 points // // Last Update 000627 : (Best) Created // // Name Type Function // ---- ---- -------- // Parameters - IN : x1,y1 Double First point // x2,y2 Double Second point // // Pre-condition : // // Post-condition : // // Comments : None // // Example call : // .... // 2007-09-05 Best // ======================================================================================================================= private double slope(double x1, double y1, double x2, double y2) { double result; result = (y2 - y1)/(x2 - x1); return result; } // ======================================================================================================================= // // Function : GetBeta(HOntwerp) // // Declared in unit : ProbWat (Internal) // // Description : Finds by interpolation the beta given a H // // Last Update 000627 : (Best) Created // // Name Type Function // ---- ---- -------- // Parameters - IN : HOntwerp Double The Heigth // // Pre-condition : // // Post-condition : // // Comments : None // // Example call : // 2007-09-05 Best // ======================================================================================================================= private double GetBeta(double HOntwerp) { double result; int i; bool Ready; i = -1; result = 0; do { // ... Is HOntwerp on a point ... i ++; Ready = (Math.Abs(HOntwerp - FImportWaterlevels[i]) < Constants.CEpsMin); if (Ready) { result = FImportBetas[i]; } } while (!(Ready || (i == FNPLSets - 1))); if (!Ready) { // ... Is HOntwerp between the points ... i = -1; do { i ++; Ready = (HOntwerp < Math.Max(FImportWaterlevels[i], FImportWaterlevels[i + 1])) && (HOntwerp > Math.Min(FImportWaterlevels[i], FImportWaterlevels[i + 1])); if (Ready) { // beta in between result = MStabDatafunctions.LinInpolY(FImportWaterlevels[i], FImportBetas[i], FImportWaterlevels[i + 1], FImportBetas[i + 1], HOntwerp); } } while (!(Ready || (i == FNPLSets - 2))); if (!Ready) { // ... HOntwerp is outside the points range ... if ((HOntwerp > FImportBetas[FNPLSets - 1])) { result = MStabDatafunctions.LinInpolY(FImportWaterlevels[FNPLSets - 2], FImportBetas[FNPLSets - 2], FImportWaterlevels[FNPLSets - 1], FImportBetas[FNPLSets - 1], HOntwerp); } else { if ((FNPLSets > 1)) { result = MStabDatafunctions.LinInpolY(FImportWaterlevels[0], FImportBetas[0], FImportWaterlevels[1], FImportBetas[1], HOntwerp); } else { result = FImportBetas[0]; } } } } return result; } // procedure GetAndWriteAlfas(var Lfw: Text); // procedure GetAndWriteAlfasProstab(var Lfw: Text); // ======================================================================================================================= // Date ID Modification // 2003-05-28 Best Created // ======================================================================================================================= private double GetGumbel() { double result; double LFaal; switch (FExceed.ExceedingFrequency) { case TExceedingFrequencySet.efTenThousand: LFaal = 1/10000; break; case TExceedingFrequencySet.efFourThousand: LFaal = 1/4000; break; case TExceedingFrequencySet.efTwoThousend: LFaal = 1/2000; break; default: LFaal = 1/1250; break; } result = Math.Log(-Math.Log(1 - LFaal))/(2.3/FDecimate) + FDesignLevel; return result; } // (* // {======================================================================================================================= // // Procedure : FillLocalBetas // // Declared in unit : ProbWat (Internal) // // Description : Fills the local beta aray with heigths and betas // // Last Update 000627 : (Best) Created // // Name Type Function // ---- ---- -------- // Parameters - IN : // // Pre-condition : The waterlevels an beta arrays must be filled // // Post-condition : Te data is copied to the local array // Comments : None // // Example call : // .... // 2007-09-05 Best // =======================================================================================================================} // procedure TDesignpointExternalLevel.fillLocalBetas; // var // i: Integer; // LNumber: Integer; // begin // LNumber := 0; // for i := Low(FImportBetas) to High(FImportBetas) do // begin // Inc(LNumber); // {put waterlevels and betas in 1 local array} // FLocBetas[1][LNumber] := FWaterlevels[i]; // FLocBetas[2][LNumber] := FImportBetas[i]; // end; // FNPLSets := LNumber; // end; // *) // ======================================================================================================================= // // Procedure : SwapLevels // // Declared in unit : ProbWat (Internal) // // Description : Data of the local beta aray is swaped when sorting // // Last Update 000627 : (Best) Created // // Name Type Function // ---- ---- -------- // Parameters - IN : FromLevel integer // Tolevel integer // // Pre-condition : // // Post-condition : The data in fromlevel is copied to the // data in tolevel and vice versa // // Comments : None // // Example call : // .... // 2007-09-05 Best // ======================================================================================================================= private void SwapLevels(int FromLevel, int ToLevel) { double Ltmp1; double Ltmp2; Ltmp1 = FImportBetas[ToLevel]; Ltmp2 = FImportWaterlevels[ToLevel]; FImportBetas[ToLevel] = FImportBetas[FromLevel]; FImportWaterlevels[ToLevel] = FImportWaterlevels[FromLevel]; FImportBetas[FromLevel] = Ltmp1; FImportWaterlevels[FromLevel] = Ltmp2; } // ======================================================================================================================= // // Procedure : SortLocalBetas // // Declared in unit : ProbWat (Internal) // // Description : the first column of data of the local beta aray // is sorted from low to high // // Last Update 000627 : (Best) Created // // Name Type Function // ---- ---- -------- // Parameters - IN : // // Pre-condition : // // Post-condition : The data is sorted // // Comments : None // // Example call : // .... // 2007-09-05 Best // ======================================================================================================================= private void SortBetas() { int i; int j; for (i = 0; i < FNPLSets; i ++) { for (j = i; j < FNPLSets; j ++) { if (FImportBetas[j] < FImportBetas[i]) { SwapLevels(j, i); } } } } // procedure BetaOutputWaterlevelsIncluded(Ready: Boolean); // ======================================================================================================================= // DumpBetaIncludingWaterlevels can only be called after the waterdesignpoint is calculated // // Date ID Modification // 2003-09-11 Best Created // 2007-06-07 Vks Attempted to make MStab work // ======================================================================================================================= private void DumpBetaIncludingWaterlevels(int ASetNumber) { FProbData.beta = FBeta; FProbData.Faalkans = MStabDatafunctions.NormalDistribution(-Beta); FProbData.WaterLevel = FHOntwerp; FProbData.WaterlevelName = Constants.sProbRandomWater; // (* // WriteLn(lfd, sProbRandomWater); // WriteLn(lfd, FBeta: 12: 5, ' = ' + sBetaText[GLO] + ' '); // // LFaalkans := NormalDistribution(-Beta); // if LFaalkans > 0.001 then // WriteLn(lfd, LFaalkans: 12: 5, sProbabilityOfFailure[GLO]) // else // WriteLn(lfd, LFaalkans: 12, sProbabilityOfFailure[GLO]); // // WriteLn(lfd, FHOntwerp: 12: 5, sDesignValueWaterlevel[GLO]); // WriteLn(lfd, sDesignPointWaterLevel[GLO]); // WriteLn(lfd, ASetNumber: 12, sSetNumberClosestToDesignValueWaterlevel[GLO]); // WriteLn(lfd, FAlfaH: 12: 5, sUValueWaterlevel[GLO]); // WriteLn(lfd, sEndOfProbRandomWater); // *) } // ======================================================================================================================= // Date ID Modification // 2003-05-28 Best Created // 2003-07-28 Best FBeta in repeat loop // 2007-10-01 Best New routine added Decrease steps if solution failes // ======================================================================================================================= private bool CalculateDesignpointExternalWater() { bool result; // dumpr: Boolean; bool LReady; // AlfaH: Double; // Lferr: Text; double UGumbel = 0; double dBetadH = 0; double HNew = 0; double Gamma = 0; double Inverse = 0; double Ehn = 0; double Ez = 0; double Shn = 0; double Sz = 0; double axu = 0; double alfa = 0; int LSetNumber = 0; LReady = false; // dumpr := False; FDeltaFactor = 1; HNew = 0; double tmp = double.NaN; // bepaal de parameters van de equivalente normale verdeling if ((FDecimate > 0.001)) { UGumbel = GetGumbel(); alfa = 2.3/FDecimate; // Startwaarde voor H FHOntwerp = FDesignLevel; FloopCount = 0; do { // find beta on curve FBeta = GetBeta(FHOntwerp); // check if this beta is equal to previous // if this is the case exit the loop because // it will be endless.... if (FBeta == tmp) { break; } tmp = FBeta; axu = -alfa*(FHOntwerp - UGumbel); Inverse = GetInverse(axu); if ((Math.Abs(Inverse) < Math.Sqrt(Constants.CMaxDouble) - 1)) { Gamma = GetGamma(alfa, axu, Inverse); Ehn = HOntwerp - Inverse*Gamma*FDecimate; Shn = Gamma*FDecimate; dBetadH = GetSlope(HOntwerp); FloopCount ++; Ez = FBeta + dBetadH*(Ehn - HOntwerp); Sz = Math.Sqrt(1 + dBetadH*dBetadH*Shn*Shn); FBeta = Ez/Sz; FAlfaH = dBetadH*Shn/Sz; HNew = UGumbel - FDecimate/2.3*Math.Log(-Math.Log(MStabDatafunctions.NormalDistribution(-FBeta*FAlfaH))); // HNew := Ehn - Beta * FalfaH * Shn; // (* if dumpr then // begin // Write(LFErr, loopcount: 3, ' '); // Write(LFErr, Gamma: 7: 2, ' '); // Write(LFErr, FHOntwerp: 7: 2, ' '); // Write(LFErr, dBetadH: 7: 2, ' '); // Write(LFErr, Ez: 7: 2, ' '); // Write(LFErr, Sz: 7: 2, ' '); // Write(LFErr, FBeta: 7: 2, ' '); // Write(LFErr, HNew: 7: 2, ' '); // Write(LFErr, Ehn: 7: 2, ' '); // WriteLn(LFErr, Shn: 7: 2); // Close(Lferr); // end; // *) FDelta = HNew - FHOntwerp; LReady = (Math.Abs(FDelta) < 0.001); FHOntwerp = FHOntwerp + FDeltaFactor*FDelta; } else { // error find old FHOntwerp and use smaller steps // only if 1 step is already calculated FDeltaFactor = FDeltaFactor*0.5; if ((FloopCount > 0)) { FHOntwerp = HNew - FDelta; FDelta = 0.5*FDelta; FHOntwerp = FHOntwerp + FDeltaFactor*FDelta; } } } while (!(LReady || (FloopCount > 50))); result = LReady; if (result) { FHwaterAlfa = GetNearestLevel(FHOntwerp, ref LSetNumber); DumpBetaIncludingWaterlevels(LSetNumber); FDump.AddProbabilisticData(FProbData); } } else { result = false; } return result; } // procedure SortAndWritePcRingFileProstab; // (* // {======================================================================================================================= // Date ID Modification // 2003-05-28 Best Created // =======================================================================================================================} // procedure TDesignpointExternalLevel.BetaOutputWaterlevelsIncluded(Ready: Boolean); // var // lfw: Text; // begin // // Assign(lfw, GDGlobals.OutputfileName); // try // Append(lfw); // WriteLn(lfw); // WriteLn(lfw); // WriteLn(lfw); // WriteLn(lfw); // WriteLn(lfw, sComputationOfIndexOfReliability[GLO]); // WriteLn(lfw, sIncludingTheEffectOfRandomnessOfExtremeWaterlevels[GLO]); // WriteLn(lfw, DoubleLine(sIncludingTheEffectOfRandomnessOfExtremeWaterlevels[GLO])); // WriteLn(lfw); // if (not ready) then // WriteLn(lfw, sNoConvergencyAfter[GLO], (Floopcount): 3, // sStepsInTheIterationprocess[GLO]) // else // begin // WriteLn(lfw, sReliabilityIndex[GLO], FBeta: 11: 3); // WriteLn(lfw, sDesignValueHighWater[GLO], FHOntwerp: 11: 3); // WriteLn(lfw, sNumberOfIterations[GLO], FLoopcount: 11); // // if (MyGlobals.Model.CalcType = BishopProb) then // GetAndWriteAlfasProstab(Lfw) // else // begin // GetAndWriteAlfas(Lfw); // end; // end; // finally // Close(lfw); // end; // // end; // *) // (* // {======================================================================================================================= // Description: Description : Wordt gebruikt voor de correctie // van de betrouwbaargheids index voor de waterstands // stochastiek. Deze routine bewaart de Pnlijnen uit de geometrie // // Date ID Modification // 2002-12-06 Best Created // =======================================================================================================================} // procedure TDesignpointExternalLevel.GetAndWriteAlfas(var Lfw: Text); // var // Lfd: Text; // HWater: Double; // som: Double; // achar: string[1]; // LAlfa: array[1..8] of Double; // I, J: Integer; // LPSets: Integer; // begin // // Assign(lfd, GDGlobals.BasisFileName + EX_PCRdump); // Reset(lfd); // for i := 1 to 9 do // ReadLn(lfd); // // LPSets := 0; // repeat // Inc(LPSets); // begin // for i := 1 to 20 do // Read(lfd, achar); // ReadLn(lfd, HWater); // if (Abs(HWater - FHwaterAlfa) < 0.001) then // begin // ReadLn(lfd); { beta} // for I := 1 to 5 do // begin // for j := 1 to 18 do // Read(lfd, aChar); // ReadLn(lfd, Lalfa[i]); // end; // end // else // for i := 1 to 6 do // ReadLn(lfd); // end // until (LPSets = MyGlobals.StochasticWaterList.Count); // Close(lfd); // // som := FalfaH * FAlfaH; // for i := 1 to 5 do // begin // som := som + Lalfa[i] * Lalfa[i]; // end; // // WriteLn(Lfw); // WriteLn(lfw, sAlfas[GLO]); // WriteLn(lfw, ' =============================== '); // WriteLn(lfw, sUncertaintyAverageValueCohesion[GLO], LAlfa[1] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyAverageValueTanphi[GLO], LAlfa[2] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyExcessPorePressure[GLO], LAlfa[3] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyFreaticLine[GLO], LAlfa[4] / Sqrt(som): 7: 3); // WriteLn(lfw, sModelUncertainty[GLO], LAlfa[5] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyWaterLevel[GLO], FAlfaH / Sqrt(som): 7: 3); // // end; // *) // (* // {======================================================================================================================= // Description: Description : Sorts output for pcring to waterleveld // from low to high // // Date ID Modification // 2002-12-06 Best Created // =======================================================================================================================} // procedure TDesignpointExternalLevel.SortAndWritePcRingFileProstab; // var // Lfd: Text; // LNStochasten: Integer; // LHWater: Double; // LDum: Double; // achar: string[1]; // I, J: Integer; // Ltemp: Integer; // LNLevel: Integer; // LNumber: Integer; // LdataArr: array of array of Double; // LIndex: array of Integer; // LLine: string; // // LStringList: TStringList; // begin // Assign(lfd, GDGlobals.BasisFileName + CPCRingEx); // Reset(lfd); // try // ReadLn(lfd); // ReadLn(lfd, LNStochasten); // ReadLn(lfd); // for i := 1 to LNStochasten do // begin // ReadLn(lfd); // end; // // LNLevel := 0; // ReadLn(lfd); {dijkvak} // repeat // ReadLn(lfd, LLine); // LStringList := TStringList.Create; // try // GetSubStrings(LLine, LStringList); // if (LStringList.Count > 0) then // begin // if (CompareText(trim(LStringList[0]), sLocale[GLO]) = 0) then // begin // Inc(LNLevel); // SetLength(LDataArr, LNLevel, LNStochasten + 2); // LHWater := StrToFloatDs(LStringList[2]); // LdataArr[LNLevel - 1, 0] := LHWater; // for i := 1 to LNStochasten + 1 do // begin // for j := 1 to 18 do // Read(lfd, aChar); // ReadLn(lfd, Ldum); // LdataArr[LNLevel - 1, i] := Ldum; // end; // end; // end; // finally // LStringList.Free; // end; // until Eof(lfd) // finally // CloseFile(Lfd) // end; // // SetLength(LIndex, LNLevel); // for i := 0 to LNLevel - 1 do // LIndex[i] := i; // // {fill index from low to high} // // for i := 0 to LNLevel - 1 do // begin // for j := i to LNLevel - 1 do // begin // if LDataArr[LIndex[j], 0] < LDataArr[LIndex[i], 0] then // begin // Ltemp := LIndex[j]; // LIndex[j] := LIndex[i]; // LIndex[i] := Ltemp; // end; // end; // end; // // {schrijf de PC-rinfg file gesorteerd} // AssignFile(lfd, GDGlobals.BasisFileName + CPCRingEx); // Rewrite(lfd); // try // if (LNStochasten = 8) then // begin // WriteLn(lfd, sPCRingStabiliteitVanTaluds); // WriteLn(lfd, sPCRing8Stochasten); // WriteLn(lfd, sPCRingOmschrijvingStochasten); // WriteLn(lfd, sPCRing1FluctuatiesCohesie); // WriteLn(lfd, sPCRing2OnzekerheidGemWaardeCohesie); // WriteLn(lfd, sPCRing3FluctuatiesTanphi); // WriteLn(lfd, sPCRing4OnzekerheidGemWaardeTanphi); // WriteLn(lfd, sPCRing5CorrelatieCohesieEnTanphi); // WriteLn(lfd, sPCRing6OnzekerheidWateroverspanning); // WriteLn(lfd, sPCRing7OnzekerheidFreatischeLijn); // WriteLn(lfd, sPCRing8ModelOnzekerheid); // WriteLn(lfd, sPCRingDijkvak); // // for i := 0 to LNLevel - 1 do // begin // LNumber := LIndex[i]; // WriteLn(lfd, sPCRingLocaleWaterstand, LDataArr[LNumber, 0]: 9: 4); // WriteLn(lfd, sPCRingBetaIs, LDataArr[LNumber][1]: 9: 6); // WriteLn(lfd, sPCRingAlfa1, LDataArr[LNumber, 2]: 9: 6); // WriteLn(lfd, sPCRingAlfa2, LDataArr[LNumber, 3]: 9: 6); // WriteLn(lfd, sPCRingAlfa3, LDataArr[LNumber, 4]: 9: 6); // WriteLn(lfd, sPCRingAlfa4, LDataArr[LNumber, 5]: 9: 6); // WriteLn(lfd, sPCRingAlfa5, LDataArr[LNumber][6]: 9: 6); // WriteLn(lfd, sPCRingAlfa6, LDataArr[LNumber, 7]: 9: 6); // WriteLn(lfd, sPCRingAlfa7, LDataArr[LNumber, 8]: 9: 6); // WriteLn(lfd, sPCRingAlfa8, LDataArr[LNumber][9]: 9: 6); // end; // end // else // begin // WriteLn(lfd, sPCRingStabiliteitVanTaluds); // WriteLn(lfd, sPCRing5Stochasten); // WriteLn(lfd, sPCRingOmschrijvingStochasten); // WriteLn(lfd, sPCRing1OnzekerheidGemWaardeCohesie); // WriteLn(lfd, sPCRing2OnzekerheidGemWaardeTanphi); // WriteLn(lfd, sPCRing3OnzekerheidWateroverspanning); // WriteLn(lfd, sPCRing4OnzekerheidFreatischeLijn); // WriteLn(lfd, sPCRing5ModelOnzekerheid); // WriteLn(lfd, sPCRingDijkvak); // // for i := 0 to LNLevel - 1 do // begin // LNumber := LIndex[i]; // WriteLn(lfd, sPCRingLocaleWaterstand, LDataArr[LNumber, 0]: 9: 4); // WriteLn(lfd, sPCRingBetaIs, LDataArr[LNumber][1]: 9: 6); // WriteLn(lfd, sPCRingAlfa1, LDataArr[LNumber, 2]: 9: 6); // WriteLn(lfd, sPCRingAlfa2, LDataArr[LNumber, 3]: 9: 6); // WriteLn(lfd, sPCRingAlfa3, LDataArr[LNumber, 4]: 9: 6); // WriteLn(lfd, sPCRingAlfa4, LDataArr[LNumber, 5]: 9: 6); // WriteLn(lfd, sPCRingAlfa5, LDataArr[LNumber][6]: 9: 6); // end; // end; // finally // LDataArr := nil; // LIndex := nil; // CloseFile(lfd); // end; // end; // *) // (* // {======================================================================================================================= // Date ID Modification // 2003-06-05 Best Created // =======================================================================================================================} // procedure TDesignpointExternalLevel.GetAndWriteAlfasProstab(var Lfw: Text); // var // Lfd: Text; // LFase: Integer; // // alpah1: Double; // HWater: Double; // som: Double; // achar: string[1]; // LAlfa: array[1..8] of Double; // I, J: Integer; // LPSets, FasLoop: Integer; // begin // // LFase := 1; // Assign(lfd, GDGlobals.BasisFileName + EX_PCRdump); // Reset(lfd); // for i := 1 to 12 do // ReadLn(lfd); // // LPSets := 0; // repeat // Inc(LPSets); // fasloop := 0; // repeat // Inc(fasloop); // if (fasloop = Lfase) then // begin // for i := 1 to 20 do // Read(lfd, achar); // ReadLn(lfd, HWater); // if (Abs(HWater - FHwaterAlfa) < 0.001) then // begin // ReadLn(lfd); { beta} // for I := 1 to 8 do // begin // for j := 1 to 18 do // Read(lfd, aChar); // ReadLn(lfd, Lalfa[i]); // end; // end // else // for i := 1 to 9 do // ReadLn(lfd); // end // else // for i := 1 to 10 do // ReadLn(lfd); // until (fasloop >= NFase); // until (LPSets >= NPLSets); // Close(lfd); // // som := FalfaH * FAlfaH; // for i := 1 to 8 do // begin // som := som + Lalfa[i] * Lalfa[i]; // end; // // WriteLn(Lfw); // WriteLn(lfw, sAlfas[GLO]); // WriteLn(lfw, ' =============================== '); // WriteLn(lfw, sFluctuationCohesion[GLO], LAlfa[1] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyAverageValueCohesion[GLO], LAlfa[2] / Sqrt(som): 7: 3); // WriteLn(lfw, sFluctuationTanphi[GLO], LAlfa[3] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyAverageValueTanphi[GLO], LAlfa[4] / Sqrt(som): 7: 3); // WriteLn(lfw, sCorrelationCohesionAndTanphi[GLO], LAlfa[5] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyExcessPorePressure[GLO], LAlfa[6] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyFreaticLine[GLO], LAlfa[7] / Sqrt(som): 7: 3); // WriteLn(lfw, sModelUncertainty[GLO], LAlfa[8] / Sqrt(som): 7: 3); // WriteLn(lfw, sUncertaintyWaterLevel[GLO], FAlfaH / Sqrt(som): 7: 3); // // end; // *) } // end TDesignpointExternalLevel }