Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
1answer
120 views

Partitioning a numerical integral: need to integrate spectra

I am trying to integrate a spectrum I obtained from a fourier transform infrared spectroscopy experiment, in order to determine the global warming potential of green house gases. In order to do this, ...
1
vote
1answer
114 views

Orthogonalizing polynomials with inner product depending on parameters

I need to orthogonalize the polynomials $h_n(x)=x^{2n}(1+x^2)^{-4S}$ with $x\in\textbf{R}$, $2S\in\textbf{N}$ and $n\in\{1,3,5,\ldots, 4S-1\}$ over the inner product $\langle h_n,h_m\rangle=32\pi ...
1
vote
1answer
71 views

Two dimensional NIntegration failure - non-numerical values

I've got this function: E0[x0_, y0_, z_]:= A/w[z]*Exp[-(x0^2 + y0^2)/(w[z]*w[z])]*Exp[(I*2*Pi*(x0^2 + y0^2))/(λ*2*R[z])]*Exp[I*ϕ[z]]; Where the ...
2
votes
1answer
258 views
0
votes
0answers
87 views

Manipulating local or external variable within NDSolve

I am wanting to save and use the value of a variable within NDSolve[] but without that variable being part of the equation itself. Code below (ODE for the Leaky ...
6
votes
2answers
335 views

NDSolve Plotting issue

I am trying to solve a system of ODEs with one extra boundary condition. ...
2
votes
0answers
90 views

Constrain integration to be over real domain

I am trying to integrate the following: Integrate[(2*Cos[Sqrt[F]*z - G])/E^(D*(p + z)^2), {z, -(h/2), h/2}] I am getting solution in complex domain: ...
4
votes
2answers
360 views

Why does this integral have a complex component?

I wanted to find the probability of my normally-distributed random variable being at least 15, so I set up this integral: ...
2
votes
2answers
114 views

Definite Integral. Perfomance problem

I have a notebook in Mathematica 4. I'm trying to convert it to use in Mathematica 9. One of the problem is the long computation of definite integral. In Mathematica 4 the result of the following code ...
1
vote
2answers
131 views

NDSolve - 2nd order ODE - how to solve for y and y'

i am trying to workout how to solve a simple 2nd order ODE for y and y'. I can solve for y[t] as follows but how can i solve for y[t] and y'[t] ? ...
4
votes
1answer
96 views

How to use WhenEvent with a vector ODE in NDSolve

I have an ODE system I'd like to specify as a vector equation in NDSolve. I'm not clear on how to use WhenEvent for a system ...
0
votes
0answers
106 views

StiffnessSwitching controller for NDSolve

I have a question regarding NDSolve and StiffnessSwitching. StiffnessSwitching is a method to provide automatic means to handle switching between a stiff and nonstiff solver. The StiffnessSwitching ...
7
votes
1answer
400 views

Issue with the NDSolve code

With this procedure, one may determine an eigen-value function $R(a)$ for any given $\Xi$ (say 0, 25, 50, 75, 100) ...
6
votes
0answers
81 views

Slow NIntegrate over complicated domains (sometimes)

Overview I have a very large matrix I need to calculate where each element requires the integration of a product of two functions over some complicated domain. I would like to find a set of options ...
1
vote
0answers
94 views

NIntegrate doesn't work

I have a function, Dx[s] (defined in a module) which I can plot: Plot[Dx[s], {s, 0, GetLatticeLength[]}] However if I try ...
0
votes
1answer
297 views

NIntegrate & non-numerical values

I am wondering why I am receiving the message "The integrand ... has evaluated to non-numerical values for all sampling points in the region ..." for a particular calculation I am running. How can I ...
1
vote
3answers
181 views

plotting an Integration output

How to solve this integral by Mathematica even by numerical methods (plotting the solution) Integrate[(Cos[x] - a)/(1 + a^2 - 2*a*Cos[x])^1.5, {x, 0, 2*Pi}] It ...
7
votes
1answer
295 views
2
votes
1answer
415 views

Differential equations: Solving a singular/nonlinear ODE using NDSolve

I am trying to numerically solve a rather horrible looking singular/nonlinear ode: A*(y''[x]/y[x])'' +y[x]^2==1 on the interval ...
2
votes
1answer
210 views

How to use NIntegrate in a purely numerical mode?

I have a function that is defined as the smallest root of a given polynomial. Something like this: ...
0
votes
1answer
143 views

PDE Solving in mathematica

I'd like to ask how I might go about solving this equation: $\frac{\partial Ci}{\partial t} + \frac{1}{r^2}\frac{\partial (r^2 Ci)}{\partial r} = D\frac{1}{r^2}\frac{\partial}{\partial ...
2
votes
1answer
150 views

Plotting Laplace's equation on an infinite domain

I am trying to plot my solution to a Laplace equation on an infinite domain. However, when I try to plot it, Mathematica just runs with nothing happening. ...
0
votes
1answer
365 views

Syntax question regarding Triple Integrals in Mathematica

Integrate[1, {z, 0, 5}, {x, -Sqrt[ 9 - y^2], Sqrt[ 9 - y^2]} , {y, -3, 3}] 60 Sqrt[9 - y^2] How comes I am not getting a number for my final answer? This ...
0
votes
0answers
83 views

Parameter sensitivities of ParametricNDSolveValue involving numerical function

This is a followup of my former question from here. Consider the code ...
1
vote
1answer
823 views

Can Mathematica solve integro-differential equations?

I have integro-differential equations like this: ...
1
vote
1answer
171 views

Using ParametricNDSolveValue with initial conditions of another ParametricNDSolveValue

I have a system of parameter-dependent ODEs, which I can solve using ParametricNDSolveValue. Now, I have another ODE, which has as initial condition the solution of ...
0
votes
0answers
130 views
12
votes
1answer
770 views

Numerical solution of coupled ODEs with boundary conditions

I have to solve the following set of ODEs and just can't get good results using Mathematica $$ r\frac{d}{dr}\left(\frac{1}{r}\frac{d}{dr}A(r)\right)-\xi^2F(r)^2\left(A(r)-1\right)=0 $$ $$ ...
1
vote
0answers
171 views

Jumps in NDSolve results

I need to compute using NDSolve routine, some function $F(x)$, having two possible values $F_1(x)$ and $F_2(x)$ depending on whether the argument exceeds some ...
0
votes
0answers
144 views

System of integral equations with integrals on both sides

I'd like to solve the following equation numerically for $a_1$, $a_2$, $\alpha_1$ and $\alpha_2$: $\displaystyle\int_0^{\infty}\Big[L_1\Big(\frac{k^2}{2}\Big)\Big]^2e^{-k^2}L_m(k^2)\ dk=$ ...
-2
votes
1answer
177 views

Is there any good way to find and/or plot numerical integrals of non-continuous functions like Tan[x]? [closed]

I believe that the answer to this may be obvious to some of you, but I just can't think of anything that works. NIntegrate, NDSolve, etc, all throw a temper tantrum when they have to divide by zero, ...
2
votes
1answer
306 views

Avoiding zero (empty set) solution with NDSolve

I'm trying to use NDSolve for a chemical kinetics equation where the rate of conversion is given by this relationship as typed in Mathematica: ...
2
votes
1answer
545 views

Obtain a stable solution using NDSolve

I am trying to solve a partial differential equation using NDSolve. When I am not specifying any method options with NDSolve, it ...
0
votes
1answer
103 views

Order of evaluation in nested expression

I am trying to make a function that works as follows: Integrate 1 for all t in the interval $ [0,1] $ such that the first element of function vstar is positive. ...
1
vote
1answer
101 views

ParallelTable of ParametricNDSolve objects fail

There seems to be a problem with ParametricNDSolveValue togeteher with ParallelTable First we create a ParametricNDSolveValue object ...
1
vote
1answer
116 views

ParametricNDSolve: Fails to differentiate an matrix differential equation

It seems like there is a problem with differentiating a ParametricNDSolve object when the underlying system contains an matrix differential equation. Create a simple ParametricNDSolveValue object ...
3
votes
1answer
143 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 ...
0
votes
0answers
183 views

Defining extra boundary conditions for NDSolve?

I have a second order reaction / diffusion type ODE of the form $\frac{D_{o}}{r^2} \frac{d}{dr}\left(r^2 \frac{dC}{dr} \right) - \frac{aC}{C+k} = 0$ where $a, k$ and $D_{o}$ are constants and $C$ is ...
4
votes
4answers
894 views

Numerical differentiation methods

Is it possible to write a code in Mathematica that implements various differentiation methods (like forward, central, extrapolated, etc.)?
2
votes
0answers
95 views

Whether NIntegrate evaluation is multithreaded or not?

About MultiThread evaluation I am talking about here, see this post I am NIntegrate the function grarm[e, 3, dimension, 1, 1, 0.005]. There is matrix operation in ...
0
votes
0answers
73 views

Some boundary issue of Integration

When I try to solve the integration f(x) as following (type it in the Mathematica) $ f(x)= \frac{1}{π} \int_{-1}^{1} \frac{\sqrt{1-y^2}}{(y-x)}dy $, I met some boundary problems. I have searched some ...
1
vote
0answers
91 views

why maxrecursion didn't work if I specify singularity in NIntegrate

I study sigularity specification and MaxRecursion in NIntegrate. And find something unusual. first I define a function δ[x_, y_: 1/100] := 1/π*y/(x^2 + y^2) ...
3
votes
1answer
326 views

Why this numerical integration takes so long?

Let me explain the problem. I am trying to integrate a one dimensional integral: $$\int {g\left( {{k_x}},parameter1,parameter2,...\right)d{\mkern 1mu} {k_x}} $$ for the sake of clarity, I will give ...
9
votes
1answer
264 views

Mathematica9: NDSolve slows down after repeated calls

I have noted that in Mathematica 9 my code, which involves a lot of calls to NDSolve, slows down considerably after some time. Apparently, the problem is NDSolve itself and it seems to be related to ...
4
votes
0answers
294 views

NDSolve: ProcessEquations and Reinitialize with Piecewise functions

I am having trouble with using NDSolve`Reinitialize when the system consists of a pieceise function. If we define the ODE system ...
5
votes
2answers
415 views

Volume of a graph

I have the following list: ...
2
votes
1answer
256 views

Limitations of ParametricNDSolve family w.r.t objective functions

Observation: I can see even for very simple modification in case of an scalar objective involving an definite integral in time ParametricNDSolve fails. Here is an ...
4
votes
1answer
181 views

How to demonstrate lack of stability with advection equation

I am trying to that using a coarse grid with an explicit method for, say, the advection equation leads to an unstable solution. The trouble is Mathematica avoids unstable solutions with good ...
3
votes
1answer
288 views

Evaluating function only when its optional argument is numeric

I want to have the argument 'a' for myf2 in form of optional argument, but at the same time I need to evaluate the function only if 'a' is Numeric, see also my previous question. ...
2
votes
1answer
343 views

Crank-Nicolson with NDSolve?

As far as I understand, the Crank-Nicolson method (a.k.a. trapezoidal method) can be expressed as a second order implicit Runge-Kutta method. It's Butcher tableau is: ...