示例#1
0
    public void initIC()
    { // Utility function to initialise the payoff function
        // Initialise at the boundaries
        vecOld[vecOld.MinIndex] = pde.BCL(taxis.low);
        vecOld[vecOld.MaxIndex] = pde.BCR(taxis.high);

        // Now initialise values in interior of interval using
        // the initial function 'IC' from the PDE
        for (int j = xarr.MinIndex + 1; j <= xarr.MaxIndex - 1; j++)
        {
            vecOld[j] = pde.IC(xarr[j]);
        }

        // Matrix: rows are the time t, columns are the space x.
        res.Row(res.MinRowIndex, vecOld);
    }
示例#2
0
    public void initIC()
    { // Utility function to initialise the payoff function
        currentIndex = res.MinRowIndex;
        maxIndex     = res.MaxRowIndex;

        tprev = tnow = taxis.low;

        // Initialise at the boundaries
        vecOld[vecOld.MinIndex] = pde.BCL(taxis.low);
        vecOld[vecOld.MaxIndex] = pde.BCR(taxis.high);

        // Now initialise values in interior of interval using
        // the initial function 'IC' from the PDE
        for (int j = xarr.MinIndex + 1; j <= xarr.MaxIndex - 1; j++)
        {
            vecOld[j] = pde.IC(xarr[j]);
        }


        res.Row(currentIndex, vecOld);
    }