Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
1answer
40 views

Evaluation of a large integral

I have a complicated large integral I want to evaluate (does not have a closed form, need an approximation), but Mathematica seems to keep "Running...". Is there any way to make Mathematica use more ...
0
votes
0answers
37 views

Plotting and NIntegrate [on hold]

I have a problem. I try to make such a plot: function = y^(3/2)*Exp[I t y - y^2]; Plot[NIntegrate[function, {y, -∞, ∞}], {t, -20, 20}] But I have no plot - I ...
1
vote
0answers
31 views

NDSolve PDE, not enough boundary condition?

The PDE that I want to solve is: $$ \frac{\partial f}{\partial t} + \frac{1}{m} \left( p_x \frac{\partial f}{\partial x} + p_y \frac{\partial f}{\partial y} + p_z \frac{\partial f}{\partial z} \right) ...
1
vote
1answer
44 views

Numerically Integrating to find a Maximum using NDSolve

I am trying to numerically find an equilibrium (maximum) of a function using its differential. The following is a simplified version. ...
2
votes
1answer
69 views

Finding a root of a parameterized integral

I have a function given as a parameterized definite integral: f[a_] := Integrate[BesselJ[0, x - a] BesselJ[0, x + a], {x, -∞, ∞}] I suspect it has a root near ...
0
votes
0answers
39 views

How to calculate the analytical result of this double integral?

I'm trying to solve this double integral: $I(a,b)=\displaystyle{\int_{-1}^{1}dy\int_1^{\infty } \dfrac{y\left(x^2-1\right) e^{-ax} }{b-\frac{\sqrt{x^2-1}}{x}y} \, dx} \,\, ...
1
vote
0answers
56 views

Numerically solving a 2D oscillating integral

I'm having trouble solving this integral numerically: ...
0
votes
0answers
25 views

Calculating Muliti-integral Time-Ordering operator [migrated]

I am trying to solve the time-ordering operator Like this: $S(t)=\mathcal{T}e^{\int_0^tduA(u)\int_0^udvB(v)}S(0)$. How can I calculate S(t) with minimum error?
-3
votes
1answer
78 views

My code is not converging using NIntegrate. Why? Help please [closed]

I have been trying to see why this integration is not converging but to no avail. The output gives only the y-values but fail to give any real value for x-values. Rather I always have something like ...
0
votes
0answers
17 views

NDSolve break condition

I'm solving a differential equation numerically by NDSolve[{p'[r] == -function[r,p[r]], p[0] == pcenter}, p,{r, 0, rmax}] with function>0. At some r, p[r] ...
1
vote
3answers
82 views

NIntegrate Trapezoid rule with even subdivision producing poor results

NIntegrate[x^2, {x, 5, 9}, Method -> {"TrapezoidalRule", "Points" -> 2, "RombergQuadrature" -> False}, MaxRecursion -> 1] returns the ...
0
votes
1answer
54 views

Compute integral symbolically

I want to compute the following integral: ...
0
votes
0answers
22 views

Pass model parameters to NDSolve'Reinitialize

I am wondering if there is a way to pass parameter values during the NDSolve'Reinitialize step of the NDSolve process? I've read that one way to possibly speed up repeated calls to NDSolve is to ...
0
votes
1answer
130 views

Numerical solution of the hyperbolic equation

I am trying to solve the following hyperbolic equation with given boundary conditions: I choose as initial condition $u=1$, and evolve the above hyperbolic equation until reaching a stationary ...
0
votes
0answers
37 views

Resolving initial / boundary condition conflicts ?

This is likely very simple, but I often run into trouble with inconsistent boundary conditions for PDEs; While I know Mathematica sometimes produces "false" errors for spatial derivative conditions, ...
0
votes
2answers
130 views

Problems with NIntegrate

I'm having trouble to do the following numerical integrations: ...
0
votes
3answers
104 views

