Re: [sage-support] Numerical integration of a second-order ordinary differential equation (ODE)

2015-05-12 Thread Vegard Lima
Hi, On Tue, May 12, 2015 at 10:48 AM, Brenton wrote: > Hi, I'd like to numerically integrate a simple pendulum problem: > > y'' = -9.8*cos(y) > y,yd = var('y,yd') > f= [0,-9.8*cos(y)] > v= [y,yd] I think your f is wrong. Shouldn't it be: f = [yd, -9.8*cos(y)] Cheers, -- Vegard -- Yo

[sage-support] Numerical integration of a second-order ordinary differential equation (ODE)

2015-05-12 Thread Brenton
Hi, I'd like to numerically integrate a simple pendulum problem: y'' = -9.8*cos(y) y(0) = 0 y'(0) = 0 I have tried this code (based on the Lotka-Volterra example in the Sage documentation): from sage.calculus.desolvers import desolve_odeint y,yd = var('y,yd') f= [0,-9.8*cos(y)] v= [y,

[sage-support] Numerical integration and parametic curves

2014-09-09 Thread Jotace
Hi all, I want (my students) to plot Cornu's spiral, givent in parametric form by x(t) = integral cos(pi/u^2/2), u going from 0 to t , and y(t) defined analogously using the sine function. The integral connot be evaluated symbolically, I guess. The first attempt would be parametric_plot([inte

[sage-support] numerical integration problem

2012-08-07 Thread uwe.schilling
Dear all, I am new to sage and I have a problem with the integrate-command that I cannot explain and whose error message I don't really understand. Here's what it looks like: If I do quite simple integration

[sage-support] numerical integration problem

2012-08-07 Thread uwe.schilling
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: sage: integral(exp(-300.0/(-0.064*x+14.0)),x,0.0,120.0) If I simply put "x" into the denominator instead of the linear function it works fine. However, as shown, it

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

2011-04-17 Thread Ian Petrow
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(imaginary(gamma(1-I*t)),-15,15) which fails, and give a LONG error message. I won't put the whole thing here, but it starts: ERROR: An unexpected e

[sage-support] numerical integration of bessel_J functions

2009-10-29 Thread svanshaar
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: Cannot evaluate symbolic expression to

[sage-support] Numerical Integration in multiple dimensions

2009-06-14 Thread Pogon
Hi, I need to integrate an expression (two-dimensional fourier spectrum, i.e. containing imaginary parts) over two coordinates from -inf to +inf. I known that there is no analytical integral. Another thing is, that sympy.integrate says for a very simple expression containing imaginary I: sympy.c

[sage-support] numerical integration

2008-05-23 Thread andrew . sundstrom
I have a function that is not piecewise and cannot be symbolically integrated. Hence, I cannot use the Riemann or trapezoid approximations. Is there any other way in Sage to numerically integrate such a function? Thanks, Andrew --~--~-~--~~~---~--~~ To post to th

[sage-support] Numerical Integration

2007-09-24 Thread kcrisman
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 efficient way I have found to do it so far is to convert t