numerical-integration

How to do numerical integration with quantum harmonic oscillator wavefunction?

How to do numerical integration (what numerical method, and what tricks to use) for one-dimensional integration over infinite range, where one or more functions in the integrand are 1d quantum harmonic oscillator wave functions. Among others I want to calculate matrix elements of some function in the harmonic oscillator basis: phin(x...

how to do a program to solve three functions using improve euler's method?

I was given three functions: dx/dt = a(y-x) dy/dt = x(b-z)-y dz/dt = xy-cz All the variables are set by the user. I can do it if its just the basic one-equation problem. But now, i need to make a program using the improved Euler's method. Can the method solve three functions at the same time? Or can I use the Runge-Kutta method? ...

MATLAB: Question about minimizing a function containing an integral

Does anyone know how to minimize a function containing an integral in MATLAB? The function looks like this: L = Int(t=0,t=T)[(AR-x)dt], A is a system parameter and R and x are related through: dR/dt = axRY - bR, where a and b are constants. dY/dt = -xRY I read somewhere that I can use fminbnd and quad in combination but I am not a...

Calculating the area underneath a mathematical function

I have a range of data that I have approximated using a polynomial of degree 2 in Python. I want to calculate the area underneath this polynomial between 0 and 1. Is there a calculus, or similar package from numpy that I can use, or should I just make a simple function to integrate these functions? I'm a little unclear what the best ap...

Improper integral calculation using numerical intergration

I'm interested in calculation of Improper Integral for a function. Particularly it's a Gauss Integral. Using a numerical integration does make sense for a definite integrals but how should I deal with improper integrals ? Is there any was to extrapolate the function "around" negative infinity or should I just remove this part and start...

How do I do numerical integration of a vector in MATLAB?

I have a vector of 358 numbers. I'd like to make a numerical integration of this vector, but I don't know the function of this one. I found that we can use trapz or quad, but i don't really understand how to integrate without the function. ...

Help with symplectic integrators

I'm trying to develop a physics simulation and I want to implement a fourth-order symplectic integration method. The problem is that I must be getting the math wrong, since my simulation is not working at all when using the symplectic integrator (as compared to a fourth-order Runge-Kutta integrator that works reasonably well for the simu...