Beispiel #1
0
        static public Solution Solve(DAESEDescription equations, DAESESolver solver)
        {
            List <double[]> values    = new List <double[]>();
            List <double>   timeArray = new List <double>();
            XZVectorPair    xz        = new XZVectorPair
            {
                X = Vector <double> .Build.Dense(equations.InitialValuesX),
                Z = Vector <double> .Build.Dense(equations.InitialValuesX)
            };
            DAESEAnalytic system = new DAESEAnalytic(equations);

            values.Add(xz.ToArray());
            timeArray.Add(equations.T0);
            for (double t = 0.0; t < equations.Time;)
            {
                double ti = t + equations.T0;
                t += solver.step;
                xz = solver.IntegrateStep(system, xz, ti);
                values.Add(xz.ToArray());
                double tnext = t + equations.T0;
                timeArray.Add(tnext);
            }
            string[] variables = equations.VariableNames;
            return(new Solution(values, timeArray, variables));
        }
Beispiel #2
0
 public DAESEAnalytic(DAESEDescription description)
 {
     fEquations    = description.F.ToArray();
     gEquations    = description.G.ToArray();
     SizeX         = description.SizeX;
     SizeZ         = description.SizeZ;
     dFdXequations = description.DfdX;
     dFdZequations = description.DfdZ;
     dGdXequations = description.DgdX;
     dGdZequations = description.DgdZ;
 }