Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Not exactly sure what you're looking for, but the function help seems to have a similar example to what you're doing.

 "For a Python function with parameters:

  sage: f(x,a) = 1/(a+x^2)
  sage: [numerical_integral(f, 1, 2, max_points=100, params=[n]) for n in range(10)]  # random output (architecture and os dependent)
   (0.32175055439664557, 3.5721487367706477e-15),
   (0.24030098317249229, 2.6678768435816325e-15),
   (0.19253082576711697, 2.1375215571674764e-15),
   (0.16087527719832367, 1.7860743683853337e-15),
   (0.13827545676349412, 1.5351659583939151e-15),
   (0.12129975935702741, 1.3466978571966261e-15),
   (0.10806674191683065, 1.1997818507228991e-15),
   (0.09745444625548845, 1.0819617008493815e-15),
   (0.088750683050217577, 9.8533051773561173e-16)]

 Note the parameters are always a tuple even if they have one
 component."