Exemplo n.º 1
0
        /// <summary>
        /// Creates an instantenous state from each state. The time moment is defined as <paramref name="pointIndex"/> * <paramref name="timeStep"/>.
        /// </summary>
        /// <returns></returns>
        /// <param name="pointIndex">Index of the point for which the instantenous values will be calculated, indexing starts from 0</param>
        /// <param name="timeStep">Time step between 2 subsequent points</param>
        public InstantenousPartialStates ToInstantenousValue(int pointIndex, double timeStep)
        {
            // Create state for result
            var result = new InstantenousPartialStates(_NodeIndices, _ActiveComponentsIndices, States.Keys);

            // For each state
            foreach (var state in States)
            {
                // Use its method to calculate instantenous value at given time moment
                result.States[state.Key] = States[state.Key].ToInstantenousValues(pointIndex, timeStep);
            }

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts every state to its DC version (taking only real part from phasor - phasors for DC are purely real). If any of the sources is not,
        /// DC an exception will be thrown.
        /// </summary>
        /// <returns></returns>
        public InstantenousPartialStates ToDC()
        {
            // Create state for result
            var result = new InstantenousPartialStates(_NodeIndices, _ActiveComponentsIndices, States.Keys);

            // For each state
            foreach (var state in States)
            {
                // Use its method to convert to DC
                result.States[state.Key] = States[state.Key].ToDC();
            }

            return(result);
        }