How to display the value of a very small number instead of “0.” [duplicate]

I need to perform an integration. There is one particular value, which may be very small that is showing up as 0.. Is there any command in Mathematica 9 that will ...
0
votes
0answers
78 views

To solve an equation

I am trying to solve the equation: Solve[Re[Integrate[(2 c - (r^2) Exp[- I 1.4746])^(0.5), {r, 0, 31.7576}]] == 2.1216, c] I want to integrate an expression in ...
1
vote
0answers
23 views

Nested NIntegrate of vector function

I am performing a nested integration where the upper limit of the inner integral depends on the value of the outer integral, like in the question [Nested NIntegrate]. As in this question my function ...
1
vote
2answers
84 views

Problem evaluating a complicated integral

Apologies for stating my problem poorly in the first instance, thank you for the help in narrowing down the issue. Problem For those interested, it's for the exact unbiased inverse of the ...
1
vote
0answers
83 views

How to specify the time variable for NDSolve

I recall that it is possible to specify which independent variable is the "time" variable in NDSolve, but I can't find it documented anywhere. Does anyone recall ...
1
vote
0answers
70 views

Speeding up the numerical integration of a certain function

I'm using the following function f[t_] := 3/4 t^-3 NIntegrate[(x^4*Csch[x/2]^2), {x, 0, t}, Method -> {Automatic, "SymbolicProcessing" -> 0}]; I ...
0
votes
1answer
54 views

How to get correct numerical integration which should be zero? [duplicate]

I want to numerically integrate function berrycur over kx and ky. The definition of berrycur is given at the end of the ...
0
votes
1answer
59 views

wolfram mathematica intersection of two surfaces [duplicate]

I use wolfram mathematica. There is a function of two variables which defines the surface z = f(x,y), the second surface is defined as z = const. How to find the line of intersection of these two ...
0
votes
0answers
27 views

NIntegrate Issue: Changing integration limits makes calculation time extremely long

