Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
0answers
8 views

Speeding Up the Numerical Integration of a Product of Numerical Integrands with NIntegrate

I need to solve a set of coupled integral equations within a self-consistent cycle. The final result will be functions, say $A(x)$ and $B(x)$, which are related to each other by some integrals which ...
1
vote
1answer
58 views

How to modify a PDE inside NDSolve according to an if condition

I need to solve this PDE $$\partial_tf(t,x)+\partial_xf(t,x)+k\partial_{xx}f(t,x)-xf(t,x)=0 $$ with $k\in\mathbb{R}$ and final condition $f(T,x)=1$ with $0<t<T$. My problem is how to solve ...
1
vote
2answers
126 views

Perturbation theory with Mathematica: Definite integral of polynomial times exponential times hypergeometric function of imaginary argument

I would like to ask also Mathematica users about my question from the math forum. To expand, I'm adding the code which calculates the full double integral for $n=0$ and $\mu=0$ (the second in the ...
1
vote
2answers
41 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 ...
1
vote
2answers
106 views

Solving for the limits of an integral

I am trying to get Mathematica to solve for the symmetric limits of an integral of a Square Wave. ...
0
votes
2answers
78 views

Multidimensional Numeric Integration

I can't manage to calculate numerically the following multidimensional integral: ...
0
votes
1answer
40 views

NdSolve problem :NDSolve::ndode: Input is not an ordinary differential equation

I am new to Mathematica. I am working on solving the following different equations numerically written in the code as below. Not so sure about the boundary values that depends on R (M(0)=0, n(1)=0) ...
2
votes
1answer
97 views

(NDSolve) Non-linear 2nd order ODE, regular singular point (looking for good methods for this problem)

I am solving this set of non-linear 2nd order ODE by NDSolve, $$r^2\frac{d^2f}{dr^2} = 2f(1-f)(1-2f)+\frac{r^2}{4}h^2(f-1)$$ $$\frac{d}{dr}\left[r^2\frac{dh}{dr} \right]=2h(1-f)^2+\lambda ...
2
votes
0answers
40 views

Enforcing WorkingPrecision in NIntegrate

I have a very complicated 2D integral that I need to calculate repeatedly, and I'm trying to speed it up a bit, since at the moment it's taking a couple of days to complete. One thing I've noticed is ...
-1
votes
0answers
25 views
1
vote
2answers
81 views

Simple integration with assumption

I would like to evaluate the following simple expression NIntegrate[Re[Exp[I*Omega*t]], {t, 0, 2 Pi}] for Omega real, but ...
0
votes
0answers
26 views

Solving Couples Integrations with Product

I have a set of four coupled integrated equations given below. I was wondering how to go about solving them; since using NDSolve doesn't help. $d(d)/dv= \sin[i]*\cos[i]* ...
1
vote
0answers
42 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 ...
0
votes
1answer
58 views

Numerical integration and plotting

New to Mathematica, and trying to numerically evaluate two integrals: ...
4
votes
1answer
131 views

Slow exponential evaluation over lists

This question,which is still unanswered, might be relevant because it involves NIntegrate over lists and it also has Exp. In ...
0
votes
0answers
31 views

A problem about NIntegrate the smaller eigenvalue for a matrix

Define a matrix and a function as ...
1
vote
1answer
95 views

Quantum Physics question [closed]

I'm not sure if anyone here would be able to help me. But if you know a more appropriate place where I could ask for help, please let me know. So here's the question: And here's my attempt at ...
1
vote
2answers
50 views

Initial Step Size for NIntegrate

I am using Mathematica to numerically integrate a numerically-defined function (from an interpolation and data). This function has a sequence of somewhat unevenly spaced sharp peaks which dominate ...
1
vote
1answer
123 views

Slow evaluation of NIntegrate when used as a pure function

I asked a perhaps related question here. Here is my code in below. The goal is that to define a function which must be integrated numerically. The function itself first is calculated over different ...
3
votes
1answer
194 views

Numerical integration's speed

Consider this numerical integration of Bessel function: Do[NIntegrate[BesselJ[2, x], {x, 0, 10000}], {i, 1, 100}] // AbsoluteTiming {4.033403, Null} This is ...
5
votes
2answers
150 views

How to force Mathematica to throw an error for NIntegrate

Consider this: NIntegrate[BesselJ[2, x], {x, 0, Infinity}] 0.9999999999904574 This is the correct answer. Now: ...
6
votes
1answer
135 views

Strange Behaviour of NIntegrate

I found some of the values remained unevaluated using the following code Table[NIntegrate[Sin[i x]/((2^x + 1) (Sin[x])), {x, -Pi/2, Pi/2}], {i,70, 90}] Pick them ...
2
votes
2answers
205 views

Wolfram Alpha will calculate this definite integral but Mathematica won't

I'm trying to compute a definite integral of the form $$\int_{0.2}^{0.5} \frac{1}{(1 - y)y^2\sqrt{0.5 - y^2 + y^3}}$$ in Mathematica. WolframAlpha will calculate this but Mathematica only outputs the ...
1
vote
1answer
39 views

