Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
0answers
66 views

Using Fourier to return exponential function

I am trying to use Fourier to numerically demonstrate the following identity: $$ \frac{1}{2\pi}\int_{-\infty}^{\infty}\frac{e^{i\,s\,y}}{1 + a\,s}ds=e^{-y/a} $$ I'm getting the correct shapes, but my ...
0
votes
0answers
55 views

Integration is unevaluated analytically after a variable removed

I am using Mathematica 9.0 to do a symbolic integration as follows: ...
-1
votes
1answer
121 views
2
votes
0answers
49 views

The idea behind Stiffness switching method with NDsolve [closed]

Does the Stiffness switching method with NDsolve switch just between multiple variants of 4th order Runge Kutta method or it uses also other methods?
1
vote
2answers
117 views

Integral too oscillatory

Is there any way top make this integral less oscillatory? ...
0
votes
0answers
52 views

NIntegrate evaluating to “non-numerical values” for some input values despite using ?NumericQ

I'm quite new to Mathematica and I'm finding myself wanting to compute an integral for which my code produces errors of the kind: "NIntegrate::inumr: "The integrand ... has evaluated to ...
0
votes
0answers
31 views

How to NIntegrate a function that is the result of another NIntegration

What I want to do is the following ...
2
votes
0answers
59 views
0
votes
1answer
123 views

How to do multiple integral numerically?

I cannot calculate the following type of integrals numerically : $\int_0^1 dy \int_0^y f(x) dx $ $f(x)$ can be a complicated function. The problem is due to the fact that the upper limit of one of ...
2
votes
2answers
131 views

Approximation of definite integral by parabolas

This question is related to Trapezoid approximation to definite integral. As promised, I am now asking about how to draw approximation of integrals by parabolas. I tried to modify MarcoB's code, and I ...
0
votes
0answers
61 views
2
votes
1answer
60 views

How to NDSolve a set of equations, one of which itself contains NIntegrate of a desired function?

How to NDSolve a set of equations, one of which itself contains NIntegrate of a desired function waited to be solved by NDSolve first? For example, ...
2
votes
1answer
58 views

Why isn't Table iterator value inserted in failed NIntegrate arguments?

Consider this simplest example: Table[{z, NIntegrate[f[x], {x, 0, z}]}, {z, {1}}] Here f is not defined, so ...
5
votes
1answer
235 views

What's wrong with NIntegrate with “MonteCarlo” Method?

My code is: NIntegrate[1, x \[Element] ImplicitRegion[(x > 5 && x < 9) || (x > 11 && x < 13), {x}], Method -> "MonteCarlo"] ...
5
votes
1answer
140 views

Why does Nintegrate keep unevaluated?

It's no surprise that the "MonteCarlo" Method works well: ...
0
votes
2answers
53 views

NIntegrate fails when integrating over a list from an external (MathLink) function

NIntegrate fails when integrating over a list from an external (MathLink) function. For simplicity, consider an external function f[x] that returns the list {x,2x}. In Mathematica, the function would ...
2
votes
3answers
93 views

NIntegrate-ing a compiled function

I'm trying to integrate numerically in 6 dimensions a very long expression and I read about the option to NIntegrate a compiled function which should be faster. ...
2
votes
0answers
58 views

Want NIntegrate to catch error message

Really stuck with this. When I use NIntegrate, it sometimes prints a message like NIntegrate::ncvb: "NIntegrate failed to converge to prescribed accuracy ...
2
votes
0answers
102 views

Problem solving a nonlinear partial differential diffusion equation [closed]

EDIT: actualy the nonlinear partial differential equations for interacting density distributions, including boundary conditions, should be given as $$ \frac{\partial\phi}{\partial t} = D ...
0
votes
1answer
61 views

NIntegrate producing SetDelayed::write message [closed]

I used NIntegrate to calculate an integral with the final limit as a variable, which later will be listed in a table, ...
3
votes
0answers
47 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 ...
0
votes
1answer
70 views

Plotting results of NIntegrate with variable integration limit

I have tried to use NIntegrate with variable limits and compute the following ...
7
votes
1answer
136 views

Difficulty in getting correct Gaussian curve for diffusion of point source

I want to solve diffusion of a point source numerically and check it against analytical solution. first I define initial profile, ...
0
votes
0answers
87 views

Volume by NIntegrate gives zero

I want to Integrate the following expressions for different p < n and 2 < n with p and n both natural numbers: ...
1
vote
1answer
79 views

Plot a numerical integration as a function of a variable

Suppose we have a function that is hard to evaluate analytically but a numerical estimate suffices. For example consider the $f(x,\Lambda) = \Lambda\cdot \sin(x)$ where $\Lambda$ is some parameter I ...
5
votes
1answer
160 views

How to plot the solution of a Partial Differential Equation?

My attempt. I need to solve numerically the Complex Ginzburg-Laudau Equation (CGLE): $$ \frac{\partial A}{\partial t}=\epsilon A-(1+i\beta)|A|^2A+(1+i\alpha)\nabla^2A $$ I'm using a uniform initial ...
5
votes
1answer
218 views

Numerical solution of IVP for linear ODE with variable coefficient runs wild soon

