Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
0answers
32 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
59 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
62 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} ...
0
votes
0answers
32 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
60 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
459 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
68 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 ...
10
votes
1answer
185 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
62 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
130 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
99 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
198 views

Solving wave PDE

I am trying to solve the wave PDE with NDSolve. Below is the equation: ...
5
votes
1answer
124 views

Multiply integrand with -1, and the precision changes?

"After multiplying the integrand of NIntegrate with -1, the Precision of the output will ...
3
votes
2answers
89 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
232 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
votes
0answers
74 views
0
votes
0answers
27 views

Take a derivative of a NIntegrate function (with two argument) [on hold]

what I have is a numerical function of SBE[m,T] and I want its derivative with respect to T. Here is what I wrote, ...
1
vote
1answer
81 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
81 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
187 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 ...
-1
votes
0answers
26 views

Reasons for the sign differences [closed]

While numerically evaluating certain definite integrals, many a times Mathematica gives correct values, but sometimes if we change the parameters, then the answer is just the negative of the original ...
14
votes
2answers
237 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 ...
-1
votes
0answers
62 views

Plotting points with Euler's Method [closed]

I have the solution for this diff. eq. graphed and assigned to a variable, how do I show points on or off the graph? (dy/dx)=(y^2)-(x^2) It's solution is a Bassel Function conglomeration. Now ...
3
votes
1answer
44 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
33 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
131 views

How to improve accuracy of NIntegrate over ImplicitRegion

I'm trying to compute the area of a implicit region given as ...
1
vote
1answer
39 views

Using NIntegrate on a joint CDF without getting an error

I am trying to calculate the area under a constrained part of a function built from the empirical CDFs of two distributions. When I calculate the area of either CDF using NIntegrate it works fine, ...
0
votes
0answers
32 views

Stable numeric integration of multidimensional step function

I am trying to integrate numerically a two-dimensional function (a SmoothKernelDistribution) with a step. I tried a few different settings for the parameters of ...
12
votes
2answers
813 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$. ...
0
votes
1answer
91 views

How to omit the corrupt value in a program?

I've such errors: Coordinate .. is not a floating-point number and can't correctly fix it. The problem occures when x==Log[2] The program works correctly ...
4
votes
1answer
48 views

NIntegrate crashes without error message when using high precision integrand with non-zero tailing digits

I have a numerical integral that evaluates fine for floating point arguments with low precision (e.g., 4 digits), with argument where only zeros follow the first, e.g., 4 non-zero digits, or with ...
0
votes
1answer
854 views

Solving coupled eigenvalue differential equations [closed]

I am trying to solve an equation of the form as follows $\left(\begin{array}{cc} -\frac{\hbar^{2}}{2m}\frac{\delta^{2}}{\delta z^{2}}+\sin^{2}\left(z\right) & z\\ z & ...
2
votes
1answer
114 views

Differential Equation with Numerically Integrated Boundary Conditions

I have a second order differential equation that I'd like to solve numerically, and then integrate its solution twice to get the parametric equations of a curve. The ODE is: $2 ...
1
vote
0answers
52 views

How to do numerical line integral?

I have a 2D numeric (interpolating) function J that represents the current density of a square plate. I'd like to integrate J along one edge to find the total current coming out of that side. I'm ...
1
vote
1answer
51 views

AbsoluteTiming of nested integration gives strange result

I found somewhat strange behaviour of nested integration timings. Consider the following code: ...
1
vote
1answer
43 views

Getting an error with NIntegrate due to insufficient WorkingPrecision or divergent integral

Hello I have the following problem. But when I try to solve it, I get an error saying 'Catastrophic loss of precision in the global error estimate due to \ insufficient WorkingPrecision or divergent ...
4
votes
1answer
460 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 ...
0
votes
1answer
69 views

NDSolve for a system of nonlinear coupled pde

I try to solve a system($n$) of coupled nonlinear 1-d PDE's which is basically coupled sine-Gordon equations (through 2nd spatial derivative) in time and space. I am interested in the dynamics when I ...
5
votes
1answer
391 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 ...
6
votes
1answer
102 views

How do I extract the weights used by NIntegrate?

I'd like to use NIntegrate to adaptively integrate an expression, then use the same points and weights to integrate that expression with some parameters changed. I ...
0
votes
0answers
23 views

Optimizing NMinimization and NIntegration with a Nested List-Valued Function

I want to use NMinimize and NIntegrate on each element of a nested list-valued function. Here's a simple example of what I'm ...
1
vote
1answer
67 views

Numerical integration plot

I am trying to do a numerical integration plot in Mathematica. Specifically, I want to plot $r$ versus $\tau$ where, $$\frac{dr}{d\tau}=\sqrt{2F(r)}$$ $F$ being a quartic polynomial. The limit of $r$ ...
0
votes
1answer
85 views

difficulty in numerical estimate of double integral

I entered the following simple integral in mathematica: ...
17
votes
2answers
1k views
6
votes
0answers
196 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 ...
0
votes
1answer
63 views

Why does Mathematica 10.3.1 fail me on : Integrate[(x^3) [Log[2 Sin[x]]]^8, {x, 0, Pi}] [closed]

All it gives me is a pretty restatement of my original request. When I use WolframAlpha PRO, I get a result of 624510 and a visual representation of the area in question. I know the ends of the ...
4
votes
3answers
180 views

How to solve this integration? [closed]

I need to find the integration of the following expression ...
1
vote
1answer
63 views