Skip to main content

Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 views

Singularity or stiff system suspected in ODE that shouldn't have a singularity in the solution range

I am trying to numerically solve the following ODE where I know the value at p[1000]: ...
ydd's user avatar
  • 3,820
0 votes
0 answers
51 views

I want to plot a system of coupled pde where coefficients are component of vector defined piecewise [closed]

I am trying to reproduce some results of a paper. But I'm very new to Mathematica. I have written the code using some AI tools. but I'm unable to spot the error and mistakes in my code. here is my ...
Ashish K's user avatar
0 votes
0 answers
39 views

Solving a second order pde from solution of another pde

I have solved the following pde numerically using NDSolveValue. ...
questionerno8's user avatar
0 votes
2 answers
72 views

Integrate gives inconsistent result for gamma-like integral with complex variables

I am trying to come up with a generic formula for the below integral, which is analogous to the upper incomplete gamma function, ...
ThomasJr's user avatar
0 votes
0 answers
29 views

Non-numerical values in double numerical integration [closed]

I am integrating twice numerically, and in my case I cannot use the inbuilt double numerical integration. I am getting an error message about non-numerical values and I broke it down to the minimal ...
Xorker's user avatar
  • 23
0 votes
0 answers
17 views

How to define function in a better way and how to ensure the result of NIntegrate is correct?

I just begin to use mma this year, but i only know little about it. Could any one guide me plz. ...
Middle's user avatar
  • 1
1 vote
0 answers
45 views

How to constrain two PDE variables to be the same value on boundary?

I have a 4 pdes for 4 variables: v, v2, ua, and p. I would like to specify that v==v2 on the left and right boundaries at all times. Here are the equations: I discretise the system using PDEtoODE. ...
Ariana Fenris's user avatar
1 vote
0 answers
61 views

Why is NDSolve ignoring two PDEs out of three ones I am solving?

I am solving the following coupled system of 3 PDEs modelling a 1D membrane coupled to a 1D fluid flow field underneath. However, on putting them into NDSolveValue (and trying with FEM), it says the &...
Ariana Fenris's user avatar
0 votes
0 answers
47 views

Stabilise equations for motion of Inextensible string subject to spatially non-uniform forces

I would like to simulate the motion of an inextensible membrane in 1D as an inextensible string subject to spatially-dependent body forces. For now, I would like it to be constrained at both ends. I ...
Ariana Fenris's user avatar
3 votes
1 answer
126 views

Nested integration of the list of functions returns error

I have a list of expressions which I would like to integrate by nested integration. For any element from the list it works without issues (see end of the post), however, when I apply nested ...
seva011's user avatar
  • 316
0 votes
0 answers
32 views

NIntegrate: variable is not a valid limit of integration

I have a function $F(z_h)$ given by, $$F(z_h) = \int^{\infty}_{z_h} s(y) T'(y) dy$$ where $T \equiv T(z_h), T' \equiv T'(z_h), s \equiv s(z_h)$, which means they're all functions of $z_h$. Their ...
mathemania's user avatar
0 votes
1 answer
62 views

Vortex beam profile plot [duplicate]

