예제 #1
0
파일: dvode.cs 프로젝트: davidsiaw/neuron
        public DVNLSD()
        {
            #region Initialization Common Blocks

            CommonBlock DVOD01 = new CommonBlock(48, 33, 0, 0);
            CommonBlock DVOD02 = new CommonBlock(1, 8, 0, 0);
            #endregion
            #region Dependencies (Initialization)

            DVNORM dvnorm = new DVNORM();
            DCOPY dcopy = new DCOPY();
            DSCAL dscal = new DSCAL();
            IDAMAX idamax = new IDAMAX();
            DAXPY daxpy = new DAXPY();
            DDOT ddot = new DDOT();
            DGEFA dgefa = new DGEFA(idamax, dscal, daxpy);
            DACOPY dacopy = new DACOPY(dcopy);
            DGBFA dgbfa = new DGBFA(idamax, dscal, daxpy);
            DVJAC dvjac = new DVJAC(dvnorm, dcopy, dscal, dgefa, dacopy, dgbfa, DVOD01, DVOD02);
            DGESL dgesl = new DGESL(ddot, daxpy);
            DGBSL dgbsl = new DGBSL(ddot, daxpy);
            DVSOL dvsol = new DVSOL(dgesl, dgbsl, DVOD01);
            #endregion
            #region Set Dependencies

            this._dvnorm = dvnorm; this._dcopy = dcopy; this._dvjac = dvjac; this._dvsol = dvsol; this._dscal = dscal;
            this._daxpy = daxpy;
            #endregion
            #region Data Initialization

            //CCMAX/0.3D0
            CCMAX = 0.3E0;
            //CRDOWN/0.3D0
            CRDOWN = 0.3E0;
            //MAXCOR/3
            MAXCOR = 3;
            //MSBP/20
            MSBP = 20;
            //RDIV/2.0D0
            RDIV = 2.0E0;
            //ONE/1.0D0
            ONE = 1.0E0;
            //TWO/2.0D0
            TWO = 2.0E0;
            //ZERO/0.0D0
            ZERO = 0.0E0;
            #endregion
            #region Common varaible Initialization

            #region Common Block: DVOD01 Initialization

            this._dvod01 = DVOD01;
            ACNRM = DVOD01.doubleData[0];
            CCMXJ = DVOD01.doubleData[1];
            CONP = DVOD01.doubleData[2];
            CRATE = DVOD01.doubleData[3];
            DRC = DVOD01.doubleData[4];
            //Start Array: EL  StartIndex: 5  LastIndex: 17
            EL = DVOD01.doubleData;
            o_el = 4;  //o_ = StartIndex-1
            //End Array: EL
            ETA = DVOD01.doubleData[18];
            ETAMAX = DVOD01.doubleData[19];
            H = DVOD01.doubleData[20];
            HMIN = DVOD01.doubleData[21];
            HMXI = DVOD01.doubleData[22];
            HNEW = DVOD01.doubleData[23];
            HSCAL = DVOD01.doubleData[24];
            PRL1 = DVOD01.doubleData[25];
            RC = DVOD01.doubleData[26];
            RL1 = DVOD01.doubleData[27];
            //Start Array: TAU  StartIndex: 28  LastIndex: 40
            TAU = DVOD01.doubleData;
            o_tau = 27;  //o_ = StartIndex-1
            //End Array: TAU
            //Start Array: TQ  StartIndex: 41  LastIndex: 45
            TQ = DVOD01.doubleData;
            o_tq = 40;  //o_ = StartIndex-1
            //End Array: TQ
            TN = DVOD01.doubleData[46];
            UROUND = DVOD01.doubleData[47];
            ICF = DVOD01.intData[0];
            INIT = DVOD01.intData[1];
            IPUP = DVOD01.intData[2];
            JCUR = DVOD01.intData[3];
            JSTART = DVOD01.intData[4];
            JSV = DVOD01.intData[5];
            KFLAG = DVOD01.intData[6];
            KUTH = DVOD01.intData[7];
            L = DVOD01.intData[8];
            LMAX = DVOD01.intData[9];
            LYH = DVOD01.intData[10];
            LEWT = DVOD01.intData[11];
            LACOR = DVOD01.intData[12];
            LSAVF = DVOD01.intData[13];
            LWM = DVOD01.intData[14];
            LIWM = DVOD01.intData[15];
            LOCJS = DVOD01.intData[16];
            MAXORD = DVOD01.intData[17];
            METH = DVOD01.intData[18];
            MITER = DVOD01.intData[19];
            MSBJ = DVOD01.intData[20];
            MXHNIL = DVOD01.intData[21];
            MXSTEP = DVOD01.intData[22];
            N = DVOD01.intData[23];
            NEWH = DVOD01.intData[24];
            NEWQ = DVOD01.intData[25];
            NHNIL = DVOD01.intData[26];
            NQ = DVOD01.intData[27];
            NQNYH = DVOD01.intData[28];
            NQWAIT = DVOD01.intData[29];
            NSLJ = DVOD01.intData[30];
            NSLP = DVOD01.intData[31];
            NYH = DVOD01.intData[32];
            #endregion
            #region Common Block: DVOD02 Initialization

            this._dvod02 = DVOD02;
            HU = DVOD02.doubleData[0];
            NCFN = DVOD02.intData[0];
            NETF = DVOD02.intData[1];
            NFE = DVOD02.intData[2];
            NJE = DVOD02.intData[3];
            NLU = DVOD02.intData[4];
            NNI = DVOD02.intData[5];
            NQU = DVOD02.intData[6];
            NST = DVOD02.intData[7];
            #endregion
            #endregion
        }
