示例#1
0
 public ContinuousSystem(State state)
 {
     this.variables = (string[])state.continuousNames.Clone();
     initialSet     = state.flowpipe;
     ptr            = CreateContinuousSystem(state.continuousNames.Length);
     SetInitialSetContinuousSystem(ptr, initialSet.ptr);
 }
示例#2
0
        public Flowpipe AdvancePolynomial(TaylorModelVec ODE, double time, int order, double step, double miniStep, double[] estimation)
        {
            IntPtr hfOde   = CreateODE(ODE.ptr);
            IntPtr current = this.ptr;
            IntPtr result  = IntPtr.Zero;
            double curStep = step;

            for (double t = 0.0; t < time; t += step)
            {
                if (t + step > time)
                {
                    curStep = time - t;
                }
                while (!AdvanceLowDegreeFlowpipe(ref result, current, ODE.ptr, hfOde, curStep, order, Flowstar.QR_Precondition, numVars, estimation))
                {
                    for (int i = 0; i < estimation.Length; ++i)
                    {
                        estimation[i] *= 2;
                    }
                    if (estimation[0] > 100000)
                    {
                        throw new FlowpipeException("Cannot find good estimation for the flowpipe");
                    }
                }

                current = result;
            }
            Flowpipe res = Flowpipe.FromPtr(result, numVars);

            return(res);
        }
示例#3
0
        public static Flowpipe FromPtr(IntPtr flowpipe, int numVars)
        {
            Flowpipe result = new Flowpipe();

            result.ptr     = flowpipe;
            result.numVars = numVars;
            return(result);
        }
示例#4
0
        public Flowpipe ReachNonPolynomial(double step, ref double miniStep, double time, int order, double[] estimation, bool bPrint = false)
        {
            IntPtr result = ReachNonPolynomialAdaptiveStepContinuousSystem(ptr, step, ref miniStep, time, order, Flowstar.Identity_Precondition, estimation.Length, estimation, bPrint, variables);

            if (result == IntPtr.Zero)
            {
                throw new FlowpipeException("Cannot find good range estimator");
            }

            return(Flowpipe.FromPtr(result, initialSet.numVars));
        }
示例#5
0
        public Flowpipe AdvanceNonPolynomial(string[] ODE, double time, int order, double step, double miniStep, double[] estimation)
        {
            IntPtr result = IntPtr.Zero;
            bool   bValue = AdvanceAdaptiveStepNonPolynomialFlowpipe(ref result, this.ptr, ODE.Length, ODE, step, miniStep, order, Flowstar.QR_Precondition, numVars, estimation);

            if (!bValue)
            {
                throw new FlowpipeException("Cannot find good estimation for the flowpipe");
            }
            Flowpipe res = Flowpipe.FromPtr(result, numVars);

            return(res);
        }
示例#6
0
 public Flowpipe ReachHighDegree(double step, double time, int order, int maxOrder, double[] estimation)
 {
     return(Flowpipe.FromPtr(ReachHighDegreeAdaptiveOrderContinuousSystem(ptr, step, time, order, maxOrder, estimation.Length, estimation, variables), initialSet.numVars));
 }