| 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)
| 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.
| 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
| 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
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.