Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

2
votes
0answers
43 views

Want NIntegrate to catch error message

Really stuck with this. When I use NIntegrate, it sometimes prints a message like NIntegrate::ncvb: "NIntegrate failed to converge to prescribed accuracy ...
2
votes
0answers
59 views

Problem solving a nonlinear partial differential diffusion equation [on hold]

EDIT: actualy the nonlinear partial differential equations for interacting density distributions, including boundary conditions, should be given as $$ \frac{\partial\phi}{\partial t} = D ...
5
votes
1answer
128 views

Finding minimum fly-by radius between Mars and spacecraft from interpolating function

I've written an interplanetary trajectory solver/plotter that plots the path taken by a spacecraft on an Earth-Mars mission, but have run into a little trouble when the spacecraft actually reaches ...
4
votes
1answer
101 views

Possible bug / numerical issues with HypergeometricU — any suggestions for a fast workaround?

I've encountered some problematic behaviour with HypergeometricU. I have a probability distribution on the positive integers that takes the following form after ...
1
vote
1answer
182 views

Locating Periodic Orbits

Here is the code for the numerical integration of an orbit. First the module for the definition of the equations of motion. ...
2
votes
0answers
146 views

Volterra integral equation

I have to find an approximate numerical solution for the equation $$ F(x) - \lambda \int\limits_1^{x} \text{d}s \;s^2 F(s) Z(x-s) = G(x) $$ $$Z(s) = (\psi''(1-2\ h\ i\ s)- 0.5 \psi''(1-2\ h\ i\ s))$$ ...
0
votes
0answers
61 views

Real or Imaginary result of spherical bessel and hankel functions of imaginary arguments

I am trying to calculate a rather complicate expression involving Spherical Bessel and Hankel functions. My problem is that somehow for pure imaginary arguments the functions are not pure real or ...
3
votes
1answer
197 views

What method does `NIntegrate` uses by default?

There is a variety of algorithm for performing numerical integration (See wiki). What method does NIntegrate uses by default? I looked on the documentation page and I saw that the function ...
0
votes
2answers
94 views

NIntegrate and Integrate of a Spherical Bessel function

I am trying to integrate over a spherical bessel function. I have used both the Integrate and NIntegrate functions in Mathematica but the values given by each do not match. Any reason why this ...
1
vote
1answer
157 views

Runge-Kutta Butcher tables

I like to have the Butcher's table for Explicit (or implicit as well) Runge-Kutta method of a fixed order. I do not understand reading ...
9
votes
1answer
613 views

NDSolve::ndcf: Repeated convergence test failure. How to solve?

I am trying to simulate a system of $n$ pendulums with some friction in Mathematica 9. This is the code I am using: ...
2
votes
2answers
122 views

NIntegrate over a list of functions

This question is the result of these other two questions. Question 1 and 2. I thought it would be better to ask a new question rather than deleting previous one. I think When ...
2
votes
2answers
196 views

NIntegrate piecewise vector function

Is there a way to numerically integrate a vector function defined via Piecewise? Example: ...
0
votes
1answer
49 views

NIntegrate producing SetDelayed::write message [on hold]

I used NIntegrate to calculate an integral with the final limit as a variable, which later will be listed in a table, ...
0
votes
1answer
50 views

Plotting results of NIntegrate with variable integration limit

I have tried to use NIntegrate with variable limits and compute the following ...
1
vote
0answers
24 views

Using indexed array elements as integration dummy variables with EvaluationMonitor. Bug?

As part of a routine that must cope with integration of varying numbers of dimensions, I would like to use indexed variable names (e.g., x[0], x[1],...) as dummy integration variables. However, it ...
5
votes
1answer
110 views

Difficulty in getting correct Gaussian curve for diffusion of point source

I want to solve diffusion of a point source numerically and check it against analytical solution. first I define initial profile, ...
4
votes
1answer
135 views

Numerical solution of IVP for linear ODE with variable coefficient runs wild soon

Cross posted in scicomp.SE. A friend of mine showed me this initial value problem (IVP) for a linear ordinary differential equation (ODE) with variable coefficient: $$y''(x)=\left(x^2-1\right) ...
0
votes
0answers
81 views

Volume by NIntegrate gives zero

I want to Integrate the following expressions for different p < n and 2 < n with p and n both natural numbers: ...
5
votes
1answer
134 views

How to plot the solution of a Partial Differential Equation?

My attempt. I need to solve numerically the Complex Ginzburg-Laudau Equation (CGLE): $$ \frac{\partial A}{\partial t}=\epsilon A-(1+i\beta)|A|^2A+(1+i\alpha)\nabla^2A $$ I'm using a uniform initial ...
1
vote
1answer
59 views

Plot a numerical integration as a function of a variable

Suppose we have a function that is hard to evaluate analytically but a numerical estimate suffices. For example consider the $f(x,\Lambda) = \Lambda\cdot \sin(x)$ where $\Lambda$ is some parameter I ...
7
votes
2answers
155 views

Integrating a function over a surface integral

From a first principles bandstructure calculation I get an energy scalar field in three dimensions $E(x,y,z)$. It's now easy to plot a constant energy (contour)-surface for dedicated values ...
2
votes
2answers
107 views

WorkingPrecision causes issue in the NIntegrate

I really can't figure out why my code sometimes is not working. My integrals involve two variables (k and kz). The integration ...
4
votes
2answers
113 views

Coarse-graining in numerical integrations