예제 #2
0
파일: dvode.cs 프로젝트: davidsiaw/neuron
        public DVODE()
        {
            #region Initialization Common Blocks

            CommonBlock DVOD01 = new CommonBlock(48, 33, 0, 0);
            CommonBlock DVOD02 = new CommonBlock(1, 8, 0, 0);
            #endregion
            #region Dependencies (Initialization)

            DVNORM dvnorm = new DVNORM();
            DCOPY dcopy = new DCOPY();
            DSCAL dscal = new DSCAL();
            IDAMAX idamax = new IDAMAX();
            DAXPY daxpy = new DAXPY();
            DDOT ddot = new DDOT();
            DUMSUM dumsum = new DUMSUM();
            DEWSET dewset = new DEWSET();
            IUMACH iumach = new IUMACH();
            DVSET dvset = new DVSET(DVOD01);
            DGEFA dgefa = new DGEFA(idamax, dscal, daxpy);
            DACOPY dacopy = new DACOPY(dcopy);
            DGBFA dgbfa = new DGBFA(idamax, dscal, daxpy);
            DVJAC dvjac = new DVJAC(dvnorm, dcopy, dscal, dgefa, dacopy, dgbfa, DVOD01, DVOD02);
            DGESL dgesl = new DGESL(ddot, daxpy);
            DGBSL dgbsl = new DGBSL(ddot, daxpy);
            DVSOL dvsol = new DVSOL(dgesl, dgbsl, DVOD01);
            DVNLSD dvnlsd = new DVNLSD(dvnorm, dcopy, dvjac, dvsol, dscal, daxpy, DVOD01, DVOD02);
            DUMACH dumach = new DUMACH(dumsum);
            DVHIN dvhin = new DVHIN(dvnorm);
            IXSAV ixsav = new IXSAV(iumach);
            XERRWD xerrwd = new XERRWD(ixsav);
            DVINDY dvindy = new DVINDY(dscal, xerrwd, DVOD01, DVOD02);
            DVJUST dvjust = new DVJUST(daxpy, DVOD01);
            DVSTEP dvstep = new DVSTEP(dvnorm, dvjust, dscal, dvset, daxpy, dcopy, DVOD01, DVOD02);
            #endregion
            #region Set Dependencies

            this._dvnlsd = dvnlsd; this._dumach = dumach; this._dvnorm = dvnorm; this._dcopy = dcopy; this._dewset = dewset;
            this._dvhin = dvhin;this._dscal = dscal; this._dvindy = dvindy; this._xerrwd = xerrwd; this._dvstep = dvstep;
            #endregion
            #region Data Initialization

            //MORD(1)/12
            MORD[1 + o_mord] = 12;
            //MORD(2)/5
            MORD[2 + o_mord] = 5;
            //MXSTP0/500
            MXSTP0 = 500;
            //MXHNL0/10
            MXHNL0 = 10;
            //ZERO/0.0D0
            ZERO = 0.0E0;
            //ONE/1.0D0
            ONE = 1.0E0;
            //TWO/2.0D0
            TWO = 2.0E0;
            //FOUR/4.0D0
            FOUR = 4.0E0;
            //PT2/0.2D0
            PT2 = 0.2E0;
            //HUN/100.0D0
            HUN = 100.0E0;
            #endregion
            #region Common varaible Initialization

            #region Common Block: DVOD01 Initialization

            this._dvod01 = DVOD01;
            ACNRM = DVOD01.doubleData[0];
            CCMXJ = DVOD01.doubleData[1];
            CONP = DVOD01.doubleData[2];
            CRATE = DVOD01.doubleData[3];
            DRC = DVOD01.doubleData[4];
            //Start Array: EL  StartIndex: 5  LastIndex: 17
            EL = DVOD01.doubleData;
            o_el = 4;  //o_ = StartIndex-1
            //End Array: EL
            ETA = DVOD01.doubleData[18];
            ETAMAX = DVOD01.doubleData[19];
            H = DVOD01.doubleData[20];
            HMIN = DVOD01.doubleData[21];
            HMXI = DVOD01.doubleData[22];
            HNEW = DVOD01.doubleData[23];
            HSCAL = DVOD01.doubleData[24];
            PRL1 = DVOD01.doubleData[25];
            RC = DVOD01.doubleData[26];
            RL1 = DVOD01.doubleData[27];
            //Start Array: TAU  StartIndex: 28  LastIndex: 40
            TAU = DVOD01.doubleData;
            o_tau = 27;  //o_ = StartIndex-1
            //End Array: TAU
            //Start Array: TQ  StartIndex: 41  LastIndex: 45
            TQ = DVOD01.doubleData;
            o_tq = 40;  //o_ = StartIndex-1
            //End Array: TQ
            TN = DVOD01.doubleData[46];
            UROUND = DVOD01.doubleData[47];
            ICF = DVOD01.intData[0];
            INIT = DVOD01.intData[1];
            IPUP = DVOD01.intData[2];
            JCUR = DVOD01.intData[3];
            JSTART = DVOD01.intData[4];
            JSV = DVOD01.intData[5];
            KFLAG = DVOD01.intData[6];
            KUTH = DVOD01.intData[7];
            L = DVOD01.intData[8];
            LMAX = DVOD01.intData[9];
            LYH = DVOD01.intData[10];
            LEWT = DVOD01.intData[11];
            LACOR = DVOD01.intData[12];
            LSAVF = DVOD01.intData[13];
            LWM = DVOD01.intData[14];
            LIWM = DVOD01.intData[15];
            LOCJS = DVOD01.intData[16];
            MAXORD = DVOD01.intData[17];
            METH = DVOD01.intData[18];
            MITER = DVOD01.intData[19];
            MSBJ = DVOD01.intData[20];
            MXHNIL = DVOD01.intData[21];
            MXSTEP = DVOD01.intData[22];
            N = DVOD01.intData[23];
            NEWH = DVOD01.intData[24];
            NEWQ = DVOD01.intData[25];
            NHNIL = DVOD01.intData[26];
            NQ = DVOD01.intData[27];
            NQNYH = DVOD01.intData[28];
            NQWAIT = DVOD01.intData[29];
            NSLJ = DVOD01.intData[30];
            NSLP = DVOD01.intData[31];
            NYH = DVOD01.intData[32];
            #endregion
            #region Common Block: DVOD02 Initialization

            this._dvod02 = DVOD02;
            HU = DVOD02.doubleData[0];
            NCFN = DVOD02.intData[0];
            NETF = DVOD02.intData[1];
            NFE = DVOD02.intData[2];
            NJE = DVOD02.intData[3];
            NLU = DVOD02.intData[4];
            NNI = DVOD02.intData[5];
            NQU = DVOD02.intData[6];
            NST = DVOD02.intData[7];
            #endregion
            #endregion
        }
