Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

3
votes
2answers
649 views

Compute integral symbolically or numerically

I want to compute the integral of the following integrand ...
3
votes
1answer
183 views

Differentiating ParametricNDSolve solutions

Is there any way to differentiate a solution obtained by ParametricNDSolve? For instance, I have the position $\phi_\gamma(t)$ as a function of time, parametrized ...
3
votes
1answer
383 views

Solving an ODE numerically

I really appreciate it if anyone helps me with this: How can I solve this ODE and plot the answer for $x$ on $[0.6,5]$: $$ \begin{align*} -2xy'[x] = y''[x]+ 47.21 (-.0025 x^6 & + ...
3
votes
1answer
271 views

A Bessel & Struve functions related integral

I try to numerically compute this integral and I don't figure out why on earth Mathematica is not able to do it. Is my input correct? Does it possibly have a closed form? ...
3
votes
1answer
316 views

Tips for efficiently solving large system coupled (nonlinear) ODEs

I'm trying to solve a system of nonlinear, coupled ODEs, where the governing equation for the $n-th$ ODE is of the form: $\sum_k^M Q_{nk} \ddot{a}_k -\sum_{\ell}^M\sum_k^M S_n(\ell,k) \dot{a}_{\ell} ...
3
votes
1answer
455 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 ...
3
votes
1answer
342 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 ${}$ ...
3
votes
1answer
123 views

How to do this complex integration on the real line?

$m, r$ are parameters in the following integral: Integrate[z Exp[I z r]/Sqrt[z^2 + m^2], {z, -∞, ∞}] How to do this integration directly? The result should be ...
3
votes
1answer
475 views

Monitoring the Evaluation of NDSolve: time to finish estimation

My problem is quite simple: I run a NDSolve with a system of many ODEs, a calculation that will run for many hours, and I would like to know the progress of the ...
3
votes
2answers
364 views

Animating the Lorenz Equations

I am trying to use the Animate command to vary a parameter of the Lorenz Equations in 3-D phase space and I'm not having much luck. The equations are: ...
3
votes
1answer
172 views

Integrate equations of motion when force depends on position

I'm fairly new to Mathematica. I'm trying to test my C++ implementation of a fourth order Runge Kutta method for Newton's equations of motion. I want to test my integrator when the applied force is ...
3
votes
1answer
476 views

NDSolve for a large system of simple ODEs

I am solving a system of many (more than 100) ODEs. It is the kind of standard rate equation encountered in semiconductor physics. Here is the system: ...
3
votes
2answers
531 views

NDSolve: Normalizing at every step

Suppose I have an transport equation with an initial conditions: ...
3
votes
2answers
373 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 . ...
3
votes
1answer
103 views

Integrating a functional of an InterpolatingFunction

It is straightforward to Integrate an InterpolatingFunction. However, even for a simple functional of an ...
3
votes
1answer
152 views

Surface area of intersecting spheres

Given a sphere of radius 1 centered at the origin and $n$ spheres with radii $r_i$ centered at predefined coordinates, $c_i$, in space, I am after the surface area of the unit sphere that is not ...
3
votes
1answer
218 views

Question on accuracy and precision of NIntegrate

As a Mathematica newbie, I was testing the accuracy/precision of NIntegrate (9.0.1.0 on Mac) and have obtained a very peculiar result. ...
3
votes
1answer
132 views

NDSolve: Reinitialize fails with If condition

I have found a weird problem using If conditions containing an state inequality of the form state<=. First consider the simple ODE with an If condition ...
3
votes
1answer
336 views

Multi-dimensional integral in the complex plane with poles and essential singularity

I've passed the last week searching a way to numerically integrate this multi-dimensional integral in the complex plane at the poles and avoiding the singularity at z=0: $$ \oint_{C}\oint_{C\ auound\ ...
3
votes
1answer
949 views

NDSolve does not respond

For some sets of constants, NDSolve gives me true solutions, but when I try for example, T = 1/(2*2200), Mathematica does not respond. What can I do? The code below ...
3
votes
1answer
291 views

NIntegrate inside NSum

Consider the following function with a numerical integration: ...
3
votes
2answers
104 views

NIntegrate returns zero for non zero integrand, 4d Integration

I am trying to calculate the following integral. ...
3
votes
1answer
197 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 ...
3
votes
1answer
423 views

Second Order Non Linear Differential Equation

I'm trying to solve the following differential equation numerically: ...
3
votes
1answer
388 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 ...
3
votes
0answers
36 views

What are good/best practices to take the Fourier transform of an InterpolatingFunction?

I have a function which I have obtained from numerical integration of a differential equation, and I would like to take its Fourier transform. What are good practices for doing this? To make things ...
3
votes
0answers
168 views

Function with a sharp resonance which Mathematica fails to integrate. Why?

I'm a new user of Mathematica and I'm trying to use it to calculate the collisional cross-section as a function of energy for a given potential and decay rate. I know that the resulting function ...
3
votes
0answers
93 views

Non-linear integral equation

I'm trying to solve with Mathematica an integral equation. I found this excellent answer (How to solve a non-linear integral equation?) solving with a collocation method a problem which can be ...
3
votes
0answers
541 views

Using NDSolve for Integro-Differential Equations

I have a fairly complicated set of coupled non-linear integro-differential equations that I am trying to solve using NDSolve. The equations are: ...
3
votes
0answers
364 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 ...
3
votes
0answers
900 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 ...
2
votes
4answers
277 views
2
votes
2answers
794 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
2answers
445 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 ...
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? ...
2
votes
2answers
262 views

How to compute this triple integral? [closed]

In Mathematica how can I compute this integral:$$ \iiint_{D}\sqrt{(1-9z^2)(1-4y^2-9z^2)}\,dx\,dy\,dz$$ where D is the domain: $$D: x^2 +4y^2+9z^2\le1$$ Please I need help!!!
2
votes
2answers
296 views

BC for transport equation using NDSolve

First I can solve a transport equation with a source (Is it still called transport equation?) using DSolve. The form of the source serves only as an example. It can ...
2
votes
2answers
662 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 ...
2
votes
1answer
571 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: ...
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 ...
2
votes
2answers
108 views

NIntegrate - WorkingPrecision

I am trying to NIntegrate this expression. It is very close to zero, and so gives all possible types of errors. More precisely, ...
2
votes
1answer
147 views

Area between Contours in ContourPlot

I feel slightly foolish for asking this because I am so close, but I'm having trouble, so I will anyway. I asked this question two days ago regarding finding the lengths of contours. Now, I'd like to ...
2
votes
2answers
196 views

Weighted mean of complex exponential function using NIntegrate

I have defined the following functions: ...
2
votes
1answer
335 views

NDSolve with vector function

(Possible duplicate yet I still can't understand.) Basic 2D revolving around origin: ...
2
votes
1answer
408 views

Creating hexahedral finite elements in Mathematica

Is it possible to do FEM using hexahedral elements in Mathematica? If it possible, is there any help to do that?
2
votes
2answers
759 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 ...
2
votes
1answer
535 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 ...
2
votes
1answer
185 views

tricky memoization

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

Imaginary term in Integration procedure

How do you remove the imaginary term in the integrated output? Compare the outcome from the operations below. The first operation yields an imaginary term, while the second one has none. ...
2
votes
1answer
188 views

Integrate message: can't prove Integration limits are real

I'm working on solving differential equations through Fourier series, I made a function to help me calculate the coefficients that looks like this: ...