Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

Filter by
Sorted by
Tagged with
0
votes
0answers
37 views

Why are the numerical and analytical evaluation of this integral not the same?

Since my integral and the way I used to solve it was so long, I put a .nb file here including all data which are needed. You can use it to try my question after reading the following details I had ...
3
votes
3answers
163 views

Why such a big difference between results of Integrate and NIntegrate?

Studying an interesting article of Daniel Lichtblau, I consider a variation of an example from it, calculating an improper integral ...
0
votes
0answers
32 views
1
vote
1answer
69 views

Optimization of second order ODE with more than one parameter

I want to optimize a second order ODE with more than one variable: ...
0
votes
1answer
44 views

How to plot a function when we want to change the independent variables? [closed]

Suppose we have two functions $z(x)=x^4+1$ and $y(x)=x^2+x+1$. Then how to plot $z$ vs $y$ (assuming in general that $z$ can not be written explicitly in terms of $y$)?
1
vote
2answers
45 views

Plot an integral function for various values of the parameter

How can I plot the function F[x_,a_]:=Integrate[Abs[x - z]^(-1-2a), {z, -Infinity, -1}] + Integrate[Abs[x - z]^(-1-2a), {z, 1, Infinity}] for x in (-1,1) and a in (...
1
vote
0answers
63 views

Definite integral gets stuck in the calculation

$f=\frac{\sinh ^{-1}\left(e^{-2 k t} \sinh (6 k)\right)}{2 k}-2$ for $k=20$ I have: $\frac{df}{dt}=-\frac{e^{-20 t} \sinh (60)}{\sqrt{e^{-40 t} \sinh ^2(60)+1}}$ ...
0
votes
0answers
45 views

Hi. I'm a beginner so I need help to solve this equations using Regula-Falsi to find root of the equation (which is x)

I've been trying to look for an example but only with one unknown. In my case of studies, I have 4 unknowns. I just want to make sure is it correct the way I'm writing the coding to find the root ...
0
votes
0answers
28 views

Trapezoidal Rule Apprx. step size n=10 Issue [closed]

I am attempting to use the trapezoidal rule to find an integral approximation. Can someone see where I am going wrong, please? ...
0
votes
0answers
40 views

NDSolve. Can I use numerical ODE solution as PDE initial condition? [closed]

I want to use numerical solution of the ODE as an initial condition for the 1D linear PDE. But it seems Wolfram Mathematica has some issues with it. Let's consider an example. Here we have nonlinear ...
2
votes
2answers
100 views

NIntegrate results different when using 0 or 0.0

i was trying to compute a convolution numerically, but got unexpected results. In the end i was able to reduce it to the code below. As you can see, the results are different, depending on whether i ...
0
votes
1answer
55 views

How to use parallel computation in mathematica for numerical Integration

I have a multi dimensional integral and I need to integrate it numerically and than plot it over an extra variable for zeta = 0.5. ...
0
votes
0answers
46 views

Force WhenEvent and NDSolve to numerical evaluation and Best Practice

I'm trying to perform an hybrid kalman filter for a nonlinear system. The following code works but it is very slow due to the fact that it does symbolic evaluation. What I wish is that for the filter ...
0
votes
1answer
67 views

Accurate Numerical values of a given functional

Consider the following functional : $$ I(x,s) =\int_0^\infty\mathrm dy \frac{F(x + \mathrm iy, s) − F(x −\mathrm iy, s)}{\mathrm e^{2πy}-1}, $$ where $ F(z, s) = \dfrac{\sin^2[π\Gamma(z)/(2z)]}{z^s} $....
1
vote
2answers
86 views

Solving Fredholm Equation with composite unknown function

I would like to numerically solve a Fredholm Equation where the unknown function is composite. For example, an equation like the one described in Solving Fredholm Equation of the second kind but ...
7
votes
4answers
548 views

Numerical solution of Fredholm Equation

I would like to plot the solution of the Fredholm Equation $$f\left(x\right)+\frac{1}{\pi} \int_{-1}^{1} \frac{1}{1+\left(x-t\right)^2}f\left(t\right) dt=1, \ \ (|x|\leq 1)$$ I tried to use ...
0
votes
0answers
34 views

How can Integrate of conjugate transpose in mathematica?

please help me to integrate this matrix in matematica: 0 ConjugateTranspose[u[x,t]] (u_x)[x,t]+I vx,t[x,t] 0 -ConjugateTranspose[u[x,t]] (u^(1,0))[x,t]-I vx,t[x,t] 0 0 0 ...
1
vote
2answers
70 views

Numerical Integration convergence

...
0
votes
0answers
24 views

Error using ParallelMap to evaluate NIntegrate of numerical derivative ND

I want to evaluate a numerical integration in which the integrand is constructed out of a function f and its derivative f'. <...
1
vote
1answer
52 views

How to define a polygonal region in 2D to subsequently integrate over it?

I want to integrate a function f[x,y] over a region like this. Is there any way to define the region using the vertices of the purple polygon? Then I can ...
0
votes
1answer
66 views

Piecewise Numerical results used in NDsolve

I have a solution of LinearSolve. And there are four conditions in single period. Then I used Which to expand this solution. <...
1
vote
1answer
34 views

Making boundary condition a variable in ParametricNDSolve

I would like to make where my ODE is evaluated at (not the boundary condition itself but rather the "x" value of the boundary condition) to be a variable in my code. I find that Mathematica ...
1
vote
2answers
87 views

How do you overcome recursion limits when using DSolve?

I have the following program to solve for the neutron to baryon ratio during BBN. I've replaced many of the derived values with constants in order to focus on the problem: ...
2
votes
0answers
97 views

NDSolve big system non linear coupled ODE's Method Residual Stiff System

I'm trying to develop a continuous time unscented Kalman filter for a dynamic system inspired to this article: "On Unscented Kalman Filtering for State Estimation of Continuous-Time Nonlinear ...
4
votes
2answers
143 views

Evaluating an improper integral

So I have this function: $$ \int_{-\infty}^{\infty} \mathrm {sech}(x+s)^{2} {\rm sech}(x)^{2}dx$$ And when I try to integrate it, I can obtain the indefinite integral: ...
0
votes
0answers
42 views

High Precision NIntegrate

Define the integrand (as a function of two variables $x$ and $y$): ...
4
votes
2answers
121 views

Integrate function returns vector instead of scalar

When I try to integrate a function mapping a vector to a scalar Mathematica "ignores" the function and returns a vector independent of the function. Here is a minimal example of my problem: ...
0
votes
0answers
29 views

Numerical integration involving divergence

I was just trying to perform the following numerical integration NIntegrate[1/(x - 5)^2, {x, 0, 10}] The problem I am facing is the divergence at ...
5
votes
1answer
122 views

Why does NIntegrate become much faster if I evaluate a function, then compile it, then make it numerical?

I am using Mathematica for numerical integrals in optics. By accident, I found out that NIntegrate becomes faster by an order of magnitude for a function I'm integrating, if I take the following steps:...
1
vote
3answers
139 views

Error with NIntegrate of a two variables integration

This is mathematica code for my integration, ...
1
vote
1answer
29 views

How to convert element's Table to List / Array to make an independent multivariable fit?

I would like to make an independent multivariable fit, but I have problems using a Table that I generated. I can´t use their elements because it isn´t in a list or a rectangular array. Using Table[ ] ...
0
votes
1answer
31 views

Contradictory results of numerical evaluations of a function

I have the following function: ...
1
vote
1answer
96 views

Solving the Stefan Problem with WhenEvent

The formulation of the problem: I tried to solve it with MOL and the method of V.R. Voller: The script: ...
5
votes
1answer
109 views

NSolve and NIntegrate, or a better approach

I need to define and plot the following function $$ a(t) := \exp\left(\int Z(t)\; dt\right) $$ where $Z(t)$ is the solution to the equation $$ 0 = t - 2 \int^Z_1 F(x)\; dx $$ with $F = F(x)$ being a ...
2
votes
0answers
54 views

Kernel CRASH of NIntegrate with a complicated compiled integrand

When I NIntegrate the integrand with the particular parameter showing below the Kernel crash without any message. But if I change the "range" parameter a ...
0
votes
1answer
65 views

Numerically Approximating Solutions to Differential Equation

I'm trying to numerically approximate solutions to a messy differential equation, given below $$(1-\alpha \frac{1}{\pi^{'}(s_2)})(s_2-\pi(s_2)+\frac{\beta}{2}\pi(s_2)-\frac{\alpha\beta}{2}s_2)+(p-\...
0
votes
1answer
35 views

Numerical integration of Lorenz Equations with time dependent r [closed]

I'm trying to solve question 9.5.4 from Strogatz's Nonlinear dynamics and chaos that asks us to plot hysteresis between a fixed point and a strange attractor. We're supposed to let r=24.4+sin(omega*t) ...
0
votes
1answer
97 views

Why are the results of integrations of a DiracDelta related integrand and its approximations strikingly different?

Let us consider a double integral, treating it as a functional which corresponds a number to a function, ...
0
votes
1answer
59 views

Principal value of a double integral numerically

I have several integrals of the form : where and . where a,b,wc and T are constants and PV denotes the Cauchy principal value I tried to integrate one of this form using NIntegrate however when ...
0
votes
1answer
49 views

How do I solve a differential equation numerically after numerical integration over a part?

Suppose I have the following function yteq[z_] := NIntegrate[f //. params //. {x -> z}, {y, 1, 100}] where f//. params is ...
1
vote
1answer
90 views

Solving multiple differential equations parametrically

I have the following code, where I am trying to solve one set of differential equations parametrically. I then want to use this solution to solve another equation parametrically. However, I get the ...
0
votes
0answers
31 views

Integration of rational function with small coefficients

I have to integrate a rational function $\frac{f(T)}{g(T)}$ which has really small numbers as coefficients. like this: $\frac{3.4*10^{-23} p T^5 \sin ^2(2 \theta ) m_s^4}{\left(1.\, +e^p\right) \left(...
1
vote
1answer
65 views

Nintegrate: Use multiple methods [closed]

Can I use multiple methods for a numerical integration? e.g. I have a 4 dimension integral and for each variable i want to use a different method. ...
7
votes
1answer
199 views

Is there a way to speed up Integrate when the integrand contains a product of polynomials each of which having a large degree?

I have integrals of the form $$\int_0^\infty\mathrm d x\; e^{-x^2}\;\;(\textrm{Polynomial of degree n})\times(\textrm{Polynomial of degree m}),$$ where $n,m$ can be as large as 300. When I use ...
2
votes
0answers
40 views

Finding region, between four hyperplanes, useful for integration

Consider the function $$ f(x,y,u,v) = \exp\bigl( -x^2 -y^2 -u^2 -v^2 \bigr), $$ and the region $\mathcal{R} = \cap_{i=1}^4 \mathcal{R}_i$ defined by four hyperplanes as follows $$ \begin{align} \...
1
vote
2answers
83 views

Why does Integrate[] fail to give me an analytical expression

I am trying this integral to solve analytically, but Mathematica fails, and I get the integral back as it is defined. Although numerically it can be done, I need an analytical expression. Is there any ...
2
votes
2answers
131 views

Minimization using NMinimize

I have a system of ODEs say $$x'(t)=2 x(t)-x(t)y(t)-3 x(t) g(t),$$ $$y'(t)= y(t)-2 x(t)y(t)- x(t) g(t)$$ with ICs $x(0)= 1, y(0)=1/2$, say, for $t_0 \leqslant t \leqslant t_f$, where $t_0$ and $t_f$ ...
0
votes
0answers
43 views

ParallelTable of NIntegrate of an Interpolating Function

I construct a 2D interpolating function using the following data (MWE): ...
5
votes
0answers
122 views

Numerical verification of the estimate:

How to verify numerically with considerable accuracy in Mathematica the following : $$\int_2^x\dfrac{1}{z\Gamma(\sin^2[π\Gamma(z)/(2z)])}dz\sim\ln(\ln(x))$$ ? I need more suitable and better code ...

1
2 3 4 5
56