Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

11
votes
3answers
3k views

Solving a time-dependent Schroedinger equation

I want to solve the time-dependent Schroedinger equation: $$ i\partial_t \psi(t) = H(t)\psi(t) $$ for matrix, time-dependent $H(t)$ and vector $\psi$. What is an efficient way of doing this so ...
0
votes
1answer
48 views
2
votes
1answer
103 views

How to use slots and patterns to reduce repetitive calculation?

This is kind of complicated... How can we make MMa calculate values of a function before doing multiple pattern or slot substitutions? Answers to similar questions didn't cover the case where the ...
1
vote
2answers
54 views

Incomplete Integration in Area

Area[2 Sqrt[(1 - p^2)^2 - r^2], {p, 0, 1}, {r, 0, 1 - p^2}] is able to perform only the integral over r, leaving the integral ...
0
votes
1answer
33 views

NIntegrate with units: unable to determine the units of quanitites that appear in the input

I want to integrate Planck's law of radiation in a certain wavelength intervall with units. I define some constants: ...
1
vote
1answer
61 views

Summand is not numerical at some point

I am trying to do some numerical integration with the following codes: ...
2
votes
1answer
85 views

Calculate the relationship between the duration of two oscillating functions

I am trying to quantitatively determine the relationship between the length of two oscillating functions. Meaning, what is the duration of the green spike in relation to the blue square? Does anyone ...
4
votes
1answer
228 views

Understanding of method for NDSolve

I used automatic method for NDSolve. Then I asked myself - which method Mathemathica prefered? I got an answer for this question on this forum, that I need to use: ...
9
votes
1answer
165 views

Is this a bug in NIntegrate?

Bug is present as of version 10.0.2 checked on windows 7, 64 bit Is this a bug or I missed something? NIntegrate seems to give a different answer for the same ...
1
vote
0answers
45 views

Numerical integration with symbolic coefficients

Thanks to Michael and its reply here I managed to deal with some of the more complicated integrals. But still there are some even more complicated ones. Let give a specific example. ...
2
votes
2answers
63 views

FindFit working with Integrate but not NIntegrate - I am using “?NumericQ”

I'm having some syntax problems with finding a fit to an equation that doesn't have an analytical expression for it's integral. Because I think the problem is one of syntax, I am substituting a ...
1
vote
1answer
50 views

numerical integration question

The actual expressions is quite complicated so I will use a trivial example. Let In[36]:= f[u_] := 1/3 - (5/18)*(Cos[u]*a[1] + Sin[u]*b[1])^2 Then ...
0
votes
0answers
32 views

Order of evaluation when using Solve and Minimize

