Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

2
votes
2answers
835 views

Problem with setting working precision in NIntegrate

I want to obtain a good numerical approximation (up to 10 decimal place would be ok for me) to an integral: $$ \int^{\infty}_{0} f(r)r^2dr $$ I am using the function $f(r)$, which is related to the ...
6
votes
2answers
321 views

Catching only the first event in NDSolve EventLocator

I have a system of ODEs that I solve. During the integration process, there's an event that I want to catch, but I want to (a) continue the integration after the event and (b) catch only the first ...
2
votes
0answers
276 views

FindRoot - Speed and errors

I am using FindRoot[] to solve a complicated equation. It seems I get the correct answer even though I get errors about an ...
3
votes
1answer
516 views

Singular integral: NIntegrate fails to converge

I need to calculate the following singular integral: NIntegrate[Log[1 + y^2]/Cos[Pi y], {y, 0, 1}] However, it is failing to converge. I have tried to specify ...
5
votes
1answer
289 views

NDSolve and WhenEvent Causing Excess Work

When I use the following system model = {x'[t] == x[t] (1 - x[t]) - x[t] y[t], y'[t] == x[t] y[t] - y[t], x[0] == 0.5, y[0] == 0.5} with the ...
0
votes
1answer
350 views

Nested NIntegrate problem

So I've been trying to evaluate the following integral in Mathematica 8.0 Student version: ...
4
votes
1answer
245 views

Integral of integral — it takes too much time

When I evaluate the following expression in Mathematica, it takes so much time that I don't want to wait for the evaluation to complete. So I think that there must be a better approach. ...
2
votes
1answer
590 views

Differential equations with jump conditions

Suppose I want to solve an ODE with a DiracDelta source term. In the following example, DSolve does it correctly while ...
0
votes
2answers
226 views

System of ODEs specified by large coefficient matrices

What is the best way to call NDSolve for solving a system of differential equations of the form ...
7
votes
1answer
548 views

Speeding up numerical Fourier Transform

I wrote this function NFourierTransform, which takes a function $f(k)$ and numerically calculates the fourier transform integral for discrete values of $k \in ...
0
votes
2answers
485 views

Why Can't Mathematica Integrate this?

I have the following problem from a textbook I am trying to integrate: So, following the directions in text, I am required to integrate each function. However, I cannot get Mathematica to integrate ...
2
votes
0answers
568 views

Inconsistent boundary and initial conditions: BC ignored altogether

Consider the following diffusion-decay equation with von Neumann b/c in the origin and Dirichlet at the other boundary: ...
8
votes
1answer
762 views

NIntegrate error bound

I am trying to evaluate a highly oscillatory integral using NIntegrate. I fear that due to limited resources (time and/or memory), I will not be able to evaluate the integral to the desired precision. ...
9
votes
2answers
1k views

Convolution with interpolated function

I have some problems to calculate in reasonable speed the convolution of an interpolated function with a Gauss function. I have here (ExampleData.txt, alternate Pastebin link) data which I ...
7
votes
2answers
1k views

NDSolve with vectors

I'm stumped. I'm trying to write this using vectors, but the 2nd derivative isn't being expanded like I expected it to be. This is a system of equations for a projectile with quadratic drag and ...
1
vote
1answer
277 views

Table not working with Plot

Because NIntegrate[] does not support parallel computation out of the box, I'm doing a simplified version by breaking the integration limit into pieces and using ...
8
votes
1answer
903 views

Efficient evaluation of functions defined by NIntegrate

I have a complicated function $f$ and I want to plot the function $F(x)$ defined by the definite integral of $f$ from $0$ to $x$: $$ F(x) = \int_0^x f(y)\mathrm dy. $$ Apparently $f$ cannot be ...
5
votes
1answer
922 views

Solve system of ordinary differential equations that doesn't have an initial condition (t=0), but has an inifinity condition (t=infinity)?

I have a question for solving t -> Infinity on Mathematica. First, I have a system of ODEs: ...
2
votes
1answer
237 views

