# Tagged Questions

Questions on the use of numerical functions NIntegrate and NDSolve.

296 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. ...
277 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: ...
247 views

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

Consider simple use of NDSolve[] function used to solve an ODE backward in time ...
142 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 ...
56 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: ...
143 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 ...
195 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 <...
128 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. ...
164 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 ...
170 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 ...
273 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 ...
99 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 ...
102 views

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

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

### In NMinimize, how can I efficiently handle NIntegrate errors for non-integrable functions?

I am using NMinimize to find parameters that minimise the integral of a function in the least squares sense: ...
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 ...
216 views

81 views

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

If my function is ...
284 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 ...
662 views

209 views

91 views

### What am I missing in this highly oscillatory integral?

I want to numerically integrate this equation (in python without calling Mathematica): $\int_0^\infty {\rm d}k f(k) J_v(r k) J_n(s k)$ where $f(k)$ is a non-smooth function, $J_v$ are the Bessel ...
162 views

### How to make the plot smooth

There are some stranges point which cause the figure isn't smooth. I think that the reason is the method of numericial integration. Here is my code, it's pleasure that one can revise the drawbacks in ...
96 views

### Integrate yielding a ConditionalExpression but I don't think the condition is necessary

Suppose I take the PDF of the LogNormal distribution with parameters m and s evaluated at x. I obviously get an expression involving m. I now want to integrate that expression not with respect to x ...
108 views

### How to resolve the singularity in NDSolve

I ran into a problem in my Mathematica code. There is a singularity or stiff system in NDSolve. The explicit code is as follows: ...
180 views

### Numerical solution to integral equation

I have an integral equation where one factor $f(t)$ in the integrand is defined in terms of an integral equation where it is again a factor. $\quad \quad y[t]=\int _0^tf[\tau ]g[t-\tau ]d\tau + h[t]$...
163 views

### How to solve constraint differential equations using If function

I have to solve a series of differential equations along with a constraint that has to be satisfied at each point of time where $t\in [0, 100]$ The model parameters are ...