Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
1answer
29 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: ...
1
vote
1answer
97 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. ...
5
votes
2answers
158 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 ...
4
votes
0answers
44 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 ...
-3
votes
1answer
67 views

How can I fix my code? [on hold]

I am running this following code in Mathematica. It shows some error message. I have no problem with it. But it does not show the output for $m=1/2$. It shows me the output when $m=1$ and $m=2$. How ...
1
vote
1answer
67 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
51 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 ...
0
votes
0answers
29 views

Performing numerical derivative after numerical integration

First of all, I am sorry to repeat a question which is similar to the closed question, "Numerical Derivative after numerical integration". I could not understand the solution introduced in the link. ...
2
votes
1answer
66 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: ...
0
votes
0answers
67 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
0answers
50 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
67 views

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

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
52 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
2answers
42 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
86 views

Numerical integration over a circle contour

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
vote
1answer
65 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 ...
0
votes
1answer
118 views

Why MMA is not able to solve this problem?

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 ...
7
votes
2answers
170 views

Multiply integrand with -1, and the precision changes?

"After multiplying the integrand of NIntegrate with -1, the Precision of the output will ...
1
vote
1answer
232 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} ...
2
votes
1answer
156 views

The numerical solution of a nonlinear ODE: boundary value problem

I want to solve the following nonlinear ordinary differential equation with boundary values $f(0)=1$ and $f(1)=1$: $${\frac {{\rm d}^{2}}{{\rm d}{x}^{2}}}f \left( x \right) ={\dfrac { \left( 51-51\,x ...
3
votes
1answer
73 views

NDSolve DAE solution order is mixed up

Compare the two solution sets below: in the first one (x == False), there are only 3 dependent variables while in the second one (...
3
votes
0answers
67 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: ...
14
votes
3answers
5k views

Solving a time-dependent Schrödinger equation

I want to solve the time-dependent Schrödinger equation: $$ i\partial_t \psi(t) = H(t)\psi(t)$$ for matrix, time-dependent $H(t)$ and vector $\psi$. What is an efficient way of doing this so that ...
4
votes
1answer
490 views

How can I invoke the solution of NDSolve to determine a parameter in my equation just inside NDSlove?

I am trying to solve a differential equation by NDSlove for $h(x,t)$. It reads $$h_t=h_{xx}-V_h-\lambda(t)$$ where $V_h$ is a given function of $h(x,t)$ denoted by ...
2
votes
1answer
43 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
105 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
106 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 ...
-1
votes
1answer
287 views
3
votes
0answers
112 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 ...
2
votes
1answer
75 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
44 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 ...
0
votes
0answers
69 views

Force NDSolve to use finite difference

How to force NDSolve to use finite difference instead of FEM. I have the following code: ...
18
votes
1answer
478 views

Numerical inverse Laplace-Hankel transform

When trying to reproduce the result of this paper about numerical solution of Lamb's problem, I encountered the following double integral (to be more precise, the 0-order inverse Hankel-Laplace ...
0
votes
0answers
70 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
219 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 ...
4
votes
1answer
73 views

Issues with modeling pulses in a very simple system of DAEs

Some time ago I had asked this question about evaluation difficulties using Euler Integration to solve a system of ODE where discrete pulses occur. While I have now abandoned Euler integration and ...
10
votes
0answers
136 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. ...
1
vote
2answers
106 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 ...
1
vote
1answer
214 views

Solving wave PDE

I am trying to solve the wave PDE with NDSolve. Below is the equation: ...
3
votes
2answers
94 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$ ...
1
vote
0answers
237 views

A power series expansion [closed]

Consider the function, $f(z) = z\, \tanh(\pi z) \log (z^2 + a^2)$ for some $a>0$. Now I am considering 3 different situations, $z = i(n+0.5) - i\epsilon + \delta - it$ for $n \in \mathbb{Z}$ ...
1
vote
1answer
82 views

NIntegrate gives two results for two forms of the same function. Which one to trust?

I am interested in evaluation the following integral numerically (since apparently there is no analytical solution) $$\int dx \,x^3 \left(e^{2 i c x }-i \text{erfi}\left(\frac{x +i c ...
0
votes
3answers
86 views

Average function value over an Interval [closed]

What is the best way to find the average value of a function over a specific interval in Mathematica? I can not figure it out. I have two points on the interval and need to find the average value.
10
votes
1answer
205 views

NDEigensystem cannot solve numerically the 3D Coulomb problem, while DSolve returns the right answer

After having derived by hand the eigenvalues and eigenfunctions for the 3D and 2D hydrogen atom, I want to solve the systems numerically using Mathematica. I need to do this because my next step is to ...
14
votes
2answers
260 views

What can one do with extremely stiff problem in NDSolve?

Consider the following illustrative problem: $$ \frac {\partial f} {\partial t} = \frac {\partial} {\partial x}(x f) + \frac {\partial} {\partial x}(f \frac {\partial f} {\partial x}) $$ This is ...
3
votes
1answer
48 views

Performance of numerical integral over piecewise function

Using mathematica version 10.3, I observe that an integral over a piecewise function evaluates a factor 10 slower than the same integral without the piecewise distinction. Here is the code: ...
-3
votes
1answer
37 views

Method to compute NIntegral of Trigonometric functions

I don't know which method to adopt for computation of the following integrand on the unit sphere in $R^6$: $ 2 r^9 \sin ^5(\text{$\theta $1}) \sin ^3(\text{$\theta $2}) \sin2(\text{$\theta $3}) \sin ...
8
votes
2answers
147 views

How to improve accuracy of NIntegrate over ImplicitRegion

I'm trying to compute the area of a implicit region given as ...