[sage-support] Re: Numerical integration and parametic curves

2014-09-14 Thread Emmanuel Charpentier
Huh... cos(pi/u^2/2), first expression of your problem, has not, indeed, an explicit solution that sage is able to find. but, on your following attempts, you reach for the integral of cos(pi*x^2/2), a horse of a different color (which is the one racing in Wikipedia pages on "Euler spiral") : s

[sage-support] Re: Numerical integration and parametic curves

2014-09-10 Thread Hal Snyder
Appreciate the pointers. Plot statement in prior posting could also be parametric_plot((g,h),(-pi,pi)) which has a nicer default aspect ratio. BTW there is sage code for Cornu spiral in the wikipedia article, Euler spiral . On Wednesday, Septembe

[sage-support] Re: Numerical integration and parametic curves

2014-09-10 Thread Volker Braun
The "s = var('s')" is not necessary (the argument s inside the functions shadows it). As for the original question, IMHO there is a learning opportunity here. Numerical integration is powerful, but it doesn't give you symbolic answers. Even if you make the integration bound a symbolic variable.

[sage-support] Re: Numerical integration and parametic curves

2014-09-09 Thread Hal Snyder
This works on my sage-6.1.1: s = var('s') def g(s): return numerical_integral(cos(pi*x^2/2), 0, s, max_points=100)[0] def h(s): return numerical_integral(sin(pi*x^2/2), 0, s, max_points=100)[0] p = plot((g,h),(-pi,pi),parametric=True) show(p) On Tuesday, September 9, 2014 5:17:14 PM UT

[sage-support] Re: numerical integration problem

2012-08-13 Thread uwe.schilling
Thanks for the explanation. The problem might actually be fixed in newer versions of sage. I am working with v5.0, since it was the only one I found on the couple of mirrors where I looked and I figured what the heck. Anyway, I'll try your solution, thanks again. On Thursday, August 9, 2012 8:

[sage-support] Re: numerical integration problem

2012-08-10 Thread LFS
Hiya - I have had this experience myself even with rather simple functions and small intervals with sage (and with various other programming and math apps). Feel free to ignore this ... I am a complete ignoramus at how sage works, but my experience has been that you should try nudging your inte

[sage-support] Re: numerical integration problem

2012-08-09 Thread Robert Dodier
On 2012-08-08, uwe.schilling wrote: > RuntimeError: ECL says: In function ZEROP, the value of the only argument is > > > ((RAT SIMP) -0.064 1.0)

[sage-support] Re: numerical integration problem

2012-08-07 Thread uwe.schilling
On Tuesday, August 7, 2012 4:06:25 PM UTC+2, kcrisman wrote: > > > > On Tuesday, August 7, 2012 9:40:39 AM UTC-4, uwe.schilling wrote: >> >> Dear all, >> >> I am quite new to sage and right now I'm trying to perform quite a simple >> numerical integration of the following form: >> >> > Numeri

[sage-support] Re: numerical integration problem

2012-08-07 Thread kcrisman
On Tuesday, August 7, 2012 9:40:39 AM UTC-4, uwe.schilling wrote: > > Dear all, > > I am quite new to sage and right now I'm trying to perform quite a simple > numerical integration of the following form: > > Numerical integration doesn't work this way. Here, it will try to do a FTC integrat

[sage-support] Re: Numerical integration fails when taking real/imaginary part

