Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
2answers
119 views

Discontinuous boundary condition in NDSolve

Assume we have any PDE to be solved on the rectangular domain $0<X<4$ and $0<y<2$ How do we tell Mathematica to impose the following boundary conditions? $\cases{ U[0,y,t]=0,& if $0&...
0
votes
0answers
64 views

Switching from Integrate to NIntegrate

I'm trying to decrease the amount of time that it takes to run the following code: ...
0
votes
0answers
34 views
6
votes
3answers
148 views

Force WhenEvent to respect default stepsize

I have to numerically integrate an equation system and monitor the accumulating datapoints. For example, I fit a line to a subsample of the points and terminate via ...
2
votes
3answers
193 views

What's the proper way to 'cut out' an irrelevant part of an integral, so I don't run into problems with precision?

I'm doing a numerical integration that involves an integrand with a few exponentials whose values over the integration region range enormously. I'm really only interested in the part of the range that ...
6
votes
0answers
235 views

Problems with NDSolve for solving coupled Schrödinger-like PDEs with perfectly matched layer boundary condition

I'm trying to solve a full-vectorial wave equation for an arbitrarily shaped wave guide, by using NDSolve and perfectly matched layer (PML) conditions. The PML ...
0
votes
1answer
82 views

Difficulty using NDSolve

I am tying to solve two differential equations with two delays numerically. The result didn't come out and it was written that “NDSolve::ndsz:...step size is effectively zero; singularity or stiff ...
1
vote
1answer
74 views

NFourierTransform do not show all points, even change PlotPoints and Exclusions

Needs["FourierSeries`"] I try solve the numerical Fourier transform of this function: ...
0
votes
0answers
41 views

NIntegrate a function in a circular segment

I am trying to integrate numerically a function over a circular segment surface using polar coordinates. In the following example I am using the zero order Bessel function, but any cylindrical ...
4
votes
2answers
116 views

Integrating an interpolating function

I have been using the following NDEigensystem command to generate the eigenfunctions of the laplacian with a square domain: ...
0
votes
1answer
75 views

WorkingPrecision and AccuracyGoal for using with NIntegrate

I'm modeling a quantum tunneling barrier. Because I want to express my quantities in mks units, that means that some of the variables I'm using are pretty small (10^-9). I use NIntegrate for part of ...
-1
votes
2answers
117 views

Numerical approximation using trapezoidal formula [closed]

I have bumped into a problem, that I cannot solve. I have to approximate the value of ln3 using a composite trapezoidal formula, so that the error should be within (10)^-3! How can it be solved?
3
votes
1answer
93 views

Trying to find a temperature profile with a nonlinear 2nd order ODE. NDSolve very sensitive to seemingly arbitrary constant

I am trying to solve this differential equation for a heat transfer problem: \begin{equation} kt\frac{\partial^2 T}{\partial x^2} = \epsilon \sigma T^4, \ \ \ T(0) = T_0, \ \ \ \frac{\partial T}{\...
4
votes
1answer
53 views

NIntegrate crashes without error message when using high precision integrand with non-zero tailing digits

I have a numerical integral that evaluates fine for floating point arguments with low precision (e.g., 4 digits), with argument where only zeros follow the first, e.g., 4 non-zero digits, or with ...
6
votes
1answer
105 views

How do I extract the weights used by NIntegrate?

I'd like to use NIntegrate to adaptively integrate an expression, then use the same points and weights to integrate that expression with some parameters changed. I ...
3
votes
0answers
104 views

Implementing the Numerov method for solving ODEs with NDSolve

I'd like to implement the Numerov scheme for solving an ODE (Scroedinger Eq time-independent) with NDSolve. I tried in analogy with the Runge Kutta example in the ...
1
vote
1answer
79 views

NIntegrate discrepancies

I want to compute a numerical integral for a gaussian trivariate distribution. Say ...
5
votes
2answers
98 views

Convergence data for Monte Carlo NIntegrate

I am using NIntegrate with Method -> "MonteCarlo" to evaluate a high dimensional integral. Is there a way I can obtain a list ...
0
votes
1answer
109 views

Is it possible to get the exact value of the integration?

I have the following code in Mathematica. ...
1
vote
2answers
65 views

Export NDSolve data

I have calculated a solution of a system of differential equations using NDSolve and generated a plot. How could I extract the data of the solutions? The input is ...
0
votes
0answers
41 views

How to solve equation which has three variables and integration?

My equation is in the form x^2+y^2+50[Integrate[Exp[-P^2/10]*Log[(x + y*p + 1)/(x - y*p - 1)],{p,0,100} The range of x and <...
1
vote
0answers
56 views

NIntegration and DSolve with same variable

I need to solve this problem: Then follows the code, with: ...
7
votes
2answers
339 views

Plotting the image of a curve under a flow

I have some explicit time-independent vector field on the plane, and I would like to study how points evolve under the flow generated by this vector field. The flow is rather complicated and cannot be ...
3
votes
4answers
284 views

Using NIntegrate to integrate functions with sharp peaks (Lorentzian-like)

I have a problem with NIntegrate that I do not understand. I want to integrate a function f[x], which has a complicated analytic ...
5
votes
2answers
116 views

Why is NDSolve's StartingStepSize with ExplicitEuler not working? How do I set the step size?

Why do I get a smooth curve (that is obviously wrong) when I run this? ...
1
vote
0answers
37 views

DerivativeFilter[] is scaling down the data by ~100 or so, not a true differentiation? [duplicate]

I'm running the following function vzz = DerivativeFilter[z["Path"][[All, 2]], {1}]; But if I then integrate vzz the output z is about 100 smaller than the ...
2
votes
1answer
46 views

How to couple NIntegrate with FindMinValue

I have a problem with a correct transfer of values of parameters when NIntegrate (and some subsequent functions) are coupled with minimizing procedures in ...
3
votes
2answers
121 views

Reaction-diffusion PDE with NDSolve: either very slow or very inaccurate

I am struggling to have Mathematica 10.3 solve a system of PDE's (with periodic boundary conditions and random initial conditions), but either it produces a set of very noisy InterpolatingFunction ...
0
votes
1answer
58 views

Multiple stopping constraints in NDSolve

I need to numerically solve several differential equations, with several constraints, like this : ...
1
vote
1answer
49 views

numerical integration errors

I have plotted the following integrals with numerical integration nicely without any error: ...
1
vote
1answer
118 views

How to Minimize an NIntegral

My problem is to minimize in Mathematica a numerical integral. The command FindMinimum[With[{R=2.5},NIntegrate[(R*r1*a)*Sin[r1*a],{r1,1,R}]],a] does calculate ...
0
votes
0answers
64 views

How to define an exclusion zone for NDSolve

I need to numerically integrate a differential equation and define two exclusion zones to stop the integration. The Mathematica code looks like this : ...
12
votes
3answers
531 views

Using NDSolve to find particle trajectory

I'm trying to simulate a particle in an electric and magnetic fields, but numerically instead of analytically. This is basically solving the equation $$q \cdot \left(p'\times B\right) + q\cdot E = m ...
1
vote
1answer
73 views

NIntegrate::inumri: error [closed]

I am getting the following error: NIntegrate::inumri: The integrand c (1-0.6 (1-(1+Times[<<2>>])^0.5)-0.4 (1- (1+Times[<<2>>])^0.5)) (1-0.6 (1-(1+Times[<<2>>])^0.5)-0.4 (1- ...
4
votes
1answer
98 views

System of equations is solved by NDSolve over just a tiny domain

I'm solving numerically a system of differential equations with the use of NDSolve. The numerical integration works only a very small interval of the argument. I'm ...
4
votes
0answers
64 views

Numerical instabilities of a convection-(non-)diffusion equation when shrinking from a square to a triangular domain

I am trying to evaluate a parameter-dependent indefinite integral using a PDE-based scheme I described here, and I'm having some trouble when I try and cut down the domain from a square to a triangle. ...
4
votes
1answer
82 views

How can I numerically pre-compute an indefinite integral with a parameter?

Suppose I have a function $f(t)$, and I want to compute its indefinite integral $$F(t)=\int_0^tf(\tau)\mathrm d\tau.$$ Moreover, suppose that, for any of a number of reasons, I require this integral ...
3
votes
1answer
75 views

Split Boundary Value Problems win Algebraic Equations

Is it possible at all to solve with NDSolve (or other built in function) a split boundary value problem with algebraic equations? Please look at the following example: ...
0
votes
0answers
40 views

Integration by using NDSolve [duplicate]

I have no idea how to calculate the problems. For example consider following differential equation (DE): ...
5
votes
3answers
203 views

How to integrate a Bézier function?

I have: points = {{0, 100}, {250, 0}, {0, 300}, {500, 500}} And I want to know the area below the curve, so I came to: ...
2
votes
1answer
117 views

FindRoot of interpolating function from NDSolve

I am having issues finding the root of an interpolating function obtained from NDSolve. For example: ...
0
votes
0answers
42 views

Multiple numerical integrations and green's functions propagation of the solution

I have to solve a system of equations where the coefficients have to be computed from numerical integrations. My problem is that my codes is to extremely slow because I each time that it has to ...
1
vote
1answer
133 views

NIntegrate (Helium Singlet and Triplet) [closed]

I have two integrals that I am calculating using nested NIntegrate. One is for the singlet helium atom and another for triplet. (here, I am calculating variationally the approximate energies and ...
5
votes
1answer
185 views

Mathematica 10.2 is slow to NIntegrate highly oscillatory integrals

I noticed that Mathematica V10.2 is taking much longer to run my code when compared with V9. One function that seems affected is NIntegrate. For example, for a ...
0
votes
0answers
35 views

How do I numerically integrate the result of NDSolve if it depends on several variables?

I am trying to numerically integrate solution of NDSolve. I am trying to integrate my result of NDsolve in line 97 of my notebook, but am getting the error ...
0
votes
0answers
16 views

Integration with IntervalMemberQ

I define an interval and its associated index function. ...
3
votes
1answer
184 views

Numerically integrate a plotted function

I used Plot[NIntegrate[...]...] to plot a function of 5 different variables. It took really long. Right now I need to integrate this function one more time over the ...
1
vote
0answers
72 views

Compiled function and integration

I'm using the recursive functions defined here: MyFnc and myFncC (compiled version). I want to call this functions in the ...
0
votes
0answers
38 views

Recursions where one definition depends on another. How to Block or have local variables?

I have been using Mathematica to solve a second order differential equation using the second order Verlet method. My code looks like: ...
0
votes
0answers
34 views

Mathematica AdaptiveQuasiMontecarlo and AdaptiveMontecarlo yield very different results

I'm trying to perform a numerica integral in 5 dimensions. The integral is quite bad behaved, especially in 3 of them, where the integration regions would be [1, infinity]x[0,infinity]x[1,2] but most ...