Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
0answers
81 views

To solve an equation

I am trying to solve the equation: Solve[Re[Integrate[(2 c - (r^2) Exp[- I 1.4746])^(0.5), {r, 0, 31.7576}]] == 2.1216, c] I want to integrate an expression in ...
1
vote
0answers
83 views

How to specify the time variable for NDSolve

I recall that it is possible to specify which independent variable is the "time" variable in NDSolve, but I can't find it documented anywhere. Does anyone recall ...
1
vote
2answers
84 views

Problem evaluating a complicated integral

Apologies for stating my problem poorly in the first instance, thank you for the help in narrowing down the issue. Problem For those interested, it's for the exact unbiased inverse of the ...
1
vote
0answers
27 views

Nested NIntegrate of vector function

I am performing a nested integration where the upper limit of the inner integral depends on the value of the outer integral, like in the question [Nested NIntegrate]. As in this question my function ...
1
vote
0answers
71 views

Speeding up the numerical integration of a certain function

I'm using the following function f[t_] := 3/4 t^-3 NIntegrate[(x^4*Csch[x/2]^2), {x, 0, t}, Method -> {Automatic, "SymbolicProcessing" -> 0}]; I ...
0
votes
1answer
57 views

How to get correct numerical integration which should be zero? [duplicate]

I want to numerically integrate function berrycur over kx and ky. The definition of berrycur is given at the end of the ...
0
votes
1answer
73 views

wolfram mathematica intersection of two surfaces [duplicate]

I use wolfram mathematica. There is a function of two variables which defines the surface z = f(x,y), the second surface is defined as z = const. How to find the line of intersection of these two ...
0
votes
0answers
31 views

NIntegrate Issue: Changing integration limits makes calculation time extremely long

After a long time developing some code in mathematica and finally getting it to work, I have unfortunately encountered an odd problem: When I change the limits of integration (and shift the function ...
-1
votes
2answers
65 views

Strange numerical integration result

I write a function called berrycur[kx,ky] which I will give at the end of the question, and want to numerically integrate this function over {kx, -2π, 2π]}, {ky, 0, ...
0
votes
0answers
37 views

Comparing NIntegrate with definite integration

I want to calculate without error a sum of double integrals with the following definitions for the functions within them: ...
0
votes
1answer
55 views

Numerical integration with purely numerical integrand

I'm trying to perform a numerical integral with an integrand that should not be manipulated with any symbolic preprocessing whatsoever. Consider the following simple test : ...
0
votes
0answers
68 views

NIntegrate: integrand has evaluated to non numerical values

I have pasted a code that has been giving me some trouble and errors when I try to compute. ERROR: "The integrand 1435.1232 E^(-6.4703566*10^6 s^2) deEntrance[s,phi]^2 has evaluated to ...
3
votes
2answers
178 views

Integration and Fourier transform

I would like to calculate the distribution function from the characteristic function. There is a formula given as $$F_X(x)=\frac{1}{2}+\frac{1}{2\pi}\int_{0}^\infty \frac{e^{i w x}\phi(-w)-e^{-i w ...
1
vote
0answers
71 views

NIntegrate (multi-dimensional integral)

I am interested in the numerical evaluation of the following integral: $\int \prod_{i=1}^n dx_i \delta(\sum_{i=1}^n x_i) \prod_{i=1}^n f_i(x_i)$ where $f(x)$ is a complicated function. Unfortunately ...
4
votes
2answers
157 views

Calculating the area under a curve, but above a certain threshold value

so here I am with a time series of data (hours (t) and corresponding measurements (a)). ...
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 ...
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
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 ...
1
vote
1answer
198 views

Which integration strategy to use for this product of polynomials?

What would be the ideal integration strategy for a function like this: $$f(x_1,x_2,\dots,x_N)=\prod_{i=1}^Nx_i^{c_i}\Theta(x_i-p_i)$$ where $x_i,p_i\in \mathbb{R}$, $\Theta$ is the Heaviside function ...
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
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 ...
0
votes
1answer
40 views

Error message from NDSolve using WhenEvent

I am working with the following NDSolve expression: ...
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 ...
1
vote
1answer
132 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 ...
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!!!
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 ...
8
votes
1answer
656 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. ...
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 ...
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$. ...
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
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
2answers
678 views

How does one specify Neumann conditions for NDSolve?

I have a series of functions defined in my notebook, and then want to use this to solve a diffusion-reaction type equation. At the moment, something like this works: ...
1
vote
1answer
138 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 ...
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, ...
0
votes
0answers
168 views

Function not recognized by Mathematica?

I'm trying to do triple integration on a bivariate function where one of the upper integration limits is the variable of the outer-most integration. When I execute the following lines, Mathematica ...
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
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 ...
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
1answer
121 views

Infinite expression 1/0.^(1/4) encountered in NDSolve

I am trying to solve very simple system of coupled differential equations using the NDSolve function, but I am getting ...