# Tagged Questions

Questions on the use of numerical functions NIntegrate and NDSolve.

166 views

### More issues Integrate, NIntegrate, FindRoot

I'm trying to solve a system of 3 non-linear equations using FindRoot and Integrate. If I start FindRoot[] close to the right answer, it works well but returns a bunch of error messages first. ...
2k views

### How to use NDSolve to track equilibrium?

I am looking for an extension of NDSolve where integration runs until certain variables are settled at an equilibrium. Now I have a working solution in my sleeves ...
2k views

### Finding the volume of a sphere using the Monte Carlo algorithm

I used the following code to find the volume of the sphere $x^2+y^2+z^2 \leq 1$ in the first octant: ...
432 views

### How to implement custom integration rules for use by NIntegrate?

How can NIntegrate be extended with custom implementation of integration rules? This answer of the question "Monte Carlo integration with random numbers generated ...
2k views

### Methods to speed up numerical NDSolve, NIntegrate,

I am not very used to do numerical simulations on Mathematica. Do you have any ideas how to improve i.e. speed up my code? ...
1k views

### Integration strategies for oscillatory multidimensional function

I am seeking to integrate a highly oscillatory, multidimensional function. I am currently using NIntegrate's QuasiMonteCarlo approach. However, this is time-consuming and, given my current resources, ...
518 views

### Mismatch between numerical and analytic evaluation of an integral

I evaluated the following integral $$\int_0^1 \sqrt{r} \left | \cos \left(\left(k+\frac{1}{2}\right) \pi r\right)\right | dr$$ ...
406 views

### WhenEvent and partial derivatives

Can WhenEvent be used to reset the conditions on a PDE at a given time? How would the syntax of that be? This is the code I`m using ...
400 views

2k views

### Kramers-Kronig in Mathematica

I am trying to calculate the change of the refractive index from the change of the absorption coefficient using the Kramers-Kronig relations, in Mathematica. ...
932 views

### The difference between “SymbolicProcessing” -> 0 and restricting the function definition to numeric values only

The Documentation tells us that there are two ways to disable symbolic processing of the integrand by the NIntegrate function when it is known that it just slows ...
385 views

### How to distinguish between lists and values?

I have a (hopefully small) problem with some numerical integration algorithm, more specifically I want to integrate the imaginary part of a complex valued function, e.g. ...
411 views

### How much time should one give Mathematica for an integral evaluation?

Sometimes when I do integrals in Mathematica (M), it keeps thinking and thinking and I have no idea what is going on inside M. For how long should one wait or how does one know whether M has not got ...
334 views

### Cannot Get Numerical Results to Match

I try this numerical summation (in two parts) ...
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 ...
4k views

### Stategies to avoid NIntegrate::slwcon error

I am trying to numerically evaluate an integral whose integrand depends on two parameters, say $(a,b)$ and when $b\gg 1$ I suspect (although it's not guaranteed) that the integrand is very small. Thus ...
832 views

### Why can't I change the value of MaxRecursion in NIntegrate when integrating BesselJ?

Bug introduced in 8.0.4 or earlier and persists through 10.4. I am trying to evaluate this integral numerically $$\int_0^{\infty } J_0(q R) \tanh(q) \, \mathrm{d}q$$ for large values of $R$. ...
538 views

### What does MaxStepFraction do?

I find that with NDSolve[...] while solving a partial differential equation, changing the MaxStepFraction from ...
408 views

### How to solve this Integral equation

D[x[t] - x[t - 1]/(2 E), {t, 3}] + Integrate[E^(-Î´)*x[t - Î´]/5^t, {Î´, 2, 2.5}] == 0 I found solve this problem is hard with Mathematica. I also find a article ...
2k views

### NDSolve does not respond

For some sets of constants, NDSolve gives me true solutions, but when I try for example, T = 1/(2*2200), Mathematica does not respond. What can I do? The code below ...
711 views

### NDSolve Problem

I am trying to solve a chemical equilibrium ODE with NDSolve where one function is the argument to another. I.E. My equations look like: ...
351 views

### Syntax for integrating over limits specified by a Table

I wish to use NIntegrate to compute multidimensional integrals. However, I don't want to manually input the limits for the dimensions. I want to store the ...
119 views

### Why NIntegrate is badly-behaved on $J_{\frac{9}{2}}(x)$ by default?

A friend of mine showed me this example: Plot[BesselJ[9/2, x], {x, 0, 1}, PlotLabel -> Style["The integrand seems to be simple", 14]] ...
658 views

### Conditional numerical integration boundaries

I have a multidimensional integration of the form: ...
255 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 ...
3k views

### Finding y given x from an interpolating function

I would like to put a dot on the point of a curve that has a specific y value but I don't know the x value. A simple example of my code is ...
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 ...
513 views

### Starting NDSolve from intermediate time step?

I always wondered if I could start NDSolve from an intermediate time step. What I mean is, in the code sample below, if I were to run my solution from ...
141 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: ...
295 views

### FEM giving “ … is not a polynomial error”

Executing the program below I get the ... is not a polynomial error message. I don't have an idea why I am getting this -- any suggestions? ...
213 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 ...
1k views

### Why does this integral have a complex component?

I wanted to find the probability of my normally-distributed random variable being at least 15, so I set up this integral: ...
427 views

...
558 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 r^2(h^2-1)h$$...
128 views

### Undershoot/Overshoot Method for this differential equation?

I have tried to solve this equation for some weeks and I am not capable. I have read in articles that it is easy with an undershoot/overshoot method, but I don't know how to do it. \$y''+\frac{3}{x}y'-...
236 views

### Plot result of non analytical-integral

I have the following function: h = 1; c = 1; k = 1; B2 = (2*h*c^2)/(x^5 (Exp[(h*c)/(x*k*T)] - 1)); (someone can see that this integral is the Planck function). ...
83 views

### How can I combine NIntegrate with NDSolve?

I have no idea how to calculate the problems. For example consider following differential equation (DE): ...
284 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 ...
2k views

### How to calculate the volume of a convex hull?

Given a spatial curve represented by a parametric equation, is it possible in Mathematica 9 to calculate symbolically (or at least numerically) the volume of its convex hull?
163 views

### How to implement custom NIntegrate integration strategies?

How can new integration strategies algorithms be used with NIntegrate? This is a different type of extension than the extensions with new integration rules, as ...
606 views

### How to guarantee that NDSolve correctly detects abrupt changes in parameters?

When using NDSolve, I often have parameters that, in most of their domain, have a constant or null variation, but that suffer from abrupt variations on a very small ...
1k views

### 3D orbits and inaccuracy over time

I wrote a little program to use Newton's Law of Universal Gravitation to animate 3 planets orbiting a central star, but I have run into a problem. Here is the code that I used to create the program (I ...
309 views

### Inconsistent behavior of WhenEvent[ ]

Consider the following simple example: ...
939 views

### NDSolve: Normalizing at every step

Suppose I have an transport equation with an initial conditions: ...