First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If you final aim is to numerically evaluate for a range of values of r, you can do the following:

sage: Curvature = lambda r : numerical_integral(kappa(r=r),0,2*pi)

This defines Curvature as a function of r that computes the integral numerocally. Then you can do:

sage: Curvature(2)
(16.716333138156095, 4.079736172387635e-10)
sage: Curvature(10)
(18.745787025936806, 2.081200437091458e-13)
click to hide/show revision 2
No.2 Revision

If you final aim is to numerically evaluate for a range of values of r, you can do the following:

sage: Curvature = lambda r : numerical_integral(kappa(r=r),0,2*pi)

This defines Curvature as a function of r that computes the integral numerocally. Then you can do:

sage: Curvature(2)
(16.716333138156095, 4.079736172387635e-10)
sage: Curvature(10)
(18.745787025936806, 2.081200437091458e-13)

The second value is an estimation of the error.

click to hide/show revision 3
No.3 Revision

If you final aim is to numerically evaluate for a range of values of r, you can do the following:

sage: Curvature = lambda r : numerical_integral(kappa(r=r),0,2*pi)

This defines Curvature as a function of r that computes the integral numerocally. Then you can do:

sage: Curvature(2)
(16.716333138156095, 4.079736172387635e-10)
sage: Curvature(10)
(18.745787025936806, 2.081200437091458e-13)

The second value is an estimation of the error.error, if you just want the approximated value of the integral, you can do:

sage: Curvature = lambda r : numerical_integral(kappa(r=r),0,2*pi)[0]
sage: Curvature(2)
16.716333138156095
click to hide/show revision 4
No.4 Revision

If you final aim is to numerically evaluate for a range of values of r, you can do the following:

sage: Curvature = lambda r : numerical_integral(kappa(r=r),0,2*pi)

This defines Curvature as a function of r that computes the integral numerocally. numerically. Then you can do:

sage: Curvature(2)
(16.716333138156095, 4.079736172387635e-10)
sage: Curvature(10)
(18.745787025936806, 2.081200437091458e-13)

The second value is an estimation of the error, if you just want the approximated value of the integral, you can do:

sage: Curvature = lambda r : numerical_integral(kappa(r=r),0,2*pi)[0]
sage: Curvature(2)
16.716333138156095