Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
1answer
90 views

NIntegrate: Catastrophic loss of precision

Below is a simplified code that I am trying to evaluate. I am basically getting the rms value of a Wakefield function. When I finally try to evaluate the rms, I get an error. Any help would be greatly ...
3
votes
2answers
102 views

NIntegrate returns zero for non zero integrand, 4d Integration

I am trying to calculate the following integral. ...
0
votes
1answer
58 views

Integrating function can't be epressed? [closed]

Hi I have a function in a form of $$\frac{a}{x}exp(\frac{b}{\sqrt{3}-x})$$ The code is Integrate[a/x*E^(b/(3^0.5 - x)), {x, 1, 3^0.5}] But it can't work ...
5
votes
3answers
280 views

RK4 Gravity Simulator

I have the following RK4 solver which splits the two 2nd order ODEs, used to calculate x and y positions under the influence of a gravitating body where $$x''(t)=\frac{G m ...
0
votes
0answers
45 views

Code for solving numerically an integro-differential equation

First of all, I want to greet the community. This is my first question, but I hope I will be able to help answering others members questions, although I am quite new working with Mathematica. I would ...
0
votes
1answer
35 views

Calculate Integral with cos [closed]

Integrate[ (Pi/4 - x/2) cos (n *x), {x, 0, Pi}] This doesnt give me desired results .n is natural 1,2,3,4,5... I want to get something like ...
1
vote
1answer
86 views

NIntegrate failed to converge?

Hey guys I have a pretty simple code that consists of an RMS calculation. The issue is that I am getting quite a few error messages when I run it. The following equations are highly published physics ...
1
vote
0answers
60 views

Speeding Up NIntegrate and ?NumericQ

I have attached below a piece of code that has been running successfully but takes extremely long for mathematica to compute. I believe it is the last "rms" calculation and the fact that I am using ...
0
votes
1answer
40 views

Error message from NDSolve using WhenEvent

I am working with the following NDSolve expression: ...
1
vote
4answers
318 views

How to calculate this integral?

I am trying to Integrate the following Integral : $\int_1^{\infty } \dfrac{\left(x^2-1\right)^{13/2} e^{-ax} }{x^{10}} \, dx \,\, \,\,\,\,\,\,\,\,\,\,\,\,(a=\textrm{real>0})$ Mathematica didn't ...
2
votes
2answers
259 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!!!
1
vote
1answer
133 views

Runge-Kutta 2nd Order ODE Solver

Suppose I have a 2nd order ODE of the form y''(t) = 1/y with y(0) = 0 and y'(0) = 10, and ...
1
vote
0answers
52 views

Multidimensional Numerical Integral with Singular Behavior [closed]

I'm trying to numerically integrate a multidimensional integral where there is singular behavior when x = y. This is the integral ...
3
votes
1answer
96 views

Integrating a functional of an InterpolatingFunction

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

Unify the sampling of NIntegrate[ {f, g, h} w ]

I'm trying to numerically integrate a function which has a vector-valued slow part and a much faster component which is shared by all the components, i.e. an integral of the form $$ ...
0
votes
1answer
108 views

Better way to check conservation in NDSolve

The partial differential equation in the NDSolve below is conservative (by construction) of $\int_{-1}^{+1} p(t,z)\ dz$ for all $t$. ...
0
votes
1answer
136 views

Zooming into Parametric Animation Plot that Uses InterpolatingFunctions

I have an interplanetary trajectory solver that calculates a spacecraft route from Earth to Mars, and I am trying to zoom into the spacecraft when it reaches its Mars intercept orbit but am having ...
0
votes
1answer
130 views

Help using NIntegrate

I need some help with NIntegrate. I pasted the code that I wrote below; I know that up to "de" is correct. What I would like to do is NIntegrate de w.r.t phi{0,0.1} and curlE{-10,10}. The final ...
0
votes
0answers
44 views

Ideas for NDSolve?

I'm currently trying to find a numerical solution to a differential equation of the form: D[W[X], {X, 4}] ==(-(1/(delta + G - (G X)/L)^2) + 1/(delta + (G X)/L)^2) ...
3
votes
0answers
35 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 ...
0
votes
0answers
69 views

Problem with using the results of ParametricNDSolve in a ParametricPlot3D

I new to Mathematica and I have a problem with certain equations. I want to plot a trajectory in spherical coordinates given by the equations: ...
0
votes
0answers
78 views

A power series expansion

Consider the function, $f(z) = z tanh(\pi z) log (z^2 + a^2)$ for some $a>0$. Now I am considering 3 different situations, $z = i(n+0.5) - i\epsilon + \delta - it$ for $n \in \mathbb{Z}$ and ...
0
votes
1answer
61 views

Numerical integration of two variable function

The aim is to calculate the definite integral of the function $f$ of the form $$f(x,t) \;\;\;\; x \in [0, \infty ) \;\;, \;\;t \in [t_0,T]$$ numerically. For example consider the function below $$f = ...
1
vote
0answers
41 views

Optimising code for nested integrals

See below for some code I wrote to model a non-homogenous poisson process. The code generates the correct results but takes a long time due to the number of nested integrations. I have tried reducing ...
0
votes
1answer
61 views

Integrand evaluating to non-numerical values

I have solved a system of equations using NDSolve just fine. From there, I can plot the solutions $u(x)$ and $v(x)$, as well as its derivatives, just fine. But, when I want to evaluate the energy ...
0
votes
1answer
36 views

Multiplicate in an Integration with time [closed]

I am calculating the area of a step response. I try to use this Integral Criterion for my Calculation. The time t is multiplicated with the control error xd raised to the second power. ...
1
vote
1answer
139 views

To solve Cylinderical PDE

I want to solve this PDE. I have tried to solve it with NDSolve but found error 'Boundary values may only be specified for one independent variable. Initial ...
1
vote
1answer
143 views

Multiple plots on same graph for different parameter?

I would like to be able to Plot a function (with an implicit Integrate command) with various values for a certain parameter ...
3
votes
0answers
166 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 ...
2
votes
2answers
107 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
2answers
140 views

How can i integrate over a set of data

i need to integrate over my data, which is denoted as {q, I},here I is the Intensity i need to obtain the form of the following integration( its not a numeric integration, because it contain x, next ...
2
votes
1answer
145 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 ...
0
votes
1answer
114 views

How to solve this integral equation?

I am trying to solve for x the integral equation : ...
0
votes
0answers
90 views

an NIntegrate inside a manipulate in mathematica was working and suddenly won't work now. it says indeterminent and it doesn't make any sense why

my title says pretty much everything heres what I'm entering. NumericQ returns a false value but it was true before. Im loosing my patience because this is so ...
3
votes
1answer
148 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 ...
2
votes
1answer
140 views

Understanding of method for NDSolve

I used automatic method for NDSolve. Then I asked myself - which method Mathemathica prefered? I got an answer for this question on this forum, that I need to use: ...
4
votes
1answer
163 views

Find lengths of contours in a ContourPlot

I am trying to find the lengths of different contours in the following plot: It is a complicated piecewise function evaluated on the unit disk. I am hoping there is an easy, generalized way to ...
0
votes
0answers
125 views

Calculating the Lyapunov Exponent/Spectrum for the Duffing Oscillator

Some fellow students and I are trying to calculate and plot the Lyapunov spectrum for the Duffing oscillator (currently a test approach). Each of us has Mathematica knowledge based purely on past ...
0
votes
0answers
90 views

complicated Numerical Integration, FEM application

I am trying to calculate a 2d Integral which has another 2d integral in the integrands. here is the setup: ...
1
vote
0answers
54 views

An example of how to compute numerically the KL-divergence in mathematica [closed]

I wanted to compute an exact number for two probabilities that I am comparing. These are two normal distributions as: $$Normal(\mu = 5, \sigma = 4)$$ $$Normal(\mu = 5, \sigma = 5)$$ I decided to ...
1
vote
2answers
142 views

Making mathematica do regulated integrals

Consider the integration, $\int _0 ^\infty dx\ x \tanh( \pi x) \sqrt {x^2 + a^2 } $ where $a$ is a real number. This integral is divergent. We note that an asymptotic expansion of the integrand ...
0
votes
0answers
65 views

Numerically Solving Compatible Systems of Overdetermined PDE

Is there an easy way to get Mathematica to numerically solve a compatible system of overdetermined PDE, and plot the solutions? For example, consider the "toy" example $\dfrac{\partial u}{\partial ...
0
votes
1answer
48 views

How can I fix my code so NIntegrate doesn't produce error message?

I get this error when trying to integrate a seemingly simple expression: ...
0
votes
1answer
87 views

Mathematica Compute Time Is Extremely Long (Integrate simple function with parameter scan)

I was wondering if you can help. I have a set of equations I need to solve for a list of parameters; entering each parameter value and solving anew each time is simply not economical. I found a way ...
1
vote
2answers
105 views

NIntegrate piecewise vector function

Is there a way to numerically integrate a vector function defined via Piecewise? Example: ...
1
vote
1answer
107 views

Solution of Coupled Second Order ODEs with Boundary Conditions

D[Tu1[x], {x, 2}] qu - Tu1[x] (fu0 + I w p) == Tou[x] f1 D[T1[x], {x, 2}] q - T1[x] (f0 - b g0 + I w p)== To[x] (f1 - b g1) - g1 For T1 , ...
7
votes
1answer
282 views

Fitting a numerical integral via NonLinearModelFit to magnetic data

I'm new to Mathematica and I'm currently trying to fit $$m_T (H,T) = N_T \int\limits_0^{\infty} \frac{x k_\text{B} T}{\mu_0 H} \mathcal{L}(x) \text{pdf}(D_\text{mag}) \text{d}D_\text{mag}$$ with ...
1
vote
0answers
47 views

How to find out how Mathematica performed an integration? [duplicate]

In terms of integration, I usually utilize Mathematica 9 to compute scattering amplitudes in quantum field theory. Recently, I employed it to compute a particularly difficult integral, and it ...
1
vote
0answers
102 views

Monte Carlo integration with random numbers generated from a Gaussian distribution

I want to do numerical integration of some functions using the Monte Carlo method. The default setting for the Monte Carlo method is to use a uniform distribution as far as I know. How can I change ...
0
votes
1answer
70 views

NDSolve accuracy related problem

I want to solve this equation: ...