Cross posted in scicomp.SE. A friend of mine showed me this initial value problem (IVP) for a linear ordinary differential equation (ODE) with variable coefficient: $$y''(x)=\left(x^2-1\right) ...
4
votes
2answers
125 views

Coarse-graining in numerical integrations

I have been working recently in a coarse-graining problem I found when using NIntegrate: I am trying to evaluate the function $$f(a)=\int_0^{\infty}x\,e^{-(a^2+b^2)x^2}\text{d}x$$ numerically as a ...
1
vote
2answers
96 views
7
votes
2answers
253 views

Integrating a function over a surface integral

From a first principles bandstructure calculation I get an energy scalar field in three dimensions $E(x,y,z)$. It's now easy to plot a constant energy (contour)-surface for dedicated values ...
2
votes
1answer
73 views

Forcing Exact Outputs for Integrate [closed]

I'm trying to compute the following triple integral: ...
0
votes
0answers
29 views

Roots of two Functions containing integrals, with two parameters [duplicate]

I want to find the values of l1 and l2 from the following two equations: ...
0
votes
1answer
130 views

Time evolution of a wave packet from the time-independent Schroedinger equation [duplicate]

Starting off with the time-independent Schroedinger equation (TISE) $\quad \quad -\frac{\hbar^2}{2m} \nabla^2 \psi + V(r, \theta) \psi = E\, \psi,$ I would like to study the time evolution of an ...
0
votes
0answers
46 views

Integro differential eq boundary difficulties

I'm trying numericaly solve simple integro-differential equation, but have some problems with boundary conditions. System: ...
0
votes
0answers
42 views

What is the right way to combine a Package, Module, ParallelTable and NIntegrate?

I am stuck with a curious problem. I would like to to have a package from which i can call a function test[path], which then performs a time consuming numerical ...
0
votes
1answer
53 views

How can I perform this integration in Mathematica? [closed]

I am new to Mathematica. I want to find the integration of the following expression: $H(f)=T\left(\frac{sin(\pi f T)}{\pi f T}\right)^2$ Here, $T=1.127e-7$ I want to integrate this function for a ...
6
votes
1answer
112 views

Detecting nearly simultaneous WhenEvents in NDSolve

I am trying to solve a system of (many) coupled nonlinear ODEs. I need to decouple some of the equations (i.e. set the time derivatives of some of the dependent variables to zero) at various points in ...
3
votes
1answer
95 views

Evaluating a numerical integration with infinity as limit

I am trying to evaluate a numerical integration (to get an expression of the constant Ω) Suppose that h[x_] := 1/(1 + a x^2) ...
-3
votes
1answer
107 views

How can I evaluate this function in Mathematica? [closed]

I am very new to Mathematica. Today I have got my license. Can someone help me to evaluate the following expression in Mathematica. I want find the values of $P$ for different $n$ $S=129$; ...
0
votes
3answers
77 views

How do I integrate this function?

I am very new to mathematica and also new to this community. I have a problem given below, How to express this in Mathematica? $H=[2,4,10,5,12,34,42,\cdots 12]$ is a vector of size $N$. $h_n$ is the ...
0
votes
2answers
85 views

Fix my code to return a table of values

Here is a “procedural” program that we wrote in my class, implementing the rectangle rule of numerical integration: ...
0
votes
0answers
47 views

Passing integration constants to self defined function

I would like to evaluate an integral I am taking in cylindrical coordinates, in which the integrand contains a previously defined function. I need to pass the r and phi integrand values to this ...
0
votes
2answers
106 views

Numerical 3D Integration in Mathematica [closed]

My question in short is: Is it possible to make numerical 3D integration in mathematica efficiently? Or am I gonna have to move this to C++? I feel this problem is way too trivial to go to C++, so ...
0
votes
0answers
65 views

NIntegrate Polynomial of high degree

I want to integrate a polynomial of degree 100 and higher over a domain that is the intersection of two balls like ...
3
votes
2answers
149 views

Integrate and NIntegrate not the same

Why am I getting two different results here? ...
0
votes
0answers
43 views

Parallel calculation with SetOptions

Is it possible to distribute the effect of SetOptions to parallel kernels? Here is how I encountered the problem: I am trying to calculate a lot of numerical ...
0
votes
0answers
62 views

Stress calculation for stokes equation in 2D

I am solving the Stokes equation for the creeping flow, in a particular geometry, using the stream function formulation. This is my domain: ...
0
votes
1answer
53 views

Difference between NIntegrate and Integrate results

I want to integrate a function of two variables that is defined via a piecewise function. I can compute the integral analytically as follows: ...
1
vote
1answer
243 views

4th-order Runge-Kutta method to solve a system of coupled ODEs [duplicate]

I am a beginner at Mathematica programming and with the Runge-Kutta method as well. I'm trying to solve a system of coupled ODEs using a 4th-order Runge-Kutta method for my project work. I have ...
1
vote
0answers
42 views

Speeding Up the Numerical Integration of a Product of Numerical Integrands with NIntegrate

I need to solve a set of coupled integral equations within a self-consistent cycle. The final result will be functions, say $A(x)$ and $B(x)$, which are related to each other by some integrals which ...