Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
0answers
78 views

Plotting a numerical integration

I have the following code to calculate a numerical integral for any given a: ...
1
vote
0answers
28 views

How to incorporate the boundary conditions into the differentiation scheme in MMA?

Let that we want to numerically solve the following PDE \begin{equation}\label{sde} -r V(S,t)+r S \frac{\partial V(S,t)}{\partial S}+0.5 S^2 \text{sigma}^2 \frac{\partial ^2V(S,t)}{\partial ...
7
votes
2answers
194 views

Why does Mathematica say $\int_0^1\int_0^1\int_0^1\frac{1.0}{xyz}\,dz\,dy\,dx=0$?

Mathematica 9 says that $\int_0^1\int_0^1\int_0^1\frac{1.0}{xyz}\,dz\,dy\,dx=0$ and $\int_0^1\int_0^1\int_0^1\frac{1}{xyz}\,dz\,dy\,dx=0$. ...
0
votes
0answers
35 views

Solve an integral equation: to fit the given data with an integral of two functions?

I am trying to find an efficient way to solve the following equation $$h\left(b\right)=\int_{0}^{b}f\left(\frac{b-c}{1-c}\right)\frac{g\left(c\right)}{1-c}dc$$ where for $h(b)$ I have the data ...
2
votes
1answer
101 views

Solving an integral equation numerically

my problem is: I get the result of definite integral and now I need to find the upper limit for the same integral but with opposite sign value so f2=-f1. ...
-3
votes
0answers
43 views

Problem with Integration [on hold]

I have a problem with numerical integration of this function. Is there any way for this calculation? ...
0
votes
0answers
39 views

Solving a delay partial differential equation

I am trying to solve the following partial differential equation, $$\frac{\partial\phi[t,x]}{\partial t}=-2\pi\ \delta \ e^{-t}\phi[t,\mu]^{-2} \frac{\partial}{\partial x} \phi[t,x](x-\mu)$$ where ...
5
votes
1answer
211 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"] ...
2
votes
1answer
119 views

NIntegrate Warning / Error Messages

I am doing: NIntegrate[Sin[Exp[(x^4)]], {x, 2, Infinity}, PrecisionGoal -> 12] It prints out a host of warnings, but also shows the results as: ...
0
votes
0answers
69 views

NIntegrate gives message NIntegrate::vars:

As seen in the code below, I initially constructed a list of functions of two variables ζ and t0. These functions are pure ...
0
votes
1answer
55 views

NDSolve issue with initial and boundary conditions

While solving the heat equation in one spatial variable $u_t = u_{xx} $ (x goes from 0 to L) with the initial temperature distribution $T_0 \frac{x(L-x)}{L^2}$ , and with neumann boundary conditions ...
0
votes
0answers
55 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 ...
2
votes
1answer
94 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 ...
1
vote
2answers
109 views

Integral too oscillatory

Is there any way top make this integral less oscillatory? ...
0
votes
0answers
42 views
5
votes
1answer
122 views

Why does Nintegrate keep unevaluated?

It's no surprise that the "MonteCarlo" Method works well: ...
2
votes
0answers
34 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?
0
votes
0answers
39 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 ...
2
votes
1answer
129 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
95 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 ...
0
votes
0answers
35 views

NDSolve second order differential equation with boundary condition [closed]

i have revised my codes several times but i dont get what is wrong. after running it i keep getting dis message ...
2
votes
1answer
56 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
50 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 ...
6
votes
2answers
471 views

Starting NDSolve from intermediate time step?

I always wondered if I could start NDSolve from an intermediate time step. What I mean is, in the code sample below, if I were to run my solution from ...
0
votes
1answer
18 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 ...
0
votes
2answers
83 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: ...
2
votes
3answers
74 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
51 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
69 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 ...
5
votes
1answer
130 views

Finding minimum fly-by radius between Mars and spacecraft from interpolating function

I've written an interplanetary trajectory solver/plotter that plots the path taken by a spacecraft on an Earth-Mars mission, but have run into a little trouble when the spacecraft actually reaches ...
4
votes
1answer
105 views

Possible bug / numerical issues with HypergeometricU — any suggestions for a fast workaround?

I've encountered some problematic behaviour with HypergeometricU. I have a probability distribution on the positive integers that takes the following form after ...
1
vote
1answer
185 views

Locating Periodic Orbits

Here is the code for the numerical integration of an orbit. First the module for the definition of the equations of motion. ...
2
votes
0answers
149 views

Volterra integral equation

I have to find an approximate numerical solution for the equation $$ F(x) - \lambda \int\limits_1^{x} \text{d}s \;s^2 F(s) Z(x-s) = G(x) $$ $$Z(s) = (\psi''(1-2\ h\ i\ s)- 0.5 \psi''(1-2\ h\ i\ s))$$ ...
0
votes
0answers
61 views

Real or Imaginary result of spherical bessel and hankel functions of imaginary arguments

I am trying to calculate a rather complicate expression involving Spherical Bessel and Hankel functions. My problem is that somehow for pure imaginary arguments the functions are not pure real or ...
3
votes
1answer
199 views

What method does `NIntegrate` uses by default?

There is a variety of algorithm for performing numerical integration (See wiki). What method does NIntegrate uses by default? I looked on the documentation page and I saw that the function ...
0
votes
2answers
99 views

NIntegrate and Integrate of a Spherical Bessel function

I am trying to integrate over a spherical bessel function. I have used both the Integrate and NIntegrate functions in Mathematica but the values given by each do not match. Any reason why this ...
1
vote
1answer
165 views

Runge-Kutta Butcher tables

I like to have the Butcher's table for Explicit (or implicit as well) Runge-Kutta method of a fixed order. I do not understand reading ...
9
votes
1answer
632 views

NDSolve::ndcf: Repeated convergence test failure. How to solve?

I am trying to simulate a system of $n$ pendulums with some friction in Mathematica 9. This is the code I am using: ...
2
votes
2answers
133 views

NIntegrate over a list of functions

This question is the result of these other two questions. Question 1 and 2. I thought it would be better to ask a new question rather than deleting previous one. I think When ...
2
votes
2answers
202 views

NIntegrate piecewise vector function

Is there a way to numerically integrate a vector function defined via Piecewise? Example: ...
0
votes
1answer
55 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, ...
0
votes
1answer
55 views

Plotting results of NIntegrate with variable integration limit

I have tried to use NIntegrate with variable limits and compute the following ...
1
vote
0answers
27 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 ...
7
votes
1answer
119 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, ...
5
votes
1answer
159 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) ...