# Tagged Questions

Questions on the use of numerical functions NIntegrate and NDSolve.

161 views

### Strange behaviour of integrals with Cos, Sin, and Exp

During the study of the problem How to solve this integration? I have discovered a strange behaviour of some integrals. I would consider it a bug. ...
643 views

### Modelling Hysteresis with a Differential Equation

I want to implement the bulk ferromagnetic hysteresis model (mostly the Jiles-Atherton Model), see http://drum.lib.umd.edu/bitstream/1903/6043/1/PhD_99-1.pdf page 44 equation (30). The needed ...
258 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 ...
130 views

### Slow NIntegrate over complicated domains (sometimes)

This is no longer a problem with Mathematica 10.* where I can use regions to do the integrations Overview I have a very large matrix I need to calculate where each element requires the integration ...
336 views

...
102 views

### Modify NDSolveStateData (if possible)

I am trying to solve a PDE that needs to be scaled constantly (refer to this). @andre suggests I modify NDSolveStateData. Now, the problem is, I'm not used to ...
57 views

### How can I make NIntegrate aware of a singularity along a curve, e.g. a circle in a 3D integral?

I am having some trouble trying to get Mathematica to do a numerical integral over three dimensions which contains a singularity of dimension 1, and I would like some pointers to solid resources on ...
64 views

### N[Integrate] failing to return an accurate result from an interpolated integrand

I need to N[Integrate] a function Cos[alpha*x]*f(x) between x=0 and 30 at increasing alpha-values. Here f(x) is an interpolated function derived from a set of 120 ...
65 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. ...
72 views

### Avoid Evaluation of Function at NDSolve

I have a huge "black-box" f function, which I want to integrate. Let's define it: f[x_,y_,a_]:=a*Exp[-(a*10000)(x^3+y^3)] as ...
112 views

### Using indexed array elements as integration dummy variables with EvaluationMonitor. Bug?

As part of a routine that must cope with integration of varying numbers of dimensions, I would like to use indexed variable names (e.g., x[0], x[1],...) as dummy integration variables. However, it ...
90 views

### Integrate yields complex value, while after variable transformation the result is real. Bug?

I have the follwoing integral: Integrate[1/Sqrt[0.7 + 0.3*(1 + z)^3], {z, 0, Infinity}, Assumptions -> z \[Element] Reals] >> -3.36354 - 3.85013 I the ...
419 views

### Solve integral equation for upper bound

I need to find the upper bound of an integral knowing the value of the lower bound and the result of the integral. Here is my function: f[t_] = Sqrt[1 + E^(-2 t)] ...
73 views

### NIntegrate::ncvbr: How should we interpret and handle this error not mentioned in any documentation?

I have some user-defined module describing my integrand which has to be computed numerically (it's much more complicated than this but bear with me): ...
167 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 ...
106 views

### What are good/best practices to take the Fourier transform of an InterpolatingFunction?

I have a function which I have obtained from numerical integration of a differential equation, and I would like to take its Fourier transform. What are good practices for doing this? To make things ...
79 views

### Integrate function over a 2D implicit surface

I have the following problem. Let's say we have a 2D region, let me be very explicit: ...
121 views

### Mathematica Newmark Optimization

Here is my Mathematica code which implements the Newmark method to solve a equation of motion. The variable "ag" contains the accelerations from an earthquake record. Is it possible to optimize this ...
112 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 ...
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. ...
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 ...
171 views

### Numerical integration: complicated 2D integral seems to be poorly estimated

In the course of some physics research I've been working on, a very annoying integral has appeared that I'm having difficulty evaluating numerically. Any help you could offer would be greatly ...
135 views

### Nested NIntegrate of vector function

I am trying to perform a nested integration where the upper limit of the inner integral depends on the value of the outer integral, like in this question: Nested NIntegrate. Just like the linked ...
321 views

### Function with a sharp resonance which Mathematica fails to integrate. Why?

I'm a new user of Mathematica and I'm trying to use it to calculate the collisional cross-section as a function of energy for a given potential and decay rate. I know that the resulting function ...
283 views

### Global vs local adaptive integration: lattice propagator

I was doing the first exercise in the paper Lattice QCD for Novices. This is the expected result: With the default "GlobalAdaptive" method for NIntegrate it threw errors saying that the error had ...
2k views

### NDSolve: methods and step size choosing

I am looking into the documentation of NDSolve[]; more precisely how this function chooses the StepSize and how it chooses which ...
2k views

298 views

### Slow integration of interpolating function

I have a large file with irregularly spaced data in the format: ...
84 views

### ParametricNDSolve and ProcessEquations

I have a question regarding NDSolve`ProcessEquations and ParametricNDSolve. When using the regular NDSolve we have the option to divide the integration into the three steps ProcessEquations, Iterate ...
131 views

### Constrain integration to be over real domain

I am trying to integrate the following: Integrate[(2*Cos[Sqrt[F]*z - G])/E^(D*(p + z)^2), {z, -(h/2), h/2}] I am getting solution in complex domain: ...
147 views

### Whether NIntegrate evaluation is multithreaded or not?

About MultiThread evaluation I am talking about here, see this post I am NIntegrate the function grarm[e, 3, dimension, 1, 1, 0.005]. There is matrix operation in ...