public void Compute(ITime targetTime)
        {
            HandleExchangeItemsBeforeCompute();

            double tStep = parameterValues[TimeStepId];

            int     nsteps = (int)Math.Round((targetTime.MJD - t) / tStep);
            IVector x      = state;
            IVector xn;

            for (int i = 0; i < nsteps; i++)
            {
                // --> Runge-Kutta
                // System.out.print("step :"+i+" ");
                // dx0 = dx(x,t);
                IVector dxdt0 = Dx(x, t);
                // dx1 = dx(x+0.5*dx0,t+0.5*dt);
                xn = x.Clone();
                xn.Axpy(0.5 * tStep, dxdt0);
                IVector dxdt1 = Dx(xn, t + 0.5 * tStep);
                // dx2 = dx(t+0.5*dt,x+0.5*dx1);
                xn = x.Clone();
                xn.Axpy(0.5 * tStep, dxdt1);
                IVector dxdt2 = Dx(xn, t + 0.5 * tStep);
                // dx3 = dx(t+1.0*dt,x+1.0*dx2);
                xn = x.Clone();
                xn.Axpy(1.0 * tStep, dxdt2);
                IVector dxdt3 = Dx(xn, t + 0.5 * tStep);

                // x = x + 1/6*dt*(dx0+2*dx1+2*dx2+dx3);
                x.Axpy(1.0 / 6.0 * tStep, dxdt0);
                x.Axpy(2.0 / 6.0 * tStep, dxdt1);
                x.Axpy(2.0 / 6.0 * tStep, dxdt2);
                x.Axpy(1.0 / 6.0 * tStep, dxdt3);

                t += tStep;
                timeStep++;
                // Console.Out.WriteLine(">>>>>>> t="+t+" x="+x);
                if (storeObs)
                {
                    // store all states if this is requested
                    tStore.Add(t);
                    xStore.Add(x.Clone());
                    iStore.Add(timeStep);
                }
                if (outputLevel != OutputLevel.Suppress)
                {
                    ResultsJ2N.PutValue("model_time", t, MessageType.Step);
                    ResultsJ2N.PutValue("x", x, MessageType.Step);
                }
            }
            state.Values = x.Values;
            t           += tStep;

            UpdateExchangeItemsAfterCompute();
        }