Tagged Questions

Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
1answer
2k views

Stategies to avoid NIntegrate::slwcon error

I am trying to numerically evaluate an integral whose integrand depends on two parameters, say $(a,b)$ and when $b\gg 1$ I suspect (although it's not guaranteed) that the integrand is very small. Thus ...
3
votes
1answer
371 views

Integrating over data points from an external source (wolfram|alpha and weather)

I moved to another city and the weather sucks. Sometimes I feel like getting sad and so I go to wolfram|alpha and check for example ${}$ ...
10
votes
3answers
3k views

NDSolve with Euler method

I want to solve this equation with NDSolve[] using the Euler method: x'[t] == 0.5*x[t]-0.04*(x[t])^2 with initial condition ...
8
votes
1answer
638 views

1D Euler Equations

Is it possible to accurately solve the 1D Euler equations in Mathematica using NDSolve? For example, let us consider the problem given here: http://www.csun.edu/~jb715473/examples/euler1d.htm Using ...
5
votes
1answer
499 views

Unexpected results from NDSolve

I am trying to solve a stiff reaction diffusion system with NDSolve. However, it does not produce the expected results. My problem is a spherical cell with 5 ...
3
votes
1answer
436 views

Second Order Non Linear Differential Equation

I'm trying to solve the following differential equation numerically: ...
2
votes
1answer
191 views

tricky memoization

Let's say I have the NDSolve example for documentation involving splitting 2nd order into set of 1st order ODEs: ...
3
votes
1answer
395 views

Efficient way to perform elementary integration step with NDSolve internal method

I'm trying to tweak the NDSolve function to perform one elementary integration step (using some explicitly selected stepping algorithm via ...
2
votes
1answer
683 views

Solving a PDE containing DiracDelta

I want to get the answer from a PDE: $$\begin{align*} \frac{\partial \rho(r,t)}{\partial t}&=Dr^{-2}\frac{\partial}{\partial r}r^2h(r)e^{-U(r)}\frac{\partial}{\partial ...
8
votes
1answer
504 views

Animate the scattering of a Wave Packet

I know mathematica is probably not the best choice for intense numerical integration, but its the only software I know. I would like to create an animation (not real-time, but pre-render the ...
2
votes
0answers
182 views

EventLocator with LSODA?

Is the EventLocator option not compatible with LSODA on NDSolve. Below is what I tried to do ...
2
votes
1answer
152 views
4
votes
3answers
317 views

How could I get the value of y[t] at each specific interpolation point?

sol = NDSolve[{Derivative[2][y][t] + Sin[y[t]] == 0, Derivative[1][y][0] == 0, y[0] == 1}, y, {t, 0, 2}] the above-mentioned differential equations can be solved ...
2
votes
4answers
278 views
14
votes
2answers
2k views

Nested NIntegrate

Suppose that we have the given simple integral expression $$ \int_{-5}^{5} x \int_{-\infty}^{x} e^{\int_{0}^{z} -y dy} dz dx $$ Writing this out in Mathematica we obtain: ...
1
vote
1answer
859 views

Problem while solving system of two second order non linear coupled differential equations using NDSolve function

I am a completely new to Mathematica, and I am sorry if this question is dumb. I have to solve a system of two second order non linear coupled differential equations (that I got from the Lagrangian ...
2
votes
0answers
209 views

Integrating over a region without singularity gives an error indicating the function has singularity in that region

I have the following 2D region over which I want to integrate a function: ...
3
votes
2answers
500 views

How to avoid this kind of numerical error caused by extreme parameters when using NDSolve?

Here I use a one-dimensional heat conduction equation as the example. I found that when the thermal diffusion coefficient is small enough, Mathematica will give a result against the second law of ...
1
vote
1answer
152 views

How to collect q[t] from the following integration

As shown in the following program, the q[t] in a can be collected from the integration by defining the integration of ...
4
votes
2answers
2k views

How to handle NDSolve::ndsz problem (singularity problem)

I have 2 second order differential equations (non-linear). The physics behind them is correct. I verified the equations many times. It is a solid pendulum with a mass-spring at the end of it. Now, ...
6
votes
1answer
465 views

The difference between “SymbolicProcessing” -> 0 and restricting the function definition to numeric values only

The Documentation tells us that there are two ways to disable symbolic processing of the integrand by the NIntegrate function when it is known that it just slows ...
0
votes
2answers
725 views

Plotting multivariable integration

If I have a multivariable integration like NIntegrate[x^2 + y^2, {x, 1, 5}, {y, 6, 10}] But I need to plot its result in terms of ...
7
votes
0answers
2k views

Integro-differential equation

I have to numerically solve a nonlinear partial integro-differential equation using Mathematica. This is my equation, $$\frac{\partial y(x,t)}{\partial t}=\int_{-\infty}^\infty K_0(|x-u|) ...
11
votes
1answer
689 views

I failed to solve a set of one-dimension fluid mechanics PDEs with NDSolve

The fluid here has been assumed as single component perfect gas i.e. it obeys the equation $p=ρ R T$, the thermal conductivity is assumed as a constant, so the equation set is: ...
4
votes
1answer
386 views

Multiple simultaneous events in EventLocator method for NDSolve

I'm using NDSolve to integrate a system of ODEs, and EventLocator to stop the integration when it leaves a certain region in phase space. This works perfectly as it should. However, I've also added ...
3
votes
1answer
275 views

Could the PrecisionGoal for NDSolve be a negative number?

The help of Mathematica doesn't say so much about the PrecisionGoal for NDSolve, and I never considered much about it even after ...
6
votes
2answers
416 views

How to work out the parameter in a definite integration which has an exact value while the integration doesn't have an analytical solution?

Here is the equation I'm trying to solve: NIntegrate[1/(E^(1/(λ T)) - 1), {λ, 200, 220}] == 1000 T is the parameter I'm ...
3
votes
2answers
390 views

How to set the initial condition? (to make IC and BC consistent)

I want to find the initial condition which fits mixed boundary condition of Phi[r, Theta, t]. The original initial condition in text is Phi[r, Theta, 0] == 1 . ...
5
votes
1answer
2k views

How do I prevent NIntegrate::inumr errors within other functions?

I believe this question is best illustrated with a simple example. If I run FunctionInterpolation[NIntegrate[a + b, {a, 0, 1}], {b, 0, 1}] I get errors of the ...
1
vote
1answer
432 views

I ran into an error when I was trying to solve a PDE with a piecewise initial condition by NDSolve

This is a very simple one-dimensional heat-conduct equation, the only special part of it is the piecewise initial condition: ...
6
votes
0answers
457 views

Optimizing NIntegrate for higher PrecisionGoal

By default, NIntegrate works with MachinePrecision and its PrecisionGoal is set to ...
2
votes
1answer
1k views

Methods to speed up numerical NDSolve, NIntegrate,

I am not very used to do numerical simulations on Mathematica. Do you have any ideas how to improve i.e. speed up my code? ...
5
votes
3answers
2k views

How to use results of NDsolve[] for further solving of ODEs?

I have a system of ODEs with 10 eqns. I can solve the first 5 independently. How can I use those results to solve for the remaining 5? An easy example would be $\dot{x}=f(x), \quad \dot{y}=g(x,y)$ ...
0
votes
1answer
250 views

Problem with Eventlocator Method for NDSolve

I want to solve the ode and plot the solution v[x] for different values of parameter a where ...
9
votes
1answer
679 views

How to tell mathematica not to resolve stiffness issues

Very often I solve partial differential equations that are nonlinear and could be up to 4th order. In these cases, it is usual for the solution determined by ...
4
votes
1answer
307 views

Error Interpretation in NIntegrate

I am using a recursion algorithm developed by Migdal for Lattice Field Theory, and I have the following code: ...
2
votes
2answers
837 views

optimization problem with NDSolve

I want to minimize the function fcc. When fcc is calculated for a specified point the answer is correct: ...
2
votes
1answer
633 views

Optimizing a function involving NDSolve results in error messages

I want to minimize a function f with NMinimize but an error occurs that says: ...
1
vote
2answers
363 views

Numerical Integration in Laplace domain

I need to calculate two different integrals containing a Bessel function in the Laplace domain. I have tried different kinds of quadrature but didn't have any luck. I don’t know how to help ...
8
votes
1answer
1k views

Is it possible to set a variable as a positive one in the whole notebook?

I'm having issues during integration due to the fact that Mathematica doesn't know if an undefined variable is positive or not (it gives me complexes which bothers me in the end). For example I do ...
0
votes
1answer
111 views

NIntegrate failling on floating value

I'm trying to take the following integral NIntegrate[ ((Sin[Q 1]-Q 1*Cos[Q 1])/(Q 1)^3)^2 * S[Q,0.4,2] * Q BesselJ[0,0.5Q] , {Q,0,Infinity}] ...
2
votes
3answers
2k views

Retrieve values of InterpolatingFunction

While analyzing a large system of ODE's, I defined a particular ratio p, which contains some variables that are represented by ...
4
votes
1answer
949 views

Incorrect solution of diffusion equation with Neumann boundary conditions

I want to set up a PDE model, which takes a two-dimensional diffusion equation into account. The key problem is that I have some trouble in solving the two-dimensional diffusion equation numerically. ...
15
votes
1answer
349 views

Why does LogLinearPlot sample its argument outside the specified domain?

I experience a weird bug in the function LogLinearPlot. If the input is an interpolation function, such as the one created like this, ...
2
votes
1answer
216 views

how to nest parallelized computations on a cluster?

I am lucky to have access to a computational cluster and I could submit my job to many-many cores. As I need to evaluate a numerical integral within a numerical integral, I would like to know if I can ...
0
votes
2answers
294 views

NDSolve and results of the previous computations

I want to solve following system of ODEs: $ \Bigg\{ \begin{array}{} \frac{\partial C}{\partial t}=\frac{2W_b}{Rsin(\theta)}(1-\frac{C}{\gamma})+\frac{\nu}{\pi R^2}\frac{\partial C}{\partial Z} ...
0
votes
2answers
787 views

nested numerical integration: not valid limits?

I encountered an error when I was hoping for some Mathematica (8.0.4) magic sparing me to code up numerical integration, function approximation and root-finding myself. The broader context and the ...
4
votes
2answers
746 views

How to Solve this ODE with Mixed Boundary condition

I have an ODE equation which is sort of y''[x] + 2 y'[x]/x + .0001 (y[x])^3 ==0 subject to the boundary conditions ...
6
votes
2answers
2k views

Is it possible to compute trapezoidal rule numerical integration?

Is it possible to compute trapezoidal rule numerical integration? I know that Mathematica has Interpolation, and that a list of points can be interpolated and then ...
6
votes
2answers
415 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 tmin=0 to ...