I have to solve numerically an integral, that ends up being more or less as follows: Solve[f[x]==a*Sum[Sin[x-i]*(f[i]-f[i-1]),{i,1,x}],f[x]] (not actual ...
-3
votes
1answer
97 views

Integration with mathematica? [closed]

I am very new to Mathematica. I am trying to evaluate ∫ (1+lnx)Sqrt(1+(xlnx)^2) using Mathematica. I know a substitution must be done so I have set ...
-1
votes
0answers
33 views

Mathematica integrations? [duplicate]

New mathematica user here, when integrating (1+lnx)Sqrt(1+(xlnx)^2), when plugging the u and du values into the integral, how should it look exactly? Cheers, -Josh
1
vote
1answer
19 views

NIntegrate is it possible to evaluate the integral using a user-defined grid?

I am using the NIntegrate function and I would like Mathematica to perform the integration in accordance with a grid I define that is sampled uniformly between the boundaries of integration. Let me ...
0
votes
1answer
40 views
8
votes
1answer
455 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
53 views

NIntegrate and Interval regions

NIntegrate does not seem to like Intervals as regions. Consider the following example function defined for a parameter "a" ...
4
votes
1answer
172 views

How to solve this Integral equation

D[x[t] - x[t - 1]/(2 E), {t, 3}] + Integrate[E^(-δ)*x[t - δ]/5^t, {δ, 2, 2.5}] == 0 I found solve this problem is hard with Mathematica. I also find a article ...
0
votes
1answer
69 views
1
vote
2answers
68 views
3
votes
1answer
70 views

List interpolation

Hi mathematica people! So i am looking for the best way to interpolate a function given a list of its values. I have an iterative algorithm which needs high precision otherwise the numerical noise is ...
2
votes
0answers
108 views

Volterra integral equation

I have to find an approximate numerical solution for the equation $$ F(x) - \lambda \int\limits_1^{x} \text{d}s \;s^2 F(s) Z(x-s) = G(x) $$ $$Z(s) = (\psi''(1-2\ h\ i\ s)- 0.5 \psi''(1-2\ h\ i\ s))$$ ...
5
votes
2answers
3k views

How to handle NDSolve::ndsz problem (singularity problem)

I have 2 second order differential equations (non-linear). The physics behind them is correct. I verified the equations many times. It is a solid pendulum with a mass-spring at the end of it. Now, ...
4
votes
2answers
114 views

How to plot a function that is not defined after certain point

I'm plotting a function that I get after numerically integrating over another function. Something like: f[x_,y_]:=NIntegrate[g[x,y,z],{z,0,1}] I know that above ...
0
votes
3answers
323 views

Solving an Integral Numerically

I have been trying to solve the integral equation below, but cant seem to find a way out of this. Can someone please help me out with suggestion? $f(t)=\int_0^{\infty}\frac{K_1a(t)}{a(t)+K_2}\,dt$ ...
1
vote
1answer
60 views

First::normal: Nonatomic expression expected at position 1 in First[0]. >>

I'm trying to do a numerical integration. The integration is within a function. ...
2
votes
1answer
117 views

Catastrophic loss of precision

while I am trying to solve the double integral in the range of 0 to Infinity (for both the integral) it give me the error Catastrophic loss of precision in the global error estimate due to ...
5
votes
2answers
298 views

Numerical Integration with InverseErfc

I am trying to numerically integrate an equation that involves InverseErfc (embedded in the copula defined). The equation looks like the following: $$ \int_0^T \int_0^\infty \int_0^\infty ...
1
vote
0answers
85 views

Is there any way to solve this convex-concave like optimization problem?

This is a bit of a non-standard way of asking a question perhaps but I couldnt even think of writing any code about the following optimization problem. I wonder if it could be at all solvable and if ...
0
votes
0answers
28 views

Real or Imaginary result of spherical bessel and hankel functions of imaginary arguments

I am trying to calculate a rather complicate expression involving Spherical Bessel and Hankel functions. My problem is that somehow for pure imaginary arguments the functions are not pure real or ...
3
votes
1answer
76 views

How to evaluate differential entropy from raw data?

I want to evaluate the differential entropy according to here $$h(X) = - \int f(x) \log{f(x)} dx$$ where $f$ is the probability density function. Lets create some test data (normal distribution): ...
4
votes
2answers
238 views

Approximate value for the area between the curve

I've got this task: Use Mathematica to obtain an approximate value for the area between the curve $y=1/4$ and the x-axis over the interval $[1,2]$ with $50$ subintervals using the left ...
1
vote
0answers
44 views

Is it possible to pipe the output of EvaluationMonitor to Excel?

I have an EvaluationMonitor setup to capture the points processed by NIntegrate. This is a case where the same function, integrated over the same region in cartesian coordinates yields a dramatically ...
0
votes
1answer
39 views

Different results for NIntegrate for the same function using cartesian and polar coordinates

This is probably a straightforward question. I have two functions f[x_,y_,z_] and g[r_, theta_, z_] where: g[r_, theta_, z_] returns f[ r Cos[theta], r Sin[theta], z]. For the same points in ...
2
votes
1answer
70 views

Evaluate function defined by DifferentialRoot

I have the following sequence of rationals that I want to find the generating function of: ...
3
votes
1answer
170 views

Combining Gravity Turn and Orbit Models

I have a mathematical model for the motion of an orbiting spacecraft about Earth: ...
1
vote
1answer
53 views

Increase Precision in Numerical Integration

I need to generate a table of Chebyshev expansion coefficients of trigonometric functions (in this case Cos[2 Pi t] to very high accuracy. Code is: ...
3
votes
1answer
179 views

How to numerically integrate this integral

I am unable to do this definite integral in Mathematica 9. Is there any command so that I can get the numerical value of the above integration? Code: ...
0
votes
0answers
76 views

“General” strategy to use NIntegrate for multidimension integrals?

I don't have much experience of numerical methods for multidimensional integrals. Currently, the particular function I want to integrate is: $$f(x,y,z,p_x,p_y,p_z) = \frac{p_x^2(2 p_x x(p_y y + 4 p_z ...
5
votes
2answers
95 views

How to add (energy) constraint when using NDSolve to Equation of Motion

To simplify my problem, I will try and solve the Equation of Motion for a particle in a 1D Harmonic Potential. energy[x_, p_, m_, ω_] := p^2/(2 m) + (m ω^2)/2 x^2 ...
-1
votes
1answer
34 views

Numerical integration of modified bessel function

I try to numerically compute this integral but I receive many errors and I end up getting unreasonable answers, I know that there's a closed form answer but I have to compute it numerically. Would ...
3
votes
1answer
300 views

A Bessel & Struve functions related integral

I try to numerically compute this integral and I don't figure out why on earth Mathematica is not able to do it. Is my input correct? Does it possibly have a closed form? ...
0
votes
0answers
68 views

Solving an ODE, where the coefficients are implicit functions of time, not in closed form [duplicate]

I have an ODE, say of the first order for simplicity, and of the form, $A.x'[t] =B$. The coefficients are functions of time and x[t], not in closed form. I can define the coefficients, $A$ and $B$, ...
0
votes
0answers
75 views

Unequal behaviour of FindRoot to two similar functions

Unfortunately, I have some difficulties to plot a function. Here is my code: ...
0
votes
1answer
51 views

Multidimensional NIntegrate problem of the function decaying as 1/x^2

The function I am trying to integrate is more complicated but I can simply write the function as (I had made a typo error, sorry. The '+' sign in front of the r should be '-'): $f(\omega ) = \int ...
4
votes
1answer
102 views

Using `N` gives strange result

Consider these two functions which are almost the same: ...
1
vote
0answers
37 views

Using real numbers gives suspicious result

In the code below when I use a real number for number 4 in the exponent in the irf function, it returns wrong result. ...