private void NewtonIterationProcess_CalculateMCoefficient_ValidMCoefficient() { FillListsCoordinationData(PathToTestTxt, out var listSrc, out var listDest); var nip = new NewtonIterationProcess(listSrc, listDest); var aMatrix = nip.FormingAMatrixTst(); var yMatrix = nip.FormingYMatrixTst(); var paramsTransformMatrix = nip.GetVectorWithTransformParametersTst(aMatrix, yMatrix); var vMatrix = nip.GetVMatrixTst(aMatrix, yMatrix, paramsTransformMatrix); var fCoefficient = nip.CalculateFCoefficientTst(vMatrix); var mCoefficientActual = nip.CalculateMCoefficientTst(fCoefficient); var mCoefficientExpected = 0.000126585; Assert.Equal(mCoefficientExpected, mCoefficientActual, 6); // 10^-6 m }
private void NewtonIterationProcess_GetMeanSquareErrorsMatrix_ValidMeanSquareErrorsMatrix() { FillListsCoordinationData(PathToTestTxt, out var listSrc, out var listDest); var mceMatrixActual = ReadControlDataFromFile(PathToTestTxt + "\\mceMatrix.txt", 7, 1); var nip = new NewtonIterationProcess(listSrc, listDest); var aMatrix = nip.FormingAMatrixTst(); var yMatrix = nip.FormingYMatrixTst(); var paramsTransformMatrix = nip.GetVectorWithTransformParametersTst(aMatrix, yMatrix); var vMatrix = nip.GetVMatrixTst(aMatrix, yMatrix, paramsTransformMatrix); var fCoefficient = nip.CalculateFCoefficientTst(vMatrix); var mCoefficient = nip.CalculateMCoefficientTst(fCoefficient); var qMatrix = nip.GetQMatrixTst(aMatrix); var mceMatrixExpected = nip.GetMeanSquareErrorsMatrixTst(qMatrix, mCoefficient); for (int row = 0; row < mceMatrixExpected.Count; row++) { Assert.Equal(mceMatrixExpected[row], mceMatrixActual[row, 0], 8); } }