return 0.0;
}
return 0.4;
}
};
final LocalVolatilitySurfaceMoneyness lv = new LocalVolatilitySurfaceMoneyness(FunctionalDoublesSurface.from(lvFunc), new ForwardCurve(1.0));
final Function1D<Double, Double> initCon = new Function1D<Double, Double>() {
@Override
public Double evaluate(final Double x) {
return Math.max(0, 1 - Math.exp(x));
}
};
final ConvectionDiffusionPDESolver solver = new ThetaMethodFiniteDifference(0.50, true);
final ConvectionDiffusionPDE1DStandardCoefficients pde = getForwardLocalVol(lv);
final double xMin = -2.5;
final double xMax = 2.5;
PDEUtilityTools.printSurface("lv", lv.getSurface(), 0, 2.0, Math.exp(xMin), Math.exp(xMax));
final DirichletBoundaryCondition lower = new DirichletBoundaryCondition(initCon.evaluate(xMin), xMin);
final DirichletBoundaryCondition upper = new DirichletBoundaryCondition(initCon.evaluate(xMax), xMax);
final MeshingFunction timeMesh = new ExponentialMeshing(0, 2.0, 12, 0.0);
final MeshingFunction spaceMesh = new ExponentialMeshing(xMin, xMax, 17, 0.0);