public SteadyStateEquation(List <decimal> values, SteadyStateValue equivalent) { SteadyStateValues = new List <SteadyStateValue>(); for (int i = 0; i < values.Count; i++) { SteadyStateValues.Add(new SteadyStateValue((i + 1).ToString(), values[i])); } Equivalent = equivalent; }
private void SubstituteIntoOne() //NOTE: This method assumes that all equations are solved in terms of π1 { decimal sum = 0; string equation = ""; for (int i = 0; i < steadyStateEquations.Count - 1; i++) { SteadyStateValue subableValue = steadyStateEquations[i].SteadyStateValues.First(); sum += subableValue.Value; equation += $"{subableValue} + "; } SteadyStateValue lastSubableValue = steadyStateEquations.Last().SteadyStateValues.First(); sum += lastSubableValue.Value; equation += $"{lastSubableValue} = 1"; writeSubstituteIntoOneTex(sum, equation); adjustAll(1 / sum); }