WhenEvent error in NDSolve

I’m trying to solve a discontinuous differential equation where there are lost of energy when the trajectory cross the discontinuous manifold. The code I used was ...
0
votes
0answers
30 views

NDSolveValue:dsvar error in a system of non linear differential equations generated using a Table

I have a system of 4 non-linear differential equation, that I generate using Table command. On solving, I keep getting a dsvar error that is not going away. I debugged my code and figured it has to do ...
1
vote
0answers
75 views

Extrapolation of area for a 2D integration

I have a set of points distributed almost uniformly in a certain area of a 2D plane as follow: An example of data points (orange) data = {{0.919443, 1.68921*10^-22}, {0.262277, ...
5
votes
2answers
76 views

Initial time as parameter in ParametricNDSolve

I need a help with the function ParametricNDSolve. My goal is solve the equation \begin{array} &&\dot{x}(t) = y(t) \\ &\dot{y}(t) = x(t)-1-\varepsilon Cos(\omega t) \\ &x(t_0) = x_0\\ ...
1
vote
2answers
211 views

Real integral evaluates to imaginary number

The following integral:Integrate[Exp[-2/3 Log[1 + x^3]], {x, 0, 1}] is evaluating to an imaginary number. Its closed-form expression should be ...
1
vote
1answer
136 views

Line integrals over a path defined by a set of points (rather than an analytic formula)

I'm getting inaccurate results when computing (plotting) the value of a function against the length of a line integral, where the path comes from a set of numerically calculated points. (In contrast, ...
0
votes
0answers
54 views

How to properly pass function as argument here? --> NMinimize & NIntegrate involved

I had a problem of a similar kind here which was solved. Now after changing a few things in my problem setting I am suffering from the following problem. Let me first introduce methods/functions that ...
0
votes
0answers
32 views

NDSolve dependence on initial values

I'm checking some results in this paper and I'm currently having some issues with a numerical integration of a set of differential equations using NDSolve (section 2 and 3.1-3.2 in the paper). I'll ...
0
votes
0answers
60 views
0
votes
1answer
47 views

Numerical integration of a three dimensional array

I need to integrate a scalar valued function $f\left(\boldsymbol{x}\right)$ where $\boldsymbol{x}$ is a three dimensional position vector; in other words: $\int_{\Omega} f\left(\boldsymbol{x}\right) ...
1
vote
3answers
95 views

I know the lower limit of an integration as well as the integral. How to find the upper limit of the integration?

I used the following code. NV[x1_, x2_] := NIntegrate[3 x^2, {x, x1, x2}] FindRoot[NV[0, t] == 3, {t, .001}, PrecisionGoal -> 20] Output: ...
2
votes
2answers
133 views
2
votes
2answers
204 views

NIntegrate 2D highly oscillatory function

I am trying to integrate a function, and the error I get is greater than the result. So I need to calculate ...
1
vote
1answer
37 views

Problem with NIntegrate over a user-defined region

I define a region as follows: ...
3
votes
0answers
73 views

Obtaining NIntegrate error estimate

Is there a way to extract the error that Mathematica estimates when calculating a numerical integral using NIntegrate? Internally Mathematica must keep track of this error, because it is used to ...
0
votes
1answer
85 views

NIntegrate vs. summation

I' m interesting in distributions of points on sphere, plane figures etc. Especially for small number of points: 1, 3, 7, ... It seems that good criterion for uniformity of distribution is some ...
0
votes
0answers
24 views

Tricks to speeding up optimisation of a function involving a heavy integration

This is the code, and energycoeffs[] is the function that takes in a dxd matrix and spits out a scalar value. ...
0
votes
1answer
63 views

Integration does not give real value

The code below must be obvious. We are trying to integrate a complicated function from 0 to 1. ...
1
vote
2answers
146 views

Problem with FindMinimum

I am struggling with a problem on fitting a function to my data using FindMinimum. The problem is related to small angle x-ray scattering and my approach is the following: I define the electron ...
0
votes
1answer
34 views

Problems using a complicated function within a LogLinearPlot [duplicate]

my problem is that I have a rather large function which I'm trying to plot, which looks something like this: ...
1
vote
1answer
88 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 ...
3
votes
1answer
106 views

What boundary is added when NDSolve::bcart pops up?

When insufficient boundary conditions are given to NDSolve for solving PDE, the warning NDSolve::bcart pops up: ...
1
vote
2answers
89 views

optimization of CountourPlot with NIntegrate

I have to use ContourPlot with a complicated function depending on 2 parametrs (that I cannot report here) that contains numerical integrations. Here is a simple ...
2
votes
3answers
141 views

Inefficient NIntegrate and Which

In version 10 a simple numerical integraton of piecewise function is highly inefficient: ...
2
votes
1answer
74 views

NIntegrate and Integrate giving different results for ill-behaved function

I'm trying to integrate the following function with Mathematica 8: $$ I(a,b)= \int_0^1 \mathrm{d}x\int_0^1\mathrm{d}y \,\theta(1-x-y) \frac{1}{x a^2-y(1-y)b^2},$$ where $\theta$ is the Heaviside ...