Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

7
votes
0answers
279 views

NDSolve::ndcf: Repeated convergence test failure. How to solve?

I am trying to simulate a system of $n$ pendulums with some friction in Mathematica 9. This is the code I am using: ...
2
votes
1answer
59 views

Differentiating a function that has NIntegrate within it

I am something of a novice with Mathematica. I have written the following code; ...
0
votes
0answers
57 views

How to solve initial value problem using Runge-Kutta method? [duplicate]

How to solve the following initial value problem using Runge-Kutta method u''[x] + (2/x) u'[x] + E^(u[x]) == 0, u[0] == 0, u'[0] == 0
2
votes
1answer
126 views

Integrate message: can't prove Integration limits are real

I'm working on solving differential equations through Fourier series, I made a function to help me calculate the coefficients that looks like this: ...
0
votes
1answer
161 views

How to improve the performance of this code

I have implemented a code in Mathematica 9 to simulate a scattering problem, and I got really disappointed about its performance when compared to Matlab. Since I am a newbie in Mathematica, would ...
1
vote
0answers
200 views

Differential equations: How do I solve a delay differential equation with 0-1 variables

How do I solve the following non-linear, delay-differential equations using Mathematica under the assumptions $$p(t) = 1 ,\; y(t) > k$$ $$p(t) = 0,\; y(t)<= \ k$$. $$ \frac{dw}{dt} = ...
1
vote
1answer
93 views

Numerical integration of Hankel functions

I would like to know how to perform numeric integration for the following type of integrals in Mathematica. For the following integrand, we can not get the symbolic result. ...
0
votes
0answers
71 views

Error Interpretation with NIntegrate, max. possible accuracy/precision

I guess the right question to this is: Which method is used at NIntegrate with Mathematica 8 as default and which is used with Mathematica 9 as default? ...
1
vote
0answers
42 views

ParametricNDSolve and ProcessEquations

I have a question regarding NDSolve`ProcessEquations and ParametricNDSolve. When using the regular NDSolve we have the option to divide the integration into the three steps ProcessEquations, Iterate ...
5
votes
1answer
156 views

Integration of Two Manipulatable Cylinders

Introduction I created the following code to simulate the many possible interactions between a cylindrical protein crystal and a x-ray beam during serial femtosecond crystallography. ...
0
votes
1answer
120 views

Fitting a Function With a Numerical Integral [duplicate]

I am having trouble using FindFit with the following function. ...
0
votes
1answer
81 views
2
votes
2answers
176 views
6
votes
2answers
324 views

NDSolve Plotting issue

I am trying to solve a system of ODEs with one extra boundary condition. ...
1
vote
1answer
106 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, ...
4
votes
0answers
232 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 ...
1
vote
1answer
62 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 ...
0
votes
1answer
78 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 ...
7
votes
1answer
392 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) ...
0
votes
0answers
62 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 ...
1
vote
0answers
69 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: ...
1
vote
1answer
137 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
104 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
85 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
87 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
65 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 ...
6
votes
0answers
67 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
77 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 ...
1
vote
3answers
161 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 ...
0
votes
1answer
149 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 ...
2
votes
1answer
314 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 ...
0
votes
1answer
122 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
129 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
244 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 ...
2
votes
1answer
300 views

Getting MemoryAllocationFailure from NIntegrate

When numerically calculating a double integral using NIntegrate over an infinite domain (with all options at their default), Mathematica 7 calculates my integral ...
0
votes
0answers
125 views
12
votes
1answer
609 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 $$ $$ ...
0
votes
0answers
67 views
1
vote
1answer
117 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
1answer
549 views
0
votes
0answers
60 views

Is mathematica able to count all results?

I have N variables, say $V_1, V_2, ..., V_n$. and I have several logical conditions like $[(V_1 > V_2) \cap (V_2 + V_3 > V_1) \cap (V_1*V_1 > 2*V_2)] \cup [..]$ You can consider they are in ...
2
votes
1answer
262 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: ...
1
vote
0answers
145 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
127 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
163 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, ...
4
votes
2answers
655 views

How to Solve this ODE with Mixed Boundary condition

I have an ODE equation which is sort of y''[x] + 2 y'[x]/x + .0001 (y[x])^3 ==0 subject to the boundary conditions ...
2
votes
1answer
351 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
80 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. ...