| 1 | initial version |
You can use the following
sage: t = SR.var('t')
sage: z = 1-exp(2.0*cos(t) - 2.0*sin(t)-0.4*sqrt(-25*(cos(t) - sin(t))^2 + 100)^2)
sage: numerical_integral(z, 0, 2*pi)
(6.283185293615565, 2.4299802864003794e-10)
The first element of the answer is the value of the integral and the second one an estimation of the error (that you can believe in most situation).
| 2 | No.2 Revision |
You can use I confirm the followingRuntimeError
sage: t = SR.var('t')
sage: z = 1-exp(2.0*cos(t) - 2.0*sin(t)-0.4*sqrt(-25*(cos(t) - sin(t))^2 + 100)^2)
sage: integral(z, 0, 2*pi)
Traceback (most recent call last):
...
RuntimeError: ECL says: THROW: The catch RAT-ERR is undefined.
Though, you can use the following
sage: numerical_integral(z, 0, 2*pi)
(6.283185293615565, 2.4299802864003794e-10)
The first element of the answer is the value of the integral and the second one an estimation of the error (that you can believe in most situation).
Note that the integral is very close to two times pi
sage: (2*pi).n()
6.28318530717959
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.