After a long time developing some code in mathematica and finally getting it to work, I have unfortunately encountered an odd problem: When I change the limits of integration (and shift the function ...
-1
votes
2answers
63 views

Strange numerical integration result

I write a function called berrycur[kx,ky] which I will give at the end of the question, and want to numerically integrate this function over {kx, -2π, 2π]}, {ky, 0, ...
0
votes
0answers
36 views

Comparing NIntegrate with definite integration

I want to calculate without error a sum of double integrals with the following definitions for the functions within them: ...
0
votes
1answer
53 views

Numerical integration with purely numerical integrand

I'm trying to perform a numerical integral with an integrand that should not be manipulated with any symbolic preprocessing whatsoever. Consider the following simple test : ...
0
votes
0answers
60 views

NIntegrate: integrand has evaluated to non numerical values

I have pasted a code that has been giving me some trouble and errors when I try to compute. ERROR: "The integrand 1435.1232 E^(-6.4703566*10^6 s^2) deEntrance[s,phi]^2 has evaluated to ...
1
vote
0answers
66 views

NIntegrate (multi-dimensional integral)

I am interested in the numerical evaluation of the following integral: $\int \prod_{i=1}^n dx_i \delta(\sum_{i=1}^n x_i) \prod_{i=1}^n f_i(x_i)$ where $f(x)$ is a complicated function. Unfortunately ...
3
votes
2answers
168 views

Integration and Fourier transform

I would like to calculate the distribution function from the characteristic function. There is a formula given as $$F_X(x)=\frac{1}{2}+\frac{1}{2\pi}\int_{0}^\infty \frac{e^{i w x}\phi(-w)-e^{-i w ...
4
votes
2answers
154 views

Calculating the area under a curve, but above a certain threshold value

so here I am with a time series of data (hours (t) and corresponding measurements (a)). ...
0
votes
1answer
87 views

NIntegrate: Catastrophic loss of precision

Below is a simplified code that I am trying to evaluate. I am basically getting the rms value of a Wakefield function. When I finally try to evaluate the rms, I get an error. Any help would be greatly ...
0
votes
1answer
66 views

NIntegrate returns zero for non zero integrand, 4d Integration

I am trying to calculate the following integral. ...
0
votes
1answer
55 views

Integrating function can't be epressed? [closed]

Hi I have a function in a form of $$\frac{a}{x}exp(\frac{b}{\sqrt{3}-x})$$ The code is Integrate[a/x*E^(b/(3^0.5 - x)), {x, 1, 3^0.5}] But it can't work ...
5
votes
3answers
274 views

RK4 Gravity Simulator

I have the following RK4 solver which splits the two 2nd order ODEs, used to calculate x and y positions under the influence of a gravitating body where $$x''(t)=\frac{G m ...
0
votes
0answers
44 views

Code for solving numerically an integro-differential equation

First of all, I want to greet the community. This is my first question, but I hope I will be able to help answering others members questions, although I am quite new working with Mathematica. I would ...
0
votes
1answer
35 views

Calculate Integral with cos [closed]

Integrate[ (Pi/4 - x/2) cos (n *x), {x, 0, Pi}] This doesnt give me desired results .n is natural 1,2,3,4,5... I want to get something like ...
1
vote
1answer
83 views

NIntegrate failed to converge?

Hey guys I have a pretty simple code that consists of an RMS calculation. The issue is that I am getting quite a few error messages when I run it. The following equations are highly published physics ...
1
vote
0answers
59 views

Speeding Up NIntegrate and ?NumericQ

I have attached below a piece of code that has been running successfully but takes extremely long for mathematica to compute. I believe it is the last "rms" calculation and the fact that I am using ...
0
votes
1answer
37 views

Error message from NDSolve using WhenEvent

I am working with the following NDSolve expression: ...
1
vote
4answers
305 views

How to calculate this integral?

I am trying to Integrate the following Integral : $\int_1^{\infty } \dfrac{\left(x^2-1\right)^{13/2} e^{-ax} }{x^{10}} \, dx \,\, \,\,\,\,\,\,\,\,\,\,\,\,(a=\textrm{real>0})$ Mathematica didn't ...
2
votes
2answers
254 views

How to compute this triple integral? [closed]

In Mathematica how can I compute this integral:$$ \iiint_{D}\sqrt{(1-9z^2)(1-4y^2-9z^2)}\,dx\,dy\,dz$$ where D is the domain: $$D: x^2 +4y^2+9z^2\le1$$ Please I need help!!!
1
vote
1answer
129 views

Runge-Kutta 2nd Order ODE Solver

Suppose I have a 2nd order ODE of the form y''(t) = 1/y with y(0) = 0 and y'(0) = 10, and ...
1
vote
0answers
50 views

Multidimensional Numerical Integral with Singular Behavior [closed]

I'm trying to numerically integrate a multidimensional integral where there is singular behavior when x = y. This is the integral ...
3
votes
1answer
88 views

Integrating a functional of an InterpolatingFunction

It is straightforward to Integrate an InterpolatingFunction. However, even for a simple functional of an ...
7
votes
1answer
71 views

Unify the sampling of NIntegrate[ {f, g, h} w ]

I'm trying to numerically integrate a function which has a vector-valued slow part and a much faster component which is shared by all the components, i.e. an integral of the form $$ ...
0
votes
1answer
106 views

Better way to check conservation in NDSolve

The partial differential equation in the NDSolve below is conservative (by construction) of $\int_{-1}^{+1} p(t,z)\ dz$ for all $t$. ...
0
votes
1answer
132 views

Zooming into Parametric Animation Plot that Uses InterpolatingFunctions

I have an interplanetary trajectory solver that calculates a spacecraft route from Earth to Mars, and I am trying to zoom into the spacecraft when it reaches its Mars intercept orbit but am having ...