Example #1
0
def plot_dUdv(domain, spots, vars, plotter=wireframe):
    """
    Plot the error in the derivative across each row.
    """
    dUdv = center_diff(domain,axis=1)/center_diff(vars)
    plotter(dUdv, spots, vars)
    pylab.title("First deriv w.r.t. var")
    pylab.xlabel("Var")
    pylab.ylabel("% of strike")
    pylab.show()
Example #2
0
def plot_d2Udv2(domain, spots, vars, plotter=wireframe):
    """
    Plot the error in the second derivative across each row.
    """
    d2Udv2 = center_diff(domain,n=2,axis=1)/center_diff(vars, 2)
    plotter(d2Udv2, spots, vars)
    pylab.title("Second deriv w.r.t. var")
    pylab.xlabel("Var")
    pylab.ylabel("% of strike")
    pylab.show()
Example #3
0
def plot_dUds_err(domain, analytical, spots, vars, plotter=wireframe):
    """
    Plot the error in the derivative down each columns.
    """
    dUds = center_diff(domain,axis=0)/center_diff(vars)
    danalyticalds = center_diff(analytical,axis=0)/center_diff(vars)
    plotter(dUds - danalyticalds, spots, vars)
    pylab.title("Error in $\Delta$")
    pylab.xlabel("Var")
    pylab.ylabel("% of strike")