2011-04-18 Thread kcrisman
On Apr 17, 6:20 pm, Ian Petrow wrote: > Wow.  Great. Thanks. > > Ian > > On Apr 17, 3:12 pm, achrzesz wrote: > > > > > sage: numerical_integral(lambda t:imaginary(gamma(1-I*t)),-15,15) > > (0.0, 5.3925521851144085e-15) > Also, sage: X = imaginary(gamma(1-I*t)) sage: X.nintegral(t,-15,15) (0.0

[sage-support] Re: Numerical integration fails when taking real/imaginary part

2011-04-17 Thread Ian Petrow
Wow. Great. Thanks. Ian On Apr 17, 3:12 pm, achrzesz wrote: > sage: numerical_integral(lambda t:imaginary(gamma(1-I*t)),-15,15) > (0.0, 5.3925521851144085e-15) > > On 18 Kwi, 00:02, Ian Petrow wrote: > > > > > > > > > Also, imaginary(gamma(1.+I*5)), say, works fine as long as it's not > > ins

[sage-support] Re: Numerical integration fails when taking real/imaginary part

2011-04-17 Thread achrzesz
sage: numerical_integral(lambda t:imaginary(gamma(1-I*t)),-15,15) (0.0, 5.3925521851144085e-15) On 18 Kwi, 00:02, Ian Petrow wrote: > Also, imaginary(gamma(1.+I*5)), say, works fine as long as it's not > inside a numerical integral > > Ian > > On Apr 17, 2:57 pm, Ian Petrow wrote: > > > Hello Ev

[sage-support] Re: Numerical integration fails when taking real/imaginary part

2011-04-17 Thread Ian Petrow
Also, imaginary(gamma(1.+I*5)), say, works fine as long as it's not inside a numerical integral Ian On Apr 17, 2:57 pm, Ian Petrow wrote: > Hello Everyone, > > I know numerical integration isn't great in SAGE, but I think the > following isn't too complicated.  I try > > sage: numerical_integral

Re: [sage-support] Re: numerical integration of bessel_J functions

2010-11-11 Thread Dr. David Kirkby
On 11/ 2/09 08:11 PM, svanshaar wrote: Thanks Jason! That works perfectly. I don't know if any of this uses the GNU Scientific library, but there are reports of bug in the Bessel functions on there. "gsl_sf_bessel_lnKnu overflows for large nu" which the developers have acknowledged and ha

[sage-support] Re: numerical integration of bessel_J functions

2009-11-02 Thread kcrisman
> integration.  The problem here is that bessel_J is not a symbolic > function, and does not know how to deal with symbolic variables.  It > would be great if someone submitted a patch to take care of this! Yes, in an ideal world we would have already taken care of this, since this sort of numeri

[sage-support] Re: numerical integration of bessel_J functions

2009-11-02 Thread svanshaar
Thanks Jason! That works perfectly. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://grou

[sage-support] Re: numerical integration of bessel_J functions

2009-10-29 Thread Jason Grout
svanshaar wrote: > I am trying to numerically evaluate the integral of bessel functions. > I've tried constructing it various ways. The one that makes most > sense to me is: > a=var('a') > f=bessel_J(1,a)*bessel_J(0,0.1*a)*e^(-5*a) > f.numerical_integral(a,0,infinity) > > I get the error: Canno

[sage-support] Re: numerical integration

2008-05-23 Thread David Joyner
If you have a list L of N, say, sample values of the function f over the interval (a,b), say, then intf = sum(L)*(b-a)/N should be the approximate integral shouldn't it? sage: a = 1; b = 2; N = 10; Delta = (b-a)/N sage: intf = sum(L)*(b-a)/N sage: int_f = integral(sin(x),x,1,2) sage: RR(intf);

[sage-support] Re: numerical integration

2008-05-23 Thread andrew . sundstrom
Please disregard. I saw your earlier reply to kcrisman, which was helpful. (Next time, I'll search first!) On May 23, 7:21 am, [EMAIL PROTECTED] wrote: > I have a function that is not piecewise and cannot be symbolically > integrated. Hence, I cannot use the Riemann or trapezoid > approximati

[sage-support] Re: Numerical Integration

2007-09-24 Thread kcrisman
Thank you! Perhaps that should be mentioned in the next update of the tutorial and constructions as well, where they only reference the various Piecewise constructions for numerical methods. kcrisman --~--~-~--~~~---~--~~ To post to this group, send email to sage-

[sage-support] Re: Numerical Integration

2007-09-24 Thread William Stein
On 9/24/07, kcrisman <[EMAIL PROTECTED]> wrote: > Does anyone know how to *easily* do numerical integration on SAGE? > The problem is that when doing (say) arc length problems, if SAGE > doesn't know how to do the antiderivative, it doesn't default to some > sort of numerical role, and the only ef