Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
2answers
117 views

Solving a set of nonlinear equations

I am trying to setup and solve a set of nonlinear equations. I keep getting an error. Here is my problem: ...
0
votes
1answer
65 views

Error message when running NDSolveValue

I am trying to solve a set of differential equations but keep getting an error. See message below "NDSolveValue::ndnum: Encountered non-numerical value for a derivative at t=0" The system that I ...
1
vote
2answers
87 views

Stop Integration in NDSolve

The following code executes properly for some choices of initial points and parameter c, but fails for other choices. Could the failure be due to computation outside of the defined t, x, and y ranges? ...
1
vote
0answers
32 views

Numerical integration and interpolation with free parameters [closed]

I hope you'll be able to give me a hand on my question, I'm stuck and don't know how to make it work. First of all, I have a table of data pairs (x,f): ...
2
votes
0answers
32 views

Use of AccuracyGoal & MachinePrecision in NIntegrate

I just learned about the Inverse Symbolic Calculator and it seems like a very useful tool. For example, to find an analytic solution to $$ \int_0^{\infty } \frac{1-e^{-x} (x+1)}{\left(e^x-1\right) \...
8
votes
2answers
131 views

Bug in NDSolve/WhenEvent?

Bug introduced in v10. I'm fairly sure the following is a bug, and I would normally just report it to WRI. However, this is related to my answer to When using NDsolve, how to determine the ...
28
votes
2answers
484 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 ...
3
votes
1answer
102 views

Understanding difference between `NIntegrate` result and home-cooked Simpson's rule

In this question I am asking about the different results I get between NIntegrate-ing a function of two variables vs. "doing it myself" with my own implementation ...
0
votes
1answer
205 views

How to pass arguments in NIntegrate and NDSolve

I am solving PDEs with NDSolve and NIntegrate, but I do not know how to pass arguments correctly. My orignial code is very ...
0
votes
1answer
75 views
0
votes
0answers
53 views

Double Integral with NDSolve!

I have fivefold multiple integral and I wanted a speed calculations.I came across on this Question and had already begun the problems. Here is a toy example with simple double integral: ...
2
votes
2answers
68 views
1
vote
2answers
124 views

NIntegrate evaluates its 1st argument while it has the attribute HoldAll?

NIntegrate owns the attribute HoldAll: Attributes@NIntegrate (* {HoldAll, Protected} *) ...
0
votes
1answer
94 views
1
vote
0answers
23 views

Launching specific remote kernels in parallel

For some reason I found that my numerical integration runs much faster on Mathematica 9 than on Mathematica 10. Since I sent my calculation to a cluster with 24 cores with the following command <...
11
votes
2answers
127 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]] ...
3
votes
2answers
141 views

Integrate on a contour in the complex plane

I want to integrate the function f[z]= z + Conjugate[z] over a circle of radius 2 centered at the origin. For the sake of stating something that I have tried: <...
0
votes
1answer
78 views

Negative numerical result when integrating a strictly non-negative integrand

Although there are similar posts here Negative integral of a positive function , Positive integrand giving negative answer , my case is even more surprising. I have a very simple function ...
2
votes
2answers
140 views

NIntegrate fails in a very strange way

I found a strange behavior in Mathematica when trying to evaluate the integral $$f(n) = \int_{1}^2 \frac{\Gamma(n)\Gamma(x)}{\Gamma(x+n)}{\rm d}x$$ I evaluate this using ...
0
votes
0answers
33 views
1
vote
1answer
52 views

How to solve an iterative integral equation for a function in Mathematica 8.0?

I would like to solve the following iterative integral equation in order to find the functional form of $P_{0}(k)$ numerically and then use it subsequently for the rest of my code: ...
2
votes
1answer
132 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'-...
4
votes
0answers
65 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 ...
1
vote
1answer
73 views

Differential equation involving history integral

I have not found a solution by using google so I hope I can ask this here. I have an issue with a problem I am trying to solve and I was wondering whether what I am doing is not possible with ...
0
votes
1answer
59 views

Solution of Coupled second-order ODEs and plot the diagram

