Exemple #1
0
        internal LoadIncrementalStateResult Correct(LoadState state, LoadIncrementalState prediction, StructureInfo info)
        {
            LoadIncrementalStateResult result        = new LoadIncrementalStateResult(null, false, "");
            LoadState            initialState        = state;
            LoadState            currentState        = initialState;
            LoadIncrementalState predictionIncrement = prediction;

            for (int iteration = 1; iteration <= MaximumIterations; iteration++)
            {
                LoadIncrementalStateResult correction = GetCorrection(currentState, predictionIncrement, info);
                predictionIncrement.Add(correction.IncrementalState);
                LoadState     newState    = currentState.Add(correction.IncrementalState);
                List <double> errors      = GetErrors(newState, currentState, info).ToList( );
                bool          convergence = CheckConvergence(errors, Tolerances);
                currentState = newState;
                if (convergence)
                {
                    break;
                }

                if (iteration >= MaximumIterations)
                {
                    result.Message = Strings.MaxNumberOfIterationsReached;
                    result.Success = false;
                }
            }

            result.IncrementalState = currentState.Substract(initialState);

            return(result);
        }
Exemple #2
0
        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);
        }
        /// <summary>
        /// Broadcasts every LoadState the solverNd reaches in the equilibrium path.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <LoadState> Broadcast( )
        {
            Matrix <double> mK0 = Info.Stiffness(State.Displacement);
            Vector <double> Dv0 = mK0.Solve(Info.ReferenceLoad);
            double          k0  = Info.ReferenceLoad.DotProduct(Dv0);

            while (true)
            {
                LoadIncrementalStateResult prediction = Predictor.Predict(State, k0, Info);
                State = State.Add(prediction.IncrementalState);
                LoadIncrementalStateResult correction = Corrector.Correct(State, prediction.IncrementalState, Info);
                State = State.Add(correction.IncrementalState);
                yield return(State);
            }
        }