예제 #3
0
파일: dvode.cs 프로젝트: davidsiaw/neuron
        public DVJAC(DVNORM dvnorm, DCOPY dcopy, DSCAL dscal, DGEFA dgefa, DACOPY dacopy, DGBFA dgbfa, CommonBlock DVOD01, CommonBlock DVOD02)
        {
            #region Set Dependencies

            this._dvnorm = dvnorm; this._dcopy = dcopy; this._dscal = dscal; this._dgefa = dgefa; this._dacopy = dacopy;
            this._dgbfa = dgbfa;
            #endregion
            #region Data Initialization

            //ONE/1.0D0
            ONE = 1.0E0;
            //THOU/1000.0D0
            THOU = 1000.0E0;
            //ZERO/0.0D0
            ZERO = 0.0E0;
            //PT1/0.1D0
            PT1 = 0.1E0;
            #endregion
            #region Common varaible Initialization

            #region Common Block: DVOD01 Initialization

            this._dvod01 = DVOD01;
            ACNRM = DVOD01.doubleData[0];
            CCMXJ = DVOD01.doubleData[1];
            CONP = DVOD01.doubleData[2];
            CRATE = DVOD01.doubleData[3];
            DRC = DVOD01.doubleData[4];
            //Start Array: EL  StartIndex: 5  LastIndex: 17
            EL = DVOD01.doubleData;
            o_el = 4;  //o_ = StartIndex-1
            //End Array: EL
            ETA = DVOD01.doubleData[18];
            ETAMAX = DVOD01.doubleData[19];
            H = DVOD01.doubleData[20];
            HMIN = DVOD01.doubleData[21];
            HMXI = DVOD01.doubleData[22];
            HNEW = DVOD01.doubleData[23];
            HSCAL = DVOD01.doubleData[24];
            PRL1 = DVOD01.doubleData[25];
            RC = DVOD01.doubleData[26];
            RL1 = DVOD01.doubleData[27];
            //Start Array: TAU  StartIndex: 28  LastIndex: 40
            TAU = DVOD01.doubleData;
            o_tau = 27;  //o_ = StartIndex-1
            //End Array: TAU
            //Start Array: TQ  StartIndex: 41  LastIndex: 45
            TQ = DVOD01.doubleData;
            o_tq = 40;  //o_ = StartIndex-1
            //End Array: TQ
            TN = DVOD01.doubleData[46];
            UROUND = DVOD01.doubleData[47];
            ICF = DVOD01.intData[0];
            INIT = DVOD01.intData[1];
            IPUP = DVOD01.intData[2];
            JCUR = DVOD01.intData[3];
            JSTART = DVOD01.intData[4];
            JSV = DVOD01.intData[5];
            KFLAG = DVOD01.intData[6];
            KUTH = DVOD01.intData[7];
            L = DVOD01.intData[8];
            LMAX = DVOD01.intData[9];
            LYH = DVOD01.intData[10];
            LEWT = DVOD01.intData[11];
            LACOR = DVOD01.intData[12];
            LSAVF = DVOD01.intData[13];
            LWM = DVOD01.intData[14];
            LIWM = DVOD01.intData[15];
            LOCJS = DVOD01.intData[16];
            MAXORD = DVOD01.intData[17];
            METH = DVOD01.intData[18];
            MITER = DVOD01.intData[19];
            MSBJ = DVOD01.intData[20];
            MXHNIL = DVOD01.intData[21];
            MXSTEP = DVOD01.intData[22];
            N = DVOD01.intData[23];
            NEWH = DVOD01.intData[24];
            NEWQ = DVOD01.intData[25];
            NHNIL = DVOD01.intData[26];
            NQ = DVOD01.intData[27];
            NQNYH = DVOD01.intData[28];
            NQWAIT = DVOD01.intData[29];
            NSLJ = DVOD01.intData[30];
            NSLP = DVOD01.intData[31];
            NYH = DVOD01.intData[32];
            #endregion
            #region Common Block: DVOD02 Initialization

            this._dvod02 = DVOD02;
            HU = DVOD02.doubleData[0];
            NCFN = DVOD02.intData[0];
            NETF = DVOD02.intData[1];
            NFE = DVOD02.intData[2];
            NJE = DVOD02.intData[3];
            NLU = DVOD02.intData[4];
            NNI = DVOD02.intData[5];
            NQU = DVOD02.intData[6];
            NST = DVOD02.intData[7];
            #endregion
            #endregion
        }