We have two second-order Coupled differential equations as the followings: $$\left\{\begin{array}{lr} \displaystyle \frac{{{d^2}{y_1}}}{{d{x^2}}} = \{ \frac{{\sqrt {\frac{{1 - {\varepsilon ^2}}}{{{{(...
5
votes
2answers
187 views

How to speed up Integration of interpolation function?

I have a list of data, and I interpolate it to a function. Then I need to do an integration with the interpolating function. But I found that the speed is unacceptably slow. My data is here (a little ...
0
votes
0answers
74 views

Tricky inverse Laplace transform

I'm trying to compute the inverse Laplace transform of $f(s) = s^c/(N + s^{ir} )$ where $c,N \in \mathbb{C}$ and $r \in \mathbb{R}^+$ using the Bromwich integral $$ F(t) = \frac{1}{2 \pi i} \int_{- ...
0
votes
1answer
87 views

Definite and indefinite integral give different results

I'm trying to find an expression that, given $x$, $y$, and $R$, gives the indefinite 2D integral of a function at the circle centered on $(x_0, y_0)$ with radius $R$. With $g$ as defined below, I'd ...
2
votes
1answer
84 views

Why does NDSolve and NIntegrate not give the same result? [closed]

I have plotted solution of two equivalent equations one in Integral form (right chart) the other in Differential form (left chart) using NDSolve and NIntegrate but they give me completely different ...
1
vote
1answer
56 views

How can use Table for two functions obtained from NDSolve? [closed]

I have obtained a numerical solution using NDSolve for two functions a(x) and b(x). how do I use Table to make a list of a(x) vs b(x) values. is it simply Table[{a(x),b(x)},{x,0,100}] or should I use ...
2
votes
1answer
72 views

Will the solution NDSolveValue finds outside of the region I give it give me bogus results?

I'm using NDSolveValue to solve Laplace's equation for a relatively simple system. I have two rectangles, separated by a small gap, which I define using RegionDifference: ...
2
votes
2answers
45 views

NIntegrate::inumri error with continuous function

I'm trying to calculate the finite part of a divergent integral numerically, but as I bring the regulator down to $0$, Mathematica starts throwing an error. ...
1
vote
1answer
74 views

NDSolve a system of PDE's when one variable does not have an explicit time derivative

Say I want to solve the following set of PDE's (my actual equations are way more complicated, this is just a simplified example to show the structure): $$\begin{align} \partial_t f(x,t)&=1-g(x,t)\...
2
votes
1answer
120 views

Numerical integration over a circle contour [duplicate]

I want to numerically integrate the following function $$f(p) = \frac{1}{2\pi i}\int_{\Gamma}\frac{1}{p}\exp\left(\frac{a^{2}}{2}\frac{1}{p}+\frac{b^{2}}{2}p\right)dp$$ where the contour $\Gamma$ ...
-1
votes
1answer
192 views

Can Mathematica solve this integral numerically?

I need to evaluate numerically the following $$\int_0^{\infty}\exp\left(-\pi\lambda\mathbb{E}_H\left(\int_r^\infty\left(1-\exp\left(-sP_{\text{M}}Hr^{-1/\delta}\right)\right){\rm{d}}r\right)\right)2\...
-1
votes
1answer
158 views

Why MMA is not able to solve this problem? [closed]

I am running these following code in Mathematica. But, MMA does not output anything. It is giving me an message as "The integrand .... has evaluated to non-numerical values for all sampling points in ...
3
votes
1answer
99 views

NDSolve DAE solution order is mixed up

Bug in 10.4.0.0, probably introduced earlier. Compare the two solution sets below: in the first one (x == False), there are only 3 dependent variables while in ...
3
votes
0answers
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: ...
2
votes
1answer
51 views

Nintegrate until a certain value is reached

I need to launch a Nintegrate command to integrate a function on a domain $(0,x_{b})$ where the value $x_{b}$ is determined by the fact that the integral reach a ...
1
vote
1answer
146 views

NDSolve with coupled ODE's and unknown singularities

I have two coupled ODEs that I am trying to solve numerically. It appears that there is a singularity in the solution to the equations which I am unsure how to get past. Both functions $\alpha$ and $\...
13
votes
1answer
116 views

Empty WhenEvent action crashes kernel

Bug introduced in 9.0 and persisting through 10.4.1 WhenEvent is new in 9.0. This is an example from the docs, slightly modified (action is wrapped in ...
3
votes
0answers
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 ...
1
vote
1answer
241 views

Why Integral does not converge?

I am trying to solve for $\Omega$ this nonlinear integral equation: $$1+\dfrac{z}{k^2}-\dfrac{z^2}{K_2(z)} \dfrac{\Omega}{k^3} \displaystyle\int_{1}^{\infty} \gamma^2\, \text{ArcTanh} \left(\sqrt{\...
0
votes
0answers
47 views

NDSolve kernel crash, affected by variable naming

The following isolated example cannot be further simplified much to reproduce a crash. I've already submitted the issue to TechSupport, but it seems this is not an easily reproducible case, so I'm ...
2
votes
1answer
87 views

Does NDSolve iterate faster in a region where the system being solved is in equilibrium?

I was wondering how exactly the time it takes for NDSolve to iterate through a certain region of the domain depends on the local behaviour of the given system being solved. My guess would be the ...
0
votes
0answers
81 views

Force NDSolve to use finite difference

How to force NDSolve to use finite difference instead of FEM. I have the following code: ...
0
votes
0answers
75 views

Boundary conditions for NDSolve

I get the following message: Boundary values may only be specified for one independent variable. Initial values may only be specified at one value of the other independent variable. >> from ...
11
votes
1answer
250 views

NDEigensystem returns incorrect eigenvalues for 2D coulomb problem, eigenfunctions contain discontinuity

I posted a similar question a short time ago regarding the 3D Coulomb problem. Jens' excellent answer to this thread allowed me to obtain the correct eigenvalues and eigenenergies for that system. I ...
1
vote
2answers
117 views

Numerical integration does excessive coarse-graining?

I am trying to perform numerically the following integral $$\int_0^8\text{d}x\,\text{Re}\left[\frac{e^{-\frac{a^2}{2}-\frac{x^2}{2}} x^4 \sin (b x)\left(e^{-i c x} \text{erfc}\left(\frac{-c +i x }{\...
3
votes
2answers
110 views

Switching Differential Equation in NDSolve

I am trying to solve the following system of differential equations using NDSolve: $\dot{z}_t=.5(1-z_t)$ $\dot{y}_t=.05y_t+z_t-x_t$ subject to the following constraint: $-y_t-z_t\le0$ where $z_t$ ...