Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
2answers
36 views

Convergence problem in two-dimensional integral

I want to calculate the following two-dimensional integral numerically $$ \int_{0}^{\infty}dx\int_{0}^{\infty}dy\sqrt{xe^{-100x}}\sqrt{ye^{-100y}}\frac{1-e^{1000\imath(x+y)}}{(x+y)(y-0.001)} $$ The ...
0
votes
0answers
17 views

Plotting function containing NIntegrate: trace the values of convergence problems

Suppose you are plotting a function Plot[f[x],{x,0,10}] Where f[x]=NIntegrate[g[x,t],{t,Tmin,Tmax}]. and when plotting, ...
0
votes
0answers
36 views

Building Vector of solutions

I have solved an equation: $\partial_t x = f(x,t)$ by NDsolve. f(x,t) contains a part which is stochastic. I want to solve it for different realization of the stochastic noise and put solutions in ...
4
votes
1answer
378 views

Any possibility to speed up this code?

I am running a Mathematica code to evaluate an integral. The probelm is this code is running too slow. Is there any possibility to speed this up? Here is the code: ...
3
votes
0answers
43 views

Integrate gives wrong result?

Computing the integral of the Euclidian distance of two points in a plane, Mathematica seems to give a wrong result. This is a simple integral that should not be tricky and can easily be computed by ...
0
votes
0answers
30 views

How to integrate a highly oscillatory function [migrated]

I met a problem when I tried to integrate a function which is a oscillatory function as shown in the following figures. How can one prove that this function is divergent?
3
votes
2answers
180 views

Nintegration of coupled function

I have function Q[x,t]=p1[x]*u1[t]+p3[x]*u3[t]+p3[x]*u3[t] where, ...
0
votes
1answer
35 views

Interactive variation of integration limit

I want to compute this function for different values of Kappa, so that I don't have to change Kappa manually. Some kind of ...
0
votes
0answers
53 views

Multidimensional numerical Fourier transform

I'm trying to numerically compute the Fourier transform of the following bump function: $$\hat{r}(k)=\int r(x)e^{ikx}dx$$, where $r\in C^{\infty}_{0}(\mathbb{R}^{2})$, namely: $$r(x)=\begin{cases}\...
-1
votes
0answers
24 views

I have series integration in which limits range also has a variable, How to draw graph of such function? [on hold]

This is the code which i am trying to solve, Kindly help me to plot this function
0
votes
0answers
31 views

3D Plotting and Integrating a Piecewise Exponential function [on hold]