How to solve a system of ordinary differential equations contain a interpolating function?

I'm wondering how I can solve a system of ODE that has a interpolating function? For example, z and y are ...
12
votes
1answer
2k views

Numerically solving an inhomogeneous partial differential equation

I'm trying to solve a cylindrical partial differential equation with boundary conditions. But I got an error message saying ...
3
votes
1answer
336 views

NIntegrate inside NSum

Consider the following function with a numerical integration: ...
1
vote
0answers
309 views

NDSolve Convergence test failure and significant effect of DifferenceOrder on eventual results

I am solving a non linear partial differential equation with what I call free boundary conditions (solid mechanicists would know this as simply supported). I realized that this boundary condition ...
9
votes
1answer
229 views

The only usage for the option InterpolationOrder in NDSolve is to be set to All?

We know that changing the option InterpolationOrder in ListLinePlotListPlot3D、...
2
votes
2answers
686 views

Problem with NDsolve for a system of equations

I want to solve a system of differential equations which is not very complicated, but I cannot handle the problem with mathematica!! Please have a look at the problem and result and help me with your ...
3
votes
0answers
388 views

Numerically solving PDE with high precision

I want to numerically solve the PDE $\partial_t u(t,x)=c\partial_x u(t,x)+(mx-l)u(t,x)$ with some initial and boundary conditions and given parameters $c$, $m$ and $l$. Consider the code ...
4
votes
3answers
570 views

Numerical solution of a differential equation with NIntegrate coefficients

I am trying to solve a linear ODE with a variable coefficient which is given in terms of an integral I can only do numerically. That is, I have an equation of the form $$ ...
2
votes
0answers
229 views

Numerical-Symbolical Integration (Calculus)

I created a simple numeric-symbolic integration. Here you can use symbolical and numerical techniques at the same time. You can also interpolate numerical integrals. The problem with my function is ...
3
votes
1answer
409 views

Solving the Sine Gordon PDE in mathematica

how can i solve this equation in mathematica? this is sine-gordon eq. but the boundary condition can not recognized by mathematica . thank you for you attention. ...
3
votes
1answer
198 views

Construct DifferentialMatrices and Kernel for LevinRule for this integral and ODE set

I've made a lot of progress on my problem the last few days thanks to all the help I've received on here. I think I'm upto the final step of greatly improving the performance of NIntegrate[..] on my ...
2
votes
2answers
794 views

Area or NIntegrate curves defined by points?

Is there a convenient method to compute the AUC (Area Under the Curve) metric that quantifies a Receiver Operating Characteristic (ROC) like shown here? The data used to build the ROC are just ...
4
votes
2answers
167 views

LevinRule and SphericalBessels

I'm currently looking at a simplified problem that approximates another problem I'm looking into. In this simplified problem I at least have an analytic integrand and can easily provide all info on ...
3
votes
0answers
999 views

Solving a system of nonlinear equations self-consistently

I am trying to solve a set of three non-linear equations in Mathematica. I need help with them. The Mathematica code (in plain text format) is attached below. If you copy & paste the code below ...
6
votes
3answers
1k views

Strategies to solve an oscillatory integrand only known numerically

I have an integrand that looks like this: the details of computation are complicated but I only know the integrand numerically (I use NDSolve to solve second ...
1
vote
1answer
432 views

How to build a grid of integrand points and numerically integrate?

If I have some function I know numerically only, say f(x) and each point $x$ takes significant time to compute so I have them all stored in some file as f(1)=0.232423, f(1.1)=0.3243432,....Then is it ...
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
391 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
687 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
525 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
447 views

Second Order Non Linear Differential Equation

I'm trying to solve the following differential equation numerically: ...
2
votes
1answer
194 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
402 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
706 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
532 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
184 views

EventLocator with LSODA?

Is the EventLocator option not compatible with LSODA on NDSolve. Below is what I tried to do ...
2
votes
1answer
154 views
4
votes
3answers
338 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
280 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
913 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 ...