# Tagged Questions

Questions on the use of numerical functions NIntegrate and NDSolve.

147 views

### NIntegrate with variable limit of integration [duplicate]

Hey guys Im working with this integral and I can´t get it right. ...
293 views

### Follow up: how to plot a function under NDSolve domain

Here is the details of the code to plot. ...
110 views

### integration of a list of gaussian type orbitals (GTO)

I am currently trying to integrate various components of a current density (j={jx,jy,jz}) over space. The problem is that the current j is extracted from a quantum chemical computation and is a sum of ...
77 views

### Fit a polynomial/curve to an NIntegrate result

I want to NIntegrate a function which also contains some parameter. In the end, I would like to plot the result as a function of one of these parameters. The thing ...
235 views

### Attempting to use NDSolve to plot harmonic oscillator solutions

NDSolve[{ (-y''[r]/1880) + (470 (0.04077)^2 r^2 - 48 + 1/(1880 r^2)) y[r] == 0, y[0] = 0, y'[0] = 0}, y, {r, -4, 4}] I use this but get errors and am ...
129 views

### A 1D numerical integral Mathematica cannot compute, from physics

A well know result in theoretical physics is that a sum over Matsubara fermionic frequencies, i.e.: $$S = \sum_{n=-\infty}^{\infty} h(\omega_n) \hspace{32pt} \omega_n=(2n+1)\frac{\pi}{\beta}$$ can ...
136 views

### Trapezoid Integration over a list of pairs [duplicate]

I have two very connected questions: Is there really no built-in function to integrate a list of pairs without converting to a function? Something like: ...
182 views

### Solving non-linear differential equation

For my research project I need to solve the following integral ...
102 views

### Problem with NIntegrate and FindFit [closed]

I fit the experimental curve with the model using the following equation, ...
48 views

### Problem with curve fit using integral [closed]

I need fitting a Langevin function on a experimental data, but one parameter must be firstly optimized by using a Lognormal distribution. The complete expression could be written as: The integrate ...
234 views

### How to locate the position of a periodic orbit

These are the equations of the dynamical system ...
112 views

### Can't NIntegrate my NDSolve results

I want to NIntegrate my NDSolve result. I don't have a exact function form because it is coming from the ...
59 views

### WhenEvent stops working after first instance

I'm modelling a very simple physical situation is which an object is rested on two moving fingers. Sometimes the object moves with one finger while sliding over the other, while at other critical ...
49 views

### NIntegrate within NMinimize - how to optimize the code?

How I can optimize these numerical calculations? Most annoying is encountering instabilities (numerical errors). I have a predefined function: ...
108 views

### Numerical integration of oscillatory function

I am trying to evaluate the following oscillatory integration numerically but the answers are wrong or not accurate enough. I don't know what the problem is. ...
270 views

### NIntegrate fails to converge under almost any PrecisionGoal, MinRecursion etc. How can I trust the result?

I have been getting some ideas by reading other related questions in the forum, but the integral I have to do is not converging in many cases. The integrand is of the form: ...
97 views

### numerical integration of equation obtained by ParametricNDSolve

I am trying to find a definite integral of the solution obtained using ParametricNDSolve (i.e. y[x,a,b]) from 0 to 1 and plot ...
1k views

### Numerical integration — Mathematica vs Python (w/ Scipy) performance

I'm about to tackle a problem that involves a lot of (multi-dimensional) numerical integrations and also subsequent optimizations, and so I want to make sure at least the integration step is as fast ...
60 views

### Continuous integration of a tensor function using discrete density values

Hei, I am wondering is it possible to implement continuous integration using Integrate() of a fourth order tensor with discrete density values. ...
252 views

### error with NIntegrate and RegionPlot

Bug introduced in 10.2 or earlier and persisting through 10.2 or later Here's a simplified example of what I'm trying to do: ...
222 views

### Backward in time numerical integration with fixed time step

Consider simple use of NDSolve[] function used to solve an ODE backward in time ...
136 views

### Differentiate a numerically defined function

My function is f[a_, b_] := NIntegrate[Sqrt[(Cos[t] - a)^2 + b^2], {t, 0, Pi}] I want to calculate g[1,1] where ...
55 views

### NIntegrate option for FourierSeries

I would like to use FourierSeries but it is very slow. My guess is that it is because it uses symbolic integration: ...
141 views

### How to determine the parameter in a differential equation with some fixed solution

Assuming that I have a ODE system with undetermined parameter $$x''(t) == y(t) x(t)$$ $$y'(t) == 2 - a x(t)$$ and I have some fixed solution condition $$x(0)=0$$ $$x(10)=8$$ $$y(10)=3.5$$ Is there ...
183 views

### How do I exclude regions from numeric integration on Mathematica?

The part of the equation that is giving me trouble is below: f[t_,v_]:= Exp[-(1/Log[1-t/v]^2)]*(v-t) I need to integrate this function over the ranges .1 <...
126 views

### NSolve doesn't work on an equation containing a numerical integral and constraints

I'm having trouble getting Mathematica to solve equations numerically. I know that its important to specify the type of variables for pattern testing (see e.g. here) but this doesn't seem to work. ...
162 views

### Why am I getting different answers for an integral depending on method?

I'm trying to carry out an integral and I'm finding different answers depending on which method I choose to integrate with. I assume this has something to do with divergent pieces but I don't ...
162 views

### Maximizing a function defined using NIntegrate [duplicate]

I have two functions fn[x,y,z] which is in integral form and I have another function gn[x,y] which is also in integral form ...
252 views

### How to do multi-dimensional principal value integration?

The toy model is: $$\int_{-2}^{2}\int_{-2}^{2}\frac{1}{1-(x^2+y^2)}\, dx\, dy$$ The integrand have opposite sign across the circle $x^2+y^2=1$, so one would expect that the integral has meaning only ...
96 views

### How to speed up the evaluation of a function with a large LeafCount but many repeated sub-functions for use in NIntegrate

General Context Apparently, the memory leak in NIntegrate is unavoidable pre-MMA-10.2. I have some (two-dimensional) numerical integration to do on a complicated ...
100 views

### Three Dimensional Plot of Numerical Integral with Delta Function

I want to plot the definite integral of the following function ...
84 views

### Integrate works but NIntegrate doesn't

I have a complicated integral function that I'm trying to evaluate, which will have to be done numerically. I wanted to try a simpler one first, one that has an analytic form, because I could check ...
209 views

79 views

### How I can write to change a lot of variants and store my values from loop

If my function is ...
274 views

### Postprocessing of CFD results in Mathematica

I was trying to perform computational fluid dynamics (CFD) post-processing in Mathematica after solving primitive variables from Navier-Stokes equation, mainly $(u,v)$, $(Px,Py)$. Since I am not an ...
I have to find and plot a numerical solution for this second order differential equation: u''[x] + (u'[x]/x) - (u[x]/(x^2)) + u[x] - u[x]^3 = 0 where $0\leq x &... 0answers 44 views ### Evaluation stops, no error I'm trying to iterate NIntegrate using Table so that I can plot the result as a function of an external angle. It's an oscillatory function so it gives some error on the estimate for the value, but ... 1answer 453 views ### Nintegrate has memory leak Bug introduced in 6.0 and fixed in 10.2.0 NIntegrates uses memory and does not release it. For long loops with NIntegrate ... 1answer 96 views ### NIntegrate and memory use [duplicate] I wonder why NIntegrate uses memory. I have a long integral computation repeated thousands times. The memory use then goes up and speed goes down. I think I spot a ... 0answers 97 views ### Nasty integral advice I have a pretty ferocious integral to solve, and since it doesn't seem I'll be able to do much analytically, I've taken to Mathematica to get some information. Mainly, I want to see if there are any ... 1answer 115 views ### Does not evaluate the Integral and a plane plot I am trying to compute a ContourPlot and a VectorPlot using the following functions: ... 1answer 136 views ### Plot the result of NIntegrate for different parameter values I want to plot the result of a numerical integration containing a parameter in terms of the parameter. The code is: ... 0answers 56 views ### Is there a IsDefinedQ function? [duplicate] I have a function which is a bit expensive to calculate. I want to translate and integrate. I want to translate by values on a grid, store the values of the integral and refine the grid. That is, I ... 0answers 64 views ### What am I missing in this integration? Trying to solve diff.eq.has led me to: ... 0answers 278 views ### NDSolve fixed step problem Working example here: Drive folder (have both files in the same directory! Notice: the line <<variables' in the file seems to throw an error for me, but ... 0answers 66 views ### How to solve algebra equations containing integration and parameters? I'm trying to solve two nonlinear algebra equations for two unknown parameters, U and Tf. Since some terms in these equations contain integration, and the integration also contains U and Tf. The main ... 2answers 269 views ### Plotting a parametric function containing an integral [closed] I need to plot this expression $$\phi(s; H,B)=\left(\int_{0}^{s}\frac{1+B\ \sin2H\ t}{\sqrt{1+B^2+2B\sin2H\ t}} \text{d} t,\ \frac{1}{2H}\sqrt{1+B^2+2B\sin2H\ s}\right)$$ for$H=0.5$,$B=0, 0.5, 1, ...
Bug introduced in 9.0 or earlier and persisting through 10.2 or later I tried to solve Hamiltonian system ($Q$ is a vector of all generalized coordinates, $P$ - of generalized momentum)  \frac{\...