I want to plot the function function $\varphi(x)\in C^{\infty}_{0}(\mathbb{R}^{3})$ given by $$\varphi(x_{1},x_{2},x_{3})=\begin{cases}\exp\left(-\frac{1}{1-x_{1}^{2}}-\frac{1}{1-x_{2}^{2}}-\frac{1}{1-...
0
votes
1answer
69 views

Speed up NIntegration of Bessel functions

Any way to speed such NIntegrate as fast as possible. Also I need exact solution: ...
5
votes
3answers
418 views

Numerically solve a system with 64 equations

I'm trying to numerically solve a system of 64 equations (see picture below for the equation, where Erf is the error function and Q is a 64 by 64 matrix). But typing every single equation seems very ...
5
votes
2answers
77 views
5
votes
2answers
242 views

Funky behaviour of derivative

I'm solving a set of differential equations for the variables H(t), x(t) and a(t). Then I construct a function z(t) from these, and another function w(t) from z(t). w(t) contains terms such as the ...
7
votes
3answers
471 views

Contradiction between Analytic and Numerical Integration

I have the function f[x_, p_, b_] = Exp[-p^2 - x^2]*Exp[4 b*p^2/(1 + 4 b)]/Pi/Sqrt[1 + 4 b] and I want to find \begin{align} \int_{-\infty}^{\infty}\int_{-\...
2
votes
0answers
53 views

Time constrained loop unit

I have a particularly difficult loop, in that it consists of two variables looping and sowing the result if a criteria is met. Overall it works for me, but some certain values for my variables take ...
0
votes
0answers
50 views

How can we apply Laplace transform to a quadratic function?

I need to apply Laplace transform to the following quadratic equation eq=-f[x, t] + 0.5*g[x, t]*g[x, t] How can I define a rule so that I can apply Laplace ...
0
votes
1answer
50 views

Convergence Problem of an exponential

I want to evaluate the following integral numerically ...
4
votes
2answers
82 views

Why does my Block[]ed variable not apply?

Consider the following example: ...
7
votes
5answers
258 views

Expression evaluates numerically inside of Plot but not otherwise

So I'm facing the somewhat bizarre situation where I can plot a function and it shows up fine, but trying to numerically integrate it causes problems. This is the plot command. ...
-2
votes
2answers
66 views

Integrate fails while NIntegrate works

I'm having an odd issue where I am integrating a function (f) (a summation of Legendre polynomials so a polynomial of large order) on a finite domain where the ...
3
votes
1answer
60 views

Saving NIntegrate for many intermediate uses

I need a bit of help speeding up this code: ...
1
vote
1answer
97 views

Using NIntegrate with a combined separable function

I have the function w[x, t] = p1[x]*u1[t] + p2[x]*u2[t] + p3[x]*u3[t] + .... where p1[x], ...
0
votes
1answer
67 views

Cannot solve to find an explicit formula for the derivatives. Consider using the option Method->{“EquationSimplification”->“Residual”} error

I try to numerically solve a first order system of linear ODE's with quite complicated time-dependent coefficients. When I use NDSolve, I get an error NDSolve::...
1
vote
1answer
65 views

NonlinearModelFit::fmgz: Encountered a gradient that is effectively zero

I am trying to solve a nonlinear parameter fitting problem as described by Mathematica code below: ...
1
vote
1answer
45 views

Integrate function in segments of defined area (and get borders)

I have to integrate a function and need to split the area under the function in segments of equal area. Of all the areas I get, I need the values of the borders on the x axis. I found an approach ...
0
votes
1answer
37 views

How to involve a variable in numerical integration? [duplicate]

Now I have two functions f[x] and g[x] which both contains another variable a, or we can note as f[a,x] and g[a,x]. Now I need to solve the equation ...
1
vote
1answer
41 views

Several WhenEvents within NDSolve[] - loss of events

I need to solve a differential equation numerically wherein two "events" must trigger independently and one of the WhenEvent[] "actions" changes it's own "...
0
votes
2answers
121 views

Best way to compute the following numerical integral?

I want to perform NIntegrate[-(2 u)^1000 E^(-2000 u) 1/(1 - 2 u), {u, 0, Infinity}] When I attempt this on my machine, Mathematica warns me that NIntegrate::...
3
votes
2answers
92 views

Using EventLocator to detect periodic solutions in NDSolve

I loop over some systems of DAEs with NDSolve; some solutions are periodic, some are not. When integrating with NDSolve, I ...
2
votes
1answer
79 views

Numerical solution of singular non-linear integral equation

I want to extend this collocation method based mathematica scheme to solve following non-linear integral equation (Cauchy/Carleman type): $$B(v)/(1-v) \int_{0}^{1} \mathrm{d}x B(x) (1-x)/(v-x) = 1 $$ ...
2
votes
1answer
63 views

Adams predictor-corrector method default order

When I select the "Adams" method in NDSolve what is the default order? And how may I change the order?
0
votes
1answer
53 views

How to solve and plot Definite Integral with Symbolic Limits

I need to plot g1, g2, g3 and g4 expressions. To do that, I am trying to evaluate the double defined integral in the three expressions, however I am having issues because one of the integration limits ...
3
votes
1answer
180 views

How do I quickly estimate the area under a complex curve?

I have written a Manipulate function that shows the changing photoperiod (number of hours of daylight per 24-hour day) to which a latitudinal migrant is exposed before, during, and after each of its ...
0
votes
0answers
69 views

Solving nonlinear differential equation with arbitrary boundary conditions

It's a 3rd order nonlinear differential equation, I want to plot the result but it gives different result when I change my starting initial value or bcs. ...
4
votes
1answer
73 views

Generation of global variables when using NDSolveValue and Piecewise function

I am trying to optimize a function which involves NDSolveValue, but I cannot complete the optimization due to a memory leak. As mentioned in Memory leak with NDSolve, the memory leak might be due to a ...
0
votes
1answer
79 views

Plotting a double integral with variable limits

I need to plot the following double integral $\sigma(t)=\sum_{p=2}^N\int_0^td\tau_1\int_0^td\tau_2e^{-|\tau_1-\tau_2|/\tau_A}\tau_1^{\alpha-1}\tau_2^{\alpha-1}E_{\alpha,\alpha}[-(\tau_1/\tau_p)^{\...
3
votes
1answer
90 views

Issue with boundary Integration of FEM numerical solution (interpolation function)

I am having issues in integrating the numerical solution obtained with FEM method and NDSolve, over a boundary. Specifically, i am integrating a specific combination of the gradient over a boundary ...
0
votes
1answer
85 views

Why do I get this nonsensical result for NDSolve with a delay-differential-algebraic system?

I have the following delay-differential-algebraic system: \begin{align} c(t) =& \kappa\min (1, \tfrac{\beta}{\alpha} a(t)), \tag{1a}\\ a(t) =& \left\{ \begin{array}{lcl} \frac{\alpha}{\...
1
vote
0answers
33 views

NIntegrate: how to specify number of points (MaxRecursion is off by one)

I was looking through the documentation for NIntegrate when I came across an example that doesn't seem to make sense. Below is the code (with some minor ...
0
votes
2answers
127 views

FindMinimum problem (edited question)

I am doing the following analysis to find a RHfit function from "din function" that I have defined in the beginning of the code. To verify if RHfit is great or not to use in my future work, I check if ...
1
vote
1answer
47 views

NIntegrate::inumr: error [closed]

I'm new to Mathematica and I keep getting this error(in the title) when I'm trying to solve this definite integral numerically. This is for a math class where we have to use the arc length. ...
1
vote
1answer
55 views

Solve PDE Numerically for only the inhomogeneous part

I want to solve NDSolve[{D[H[r], r, r] + D[H[r], r]/r + k^2 H[r] == DiracDelta[r]/r}, H[r], r] For only the inhomogeneous part. How would put this idea in terms ...
3
votes
4answers
109 views

Nonlinear Differential equation in NDSolve encountering a 1/0

I have nonlinear differential equation that I am trying to get NDSolve to figure out for me. My code is: ...
8
votes
3answers
519 views

Numerically solve the initial value problem for the 1-D wave equation

I want to solve the standard 1-dimensional wave equation $y_{xx}=y_{tt}$ using NDSolve (for $y(x,t)$) with the following conditions: ...
4
votes
2answers
71 views

Fast Method for Numerically Integrating Bessel Functions over Finite Range

I want to evaluate integrals of the kind $$ \int_0^1 x \tanh{x}\, \mathcal{J}_{l + k}(\alpha_{n_1,l+k}\,x)\mathcal{J}_{l}(\alpha_{n_2,l}\,x) \, dx $$ where $\alpha_{n,l}$ is the $n^{th}$ zero of the $...
0
votes
0answers
55 views

Numeric plot in polar coordinate

How can we plot the given function for r = infinity? ...
0
votes
1answer
51 views

Can't get the correct answer with this Adaptive Simpson's Rule algorithm

I think the mathematical portion of my algorithm is correct, but I don't really know the mathematica syntax. How do I get the actual function to be evaluated? Code: ...
4
votes
2answers
128 views

Density of states from numerical integration and then differentiation

for some reason I want to calculate following expression: $$ N(\omega) = \int \limits_{-\pi}^\pi \mathrm{d} x \int \limits_{-\pi}^\pi \mathrm{d} y \int \limits_{-\pi}^\pi \mathrm{d} z \; \delta \left(...