I want to plot this type of plot for the Lagurree Gaussian beam $\begin{aligned} u(r, \phi, z)= & C_{l p}^{L G} \frac{w_0}{w(z)}\left(\frac{r \sqrt{2}}{w(z)}\right)^{|l|} \exp \left(-\frac{r^2}{w^...
Himani Juneja's user avatar
0 votes
1 answer
38 views

NIntegrate over a 2D Region

I am using Mathematica's ability to integrate over regions to find the mean aerodynamic cord of a wing planform. As an example, here is a simple wing, and its bounds. ...
rhomboidRhipper's user avatar
0 votes
0 answers
45 views

NIntegrate with depended variables

I have problems in integrating a function with depended variables. I am pasting the code below ...
Ioannis Polopetrakis's user avatar
1 vote
3 answers
138 views

Integrating the derivative of a distribution via Expectation

Let's suppose to have a Multinormal distribution MultinormalDistribution[μ,Σ] . We can easily and very fast compute expectation values of the moments via the pre-...
JTT's user avatar
  • 193
1 vote
1 answer
133 views

Find the polar plane of the ellipsoid and integrate the Ellipsoid cap

I am working on writing a code to find the polar plane of an ellipse, and subsequently calculate the cap formed by subtending the point $p$ (red) onto a random ellipse. I think I have managed to ...
MKF's user avatar
  • 613
1 vote
1 answer
90 views

NDSolve fails first order ODEs, but works when transformed to second order [duplicate]

The short version is that I am trying to solve a relatively simple system of coupled first order ODEs with NDSolve in Mathematica 12.1.1.0 on Windows. This system ...
Alexander Erlich's user avatar
0 votes
1 answer
60 views

NIntegrate inside FindRoot has evaluated to non-numerical values

I have a function Fdiff[m] that I want to put in FindRoot. However, it has given me an error saying that the integrand has ...
mathemania's user avatar
0 votes
0 answers
33 views

Efficient Triple Numerical Integral Computation with Variable Limit Functions

I have a triple integral expression where the limits of integration depend on other integral parameters. Here is the functions where $0<p<1$: ...
Frey's user avatar
  • 325
2 votes
2 answers
173 views

How to calculate a definite integral with a parameter

I am trying to calculate the following definite integral with the parameter H. So my result would like to be a analytical one with the parameter H. For example for the integral NIntegrate[ax, {x, 1, ...
Dinos Volanis's user avatar
2 votes
0 answers
37 views

Elegant way to handle a series of interpolation functions

In this post, I wrote a piece of code that can bypass singularities in numerical solutions of the first type of Painlevé ODE. The code is as follows ...
Jie Zhu's user avatar
  • 798
2 votes
1 answer
76 views

Generate variables in multiple integral

I want to do a multiple integrate with n variables. When I change the value of n, I do not want to rewrite the variables in the integral manually like here: ...
Zsombor's user avatar
  • 185
0 votes
0 answers
52 views

Mathematica crashes when trying to use NIntegrate on a complex function

I am trying to integrate the real part of a specific entry in a Green function given by G[E_] := Re[Inverse[E iF - H + I L/2]][[13, 13]]; ...
flg's user avatar
  • 1
1 vote
0 answers
81 views

How to decrease the computation timing while using NIntegrate?

I'm trying to calculate the $A$ and $F$ values by using this code, ...
Entangled Quark's user avatar
0 votes
3 answers
124 views

Properly define function from outcome of NSolve and FindRoot

We have the function $\gamma(u,v)$ defined implicitly as the solution of \begin{align} \sin\gamma(u,v)=g\left(u-v\cos\gamma(u,v) \right), \end{align} being $g$ a given function. I can solve for $\...
Daniel Castro's user avatar
0 votes
1 answer
43 views

Integrate & Unit: unable to determine the units of quantities

In a Wolfram Notebook, I declare a function F1[x]=1/x where x is in "Meters" F1[X_] = With[{x=Quantity[X,"Meters"]},1/x] I integrate F1. ...
Joseph Marie's user avatar
2 votes
1 answer
91 views

Speeding up the nested NIntegration consisted of `Exp' and `Bessel' functions

I got stuck with optimizing the nested numerical integration of function with a high number of Bessel functions (first and second kinds) summed and several exponents. I will appreciate any suggestions ...
seva011's user avatar
  • 316
0 votes
1 answer
48 views

Trying to use NIntegrate and my code works intermittently - Throws one error consistently, but only gives me a partial result [closed]

I'm trying to do some calculations/simulations of pulse autocorrelations of non-integer orders and when I try to use NIntegrate it only works intermittently, and when it does work it only gives me a ...
UltrashortGiraffe's user avatar
2 votes
1 answer
79 views

NIntegrate underestimate the area under the graph [closed]

I want to find the area under this graph, I used NIntegrate for this purpose and here is my script, ...
Etemon's user avatar
  • 255
2 votes
1 answer
147 views

How to Optimize Integro-Differential Equation Solving Time in Mathematica?

I'm trying to solve an integro-differential equation numerically in Mathematica that models the evolution of a physical system . However, the computation takes a very long time and doesn't yield a ...
Roy Smith's user avatar
3 votes
1 answer
64 views

Integral of interpolation function is not evaluated

I am having a misunderstanding with Mathematica about integration of InterpolatingFunction. Consider this example: ...
atapaka's user avatar
  • 3,954
1 vote
1 answer
115 views

Partial integro-differential equation

I want to solve the following partial integro-differential equation for $\delta(x,t)$: $$ 1-B \cdot \frac{\partial \delta(x, t)}{\partial t}=\frac{1}{\pi} \int_{-1}^1 \frac{\partial \delta(s, t)}{\...
Rui's user avatar
  • 11
0 votes
2 answers
71 views

Comparing Closed-form to Numerical Integral Result

When I numerically calculate this integral NIntegrate[(1/2)*Log[1 + Sin[x]]^2, {x, 0, Pi}] The result is $0.416217488896557$ and I verified it using another tool....
Moo's user avatar
  • 3,334
1 vote
0 answers
72 views

Numerically solving a non-linear and with infinite domain integro-differential equation

I have tried NDsolve but failed. Would there be any way to solve this equation numerically using Mathematica? Here is the code: ...
keer Zhang's user avatar
1 vote
3 answers
306 views

Non-linear PDE coefficients problem

I'm trying to solve the following PDE ...
Daniel Castro's user avatar
8 votes
2 answers
159 views

FindRoot changes results from ParametricNDSolve

I solve numerically an equation, and I get the expected behaviour like the following graph But if I use FindRoot to get the roots before plotting, the plot of my ...
William Santos's user avatar
0 votes
1 answer
113 views

Numerical Fourier transform

I am having issues trying to numerically Fourier transform the following function \begin{equation} f(x) =\frac{1}{x^6}\sqrt{4m^2x^2+x^4}\log\biggm(\frac{2m^2 + x^2 + \sqrt{4m^2x^2+x^4}}{2m^2}\biggm) \...
MathZilla's user avatar
  • 123
1 vote
2 answers
106 views

Iterated integral numerically

I am trying to calculate a double integral. However, after a long time, Mathematica does not give me any outputs. Has someone any ideas how to calculate this? ...
Marco's user avatar
  • 163
2 votes
0 answers
41 views

Different answers from `NSurfaceIntegrate` if using `ImplicitRegion`

I want to find the surface area of a region defined as $x^2+y^2\le1$ and $z=ln(x^2+y^2+2)$. I can transform it into cylindrical coordinates and write $z=ln(r^2+2)$. Using ...
Deadbeef's user avatar
  • 121
0 votes
0 answers
30 views

Numerical integrate a matrix valued function whose arguments limited to be numerical

I'm encountering non-numerical errors when using NIntegrate to integrate a matrix-valued function whose arguments are restricted to numerical values. Setting ...
ssskkkky's user avatar
3 votes
2 answers
148 views

How can a number be transformed into the form of an exponent with a specified base plus or minus a number? [closed]

This number is: ...
csn899's user avatar
  • 4,315
3 votes
1 answer
107 views

Asymptotic integral expansion at infinity [closed]

Define for all $n\in\mathbb{N}$, a definite double integral, $$I_n= \int_{0}^{1}\int_{0}^{1}\left(\frac{x^2(1-x)y^2(1-y)}{1+x^2 y^2}\right)^n\frac{\cos((2n+1)\tan^{-1}(xy))}{\sqrt{1+x^2y^2}}\ dxdy$$ ...
Max's user avatar
  • 145
5 votes
2 answers
498 views

Extract and solve complex solutions from ContourPlot/FindRoot

I have to solve a complicated equation numerically f(z,k)=0 with z = x + i y a complex variable and ...
Gallagher's user avatar
  • 773
2 votes
1 answer
39 views

Nested NIntegrate with limit variable dependance

Hope you are doing great! I am trying to solve a double Integral of a function let's say f(w,q). My upper and lower limits are ...
Ioannis Polopetrakis's user avatar
1 vote
1 answer
37 views

Not able to integrate function involving scalar product

For given $h=0.2,D=1.5$, let $w_{i}(x):=\frac{1}{\pi D}\exp^{-||\frac{x-hi}{\sqrt{D}h}||^{2}}$ where $x\in \mathbb{R}^{2}$ and $i\in I \subset \mathbb{Z}^{2}.$ For $x\in \mathbb{R}^{2}$ ,let $v(x):=-...
chintan's user avatar
  • 15
5 votes
4 answers
271 views

Solving the system of nonlinear PDE

I have never used Mathematica before. I am trying to solve the system of PDE \begin{array}{l} \frac{\partial u}{\partial t} = D_u \nabla^2 u - \beta \chi_u \nabla ( u \nabla \pi_u) + u (\pi_u - \...
random487510's user avatar
1 vote
0 answers
79 views

Which rule to choose for NIntegrate?

I would like to know how to choose the right rule among several (TrapezoidalRule, NewtonCotesRule, ...) to compute correctly an ...
Gallagher's user avatar
  • 773
2 votes
1 answer
97 views

Incredibly slow NIntegrate

I define the following function $$ f(x,y,z) = \frac{\sin x}{\pi \sqrt{\Big[ \cos x - \cos (y-z) \Big] \Big[ \cos (y+z) - \cos (x) \Big]}} $$ where $y, z$ are all between $0, \pi/2$ and $ |y-z| < x &...
user16320's user avatar
  • 2,396
4 votes
1 answer
123 views

NIntegrate returns TerminatedEvaluation["RecursionLimit"] when called in another function

I try to perform some numerical integration with high precision on version In[1]:= $Version Out[1]= "13.3.1 for Linux x86 (64-bit) (July 24, 2023)" Here ...
SimonM's user avatar
  • 41
1 vote
0 answers
63 views

Numerically integrating an interpolation function and its derivative

I am working with a differential equation I cannot solve analytically. I solved it numerically. I have data representing position versus time in a list. I have working code that generates an ...
Rainforest Frog's user avatar

1
2 3 4 5
71