LoadIncrementalStateResult GetCorrection(LoadState state, LoadIncrementalState prediction, StructureInfo info) { Matrix <double> stiffnessMatrix = info.Stiffness(state.Displacement); Vector <double> dut = stiffnessMatrix.Solve(info.ReferenceLoad); Vector <double> reaction = info.Reaction(state.Displacement); Vector <double> equilibrium = info.InitialLoad + state.Lambda * info.ReferenceLoad - reaction; Vector <double> dur = stiffnessMatrix.Solve(equilibrium); LoadIncrementalStateResult incrementalStateResult = Scheme.GetCorrection(state, prediction, info, dut, dur); return(incrementalStateResult); }
IEnumerable <double> GetErrors(LoadState newState, LoadState oldState, StructureInfo info) { Vector <double> reaction = info.Reaction(newState.Displacement); Vector <double> equilibrium = info.InitialLoad + newState.Lambda * info.ReferenceLoad - reaction; Vector <double> incrementDisplacement = newState.Displacement - oldState.Displacement; yield return(incrementDisplacement.Norm(2) / newState.Displacement.Norm(2)); yield return(equilibrium.Norm(2) / info.ReferenceLoad.Norm(2)); yield return(Math.Abs(newState.Displacement.DotProduct(equilibrium) / newState.Displacement.DotProduct(info.ReferenceLoad))); }
public LoadIncrementalStateResult Choose(StructureInfo info, LoadState state, LoadIncrementalState prediction, IEnumerable <LoadIncrementalState> candidates) { List <LoadIncrementalState> candidateList = candidates.ToList( ); if (candidateList.Any( )) { double Function(LoadIncrementalState candidate) { Vector <double> displacement = state.Displacement + candidate.IncrementDisplacement; Vector <double> reaction = info.Reaction(displacement); double lambda = state.Lambda + candidate.IncrementLambda; Vector <double> equilibriumVector = info.InitialLoad + lambda * info.ReferenceLoad - reaction; return(equilibriumVector.Norm(2)); } LoadIncrementalState result = candidateList.MinBy(Function).First( ); return(new LoadIncrementalStateResult(result, true, "")); } return(new LoadIncrementalStateResult(null, false, "")); }
/// <summary> /// Predicts a LoadIncrementalState. /// </summary> /// <param name="state"></param> /// <param name="initialStiffness"></param> /// <returns></returns> internal LoadIncrementalStateResult Predict(LoadState state, double initialStiffness, StructureInfo info) { Vector <double> equilibrium = info.InitialLoad + state.Lambda * info.ReferenceLoad - info.Reaction(state.Displacement); Matrix <double> mK = info.Stiffness(state.Displacement); Vector <double> Dvt = mK.Solve(info.ReferenceLoad); Vector <double> Dvr = mK.Solve(equilibrium); double bergam = GetBergamParameter(initialStiffness, Dvt, info); double DLambda = Scheme.GetPrediction(Dvt, info.ReferenceLoad) * Math.Sign(bergam); Vector <double> Dv = DLambda * Dvt + Dvr; return(new LoadIncrementalStateResult(new LoadIncrementalState(DLambda, Dv), true, "")); }