I have been working recently in a coarse-graining problem I found when using NIntegrate: I am trying to evaluate the function $$f(a)=\int_0^{\infty}x\,e^{-(a^2+b^2)x^2}\text{d}x$$ numerically as a ...
4
votes
2answers
283 views

Approximate value for the area between the curve

I've got this task: Use Mathematica to obtain an approximate value for the area between the curve $y=1/4$ and the x-axis over the interval $[1,2]$ with $50$ subintervals using the left ...
6
votes
1answer
96 views

Detecting nearly simultaneous WhenEvents in NDSolve

I am trying to solve a system of (many) coupled nonlinear ODEs. I need to decouple some of the equations (i.e. set the time derivatives of some of the dependent variables to zero) at various points in ...
3
votes
2answers
448 views

BC for transport equation using NDSolve

First I can solve a transport equation with a source (Is it still called transport equation?) using DSolve. The form of the source serves only as an example. It can ...
1
vote
2answers
65 views

Confusion in Numerical Integration while using FindRoot

I used this code for numerical integration NIntegrate[(x^2 - .0015 x^4)/D[(x^2 - .0015 x^4), x], {x, 1.414, 13}] when upperlimit of x is 13, the integral value ...
0
votes
1answer
110 views

Time evolution of a wave packet from the time-independent Schroedinger equation [duplicate]

Starting off with the time-independent Schroedinger equation (TISE) $\quad \quad -\frac{\hbar^2}{2m} \nabla^2 \psi + V(r, \theta) \psi = E\, \psi,$ I would like to study the time evolution of an ...
0
votes
0answers
29 views
16
votes
2answers
3k views

Nested NIntegrate

Suppose that we have the given simple integral expression $$ \int_{-5}^{5} x \int_{-\infty}^{x} e^{\int_{0}^{z} -y dy} dz dx $$ Writing this out in Mathematica we obtain: ...
0
votes
0answers
40 views

Integro differential eq boundary difficulties

I'm trying numericaly solve simple integro-differential equation, but have some problems with boundary conditions. System: ...
2
votes
1answer
113 views

How can I invoke the solution of NDSolve to determine a parameter in my equation just inside NDSlove?

I am trying to solve a differential equation by NDSlove for $h(x,t)$. It reads $$h_t=h_{xx}-V_h-\lambda(t)$$ where $V_h$ is a given function of $h(x,t)$ denoted by ...
0
votes
0answers
29 views

What is the right way to combine a Package, Module, ParallelTable and NIntegrate?

I am stuck with a curious problem. I would like to to have a package from which i can call a function test[path], which then performs a time consuming numerical ...
0
votes
1answer
49 views

How can I perform this integration in Mathematica? [closed]

I am new to Mathematica. I want to find the integration of the following expression: $H(f)=T\left(\frac{sin(\pi f T)}{\pi f T}\right)^2$ Here, $T=1.127e-7$ I want to integrate this function for a ...
3
votes
1answer
82 views

Evaluating a numerical integration with infinity as limit

I am trying to evaluate a numerical integration (to get an expression of the constant Ω) Suppose that h[x_] := 1/(1 + a x^2) ...
-3
votes
1answer
101 views

How can I evaluate this function in Mathematica? [closed]

I am very new to Mathematica. Today I have got my license. Can someone help me to evaluate the following expression in Mathematica. I want find the values of $P$ for different $n$ $S=129$; ...
0
votes
3answers
67 views

How do I integrate this function?

I am very new to mathematica and also new to this community. I have a problem given below, How to express this in Mathematica? $H=[2,4,10,5,12,34,42,\cdots 12]$ is a vector of size $N$. $h_n$ is the ...
0
votes
1answer
50 views

Adapt the code to produce a three column table containing the values of n, etc. (Numerical integration)

Here is a “procedural” program that we wrote in my class, implementing the rectangle rule of numerical integration: ...
0
votes
0answers
43 views

Passing integration constants to self defined function

I would like to evaluate an integral I am taking in cylindrical coordinates, in which the integrand contains a previously defined function. I need to pass the r and phi integrand values to this ...
0
votes
2answers
92 views

Numerical 3D Integration in Mathematica [closed]

My question in short is: Is it possible to make numerical 3D integration in mathematica efficiently? Or am I gonna have to move this to C++? I feel this problem is way too trivial to go to C++, so ...
0
votes
0answers
59 views

NIntegrate Polynomial of high degree

I want to integrate a polynomial of degree 100 and higher over a domain that is the intersection of two balls like ...
3
votes
2answers
141 views

Integrate and NIntegrate not the same

Why am I getting two different results here? ...
0
votes
0answers
37 views

Parallel calculation with SetOptions

Is it possible to distribute the effect of SetOptions to parallel kernels? Here is how I encountered the problem: I am trying to calculate a lot of numerical ...
10
votes
1answer
587 views

Why can't I change the value of MaxRecursion in NIntegrate when integrating BesselJ?

Bug introduced in 8.0.4 or earlier and persists through 10.0.2. I am trying to evaluate this integral numerically $$ \int_0^{\infty } J_0(q R) \tanh(q) \, \mathrm{d}q $$ for large values of $R$. ...
9
votes
1answer
212 views

Is this a bug in NIntegrate?

Fixed in 10.1 Bug is present as of version 10.0.2 checked on windows 7, 64 bit Is this a bug or I missed something? NIntegrate seems to give a different ...