Questions on the use of numerical functions NIntegrate and NDSolve.
3
votes
2answers
246 views
How to avoid this kind of numerical error caused by extreme parameters when using NDSolve?
Here I use a one-dimensional heat conduction equation as the example. I found that when the thermal diffusion coefficient is small enough, Mathematica will give a result against the second law of ...
1
vote
1answer
138 views
How to collect q[t] from the following integration
As shown in the following program, the q[t] in a can be collected from the integration by defining the integration of ...
4
votes
2answers
625 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, ...
5
votes
1answer
182 views
The difference between “SymbolicProcessing” -> 0 and restricting the function definition to numeric values only
The Documentation tells us that there are two ways to disable symbolic processing of the integrand by the NIntegrate function when it is known that it just slows ...
0
votes
2answers
204 views
Plotting multivariable integration
If I have a multivariable integration like
NIntegrate[x^2 + y^2, {x, 1, 5}, {y, 6, 10}]
But I need to plot its result in terms of ...
7
votes
0answers
1k views
Integro-differential equation
I have to numerically solve a nonlinear partial integro-differential equation using Mathematica. This is my equation,
$$\frac{\partial y(x,t)}{\partial t}=\int_{-\infty}^\infty K_0(|x-u|) ...
9
votes
1answer
467 views
I failed to solve a set of one-dimension fluid mechanics PDEs with NDSolve
@DNA
The fluid here has been assumed as single component perfect gas i.e. it obeys the equation P=ρRT, the thermal conductivity is assumed as a constant, so the equation is:
...
5
votes
1answer
178 views
Multiple simultaneous events in EventLocator method for NDSolve
I'm using NDSolve to integrate a system of ODEs, and EventLocator to stop the integration when it leaves a certain region in phase space. This works perfectly as it should.
However, I've also added ...
4
votes
1answer
155 views
Could the PrecisionGoal for NDSolve be a negative number?
The help of Mathematica doesn't say so much about the PrecisionGoal for NDSolve, and I never considered much about it even after ...
6
votes
2answers
234 views
How to work out the parameter in a definite integration which has an exact value while the integration doesn't have an analytical solution?
Here is the equation I'm trying to solve:
NIntegrate[1/(E^(1/(λ T)) - 1), {λ, 200, 220}] == 1000
T is the parameter I'm ...
4
votes
2answers
276 views
How to set the initial condition? (to make IC and BC consistent)
I want to find the initial condition which fits mixed boundary condition of Phi[r, Theta, t].
The original initial condition in text is
Phi[r, Theta, 0] == 1
. ...
2
votes
1answer
599 views
How do I prevent NIntegrate::inumr errors within other functions?
I believe this question is best illustrated with a simple example. If I run
FunctionInterpolation[NIntegrate[a + b, {a, 0, 1}], {b, 0, 1}]
I get errors of the ...
2
votes
1answer
219 views
I ran into an error when I was trying to solve a PDE with a piecewise initial condition by NDSolve
This is a very simple one-dimensional heat-conduct equation, the only special part of it is the piecewise initial condition:
...
6
votes
0answers
218 views
Optimizing NIntegrate for higher PrecisionGoal
By default, NIntegrate works with MachinePrecision and its PrecisionGoal is set to ...
3
votes
1answer
478 views
Methods to speed up numerical NDSolve, NIntegrate,
I am not very used to do numerical simulations on Mathematica. Do you have any ideas how to improve i.e. speed up my code?
...
5
votes
3answers
420 views
How to use results of NDsolve[] for further solving of ODEs?
I have a system of ODEs with 10 eqns. I can solve the first 5 independently. How can I use those results to solve for the remaining 5?
An easy example would be
$\dot{x}=f(x), \quad
\dot{y}=g(x,y)$
...
1
vote
1answer
150 views
Problem with Eventlocator Method for NDSolve
I want to solve the ode and plot the solution v[x] for different values of parameter a where ...
9
votes
1answer
391 views
How to tell mathematica not to resolve stiffness issues
Very often I solve partial differential equations that are nonlinear and could be up to 4th order. In these cases, it is usual for the solution determined by ...
4
votes
1answer
196 views
Error Interpretation in NIntegrate
I am using a recursion algorithm developed by Migdal for Lattice Field Theory, and I have the following code:
...
3
votes
2answers
457 views
optimization problem with NDSolve
I want to minimize the function fcc. When fcc is calculated for a specified point the answer is correct:
...
3
votes
1answer
285 views
Optimizing a function involving NDSolve results in error messages
I want to minimize a function f with NMinimize but an error occurs that says:
...
1
vote
2answers
288 views
Numerical Integration in Laplace domain
I need to calculate two different integrals containing a Bessel function in the Laplace domain. I have tried different kinds of quadrature but didn't have any luck. I don’t know how to help ...
8
votes
1answer
385 views
Is it possible to set a variable as a positive one in the whole notebook?
I'm having issues during integration due to the fact that Mathematica doesn't know if an undefined variable is positive or not (it gives me complexes which bothers me in the end).
For example I do ...
0
votes
1answer
92 views
NIntegrate failling on floating value
I'm trying to take the following integral
NIntegrate[
((Sin[Q 1]-Q 1*Cos[Q 1])/(Q 1)^3)^2
* S[Q,0.4,2]
* Q BesselJ[0,0.5Q]
, {Q,0,Infinity}]
...
3
votes
3answers
617 views
Retrieve values of InterpolatingFunction
While analyzing a large system of ODE's, I defined a particular ratio p, which contains some variables that are represented by ...
5
votes
1answer
459 views
Incorrect solution of diffusion equation with Neumann boundary conditions
I want to set up a PDE model, which takes a two-dimensional diffusion equation into account. The key problem is that I have some trouble in solving the two-dimensional diffusion equation numerically. ...
14
votes
1answer
214 views
Why does LogLinearPlot sample its argument outside the specified domain?
I experience a weird bug in the function LogLinearPlot. If the input is an interpolation function, such as the one created like this,
...
2
votes
1answer
145 views
how to nest parallelized computations on a cluster?
I am lucky to have access to a computational cluster and I could submit my job to many-many cores. As I need to evaluate a numerical integral within a numerical integral, I would like to know if I can ...
0
votes
2answers
240 views
NDSolve and results of the previous computations
I want to solve following system of ODEs:
$
\Bigg\{
\begin{array}{}
\frac{\partial C}{\partial t}=\frac{2W_b}{Rsin(\theta)}(1-\frac{C}{\gamma})+\frac{\nu}{\pi R^2}\frac{\partial C}{\partial Z}
...
0
votes
2answers
434 views
nested numerical integration: not valid limits?
I encountered an error when I was hoping for some Mathematica (8.0.4) magic sparing me to code up numerical integration, function approximation and root-finding myself. The broader context and the ...
3
votes
0answers
410 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
...
4
votes
2answers
642 views
Is it possible to compute trapezoidal rule numerical integration?
Is it possible to compute trapezoidal rule numerical integration? I know that Mathematica has Interpolation, and that a list of points can be interpolated and then ...
7
votes
2answers
274 views
Starting NDSolve from intermediate time step?
I always wondered if I could start NDSolve from an intermediate time step.
What I mean is, in the code sample below, if I were to run my solution from tmin=0 to ...
3
votes
1answer
321 views
How to use NDSolve to track a deviation from equilibrium?
i have a task to find a event, to achieve this i think need to integrate until a constant function suddenly breaks the equilibrium and give a sharp peak.
I think that EventLocator should work, thus ...
5
votes
2answers
232 views
How to find Matano plane
I have discrete collection of data points (10 to 10^4). I want to describe them by a continuous function and find a x value z, ...
13
votes
3answers
1k views
Solving a Volterra integral equation numerically
I would like to solve for $P(t)$, in Mathematica, a Volterra integral equation of the 2nd kind.
It is:
$$P(t) = R_0(t) + \int_0^t P(t') R_0(t-t')dt'$$
I know the function $R_0$ and would ...
4
votes
1answer
250 views
Solving an ODE numerically
I really appreciate it if anyone helps me with this:
How can I solve this ODE and plot the answer for $x$ on $[0.6,5]$:
$$
\begin{align*}
-2xy'[x] = y''[x]+ 47.21 (-.0025 x^6 & + ...
6
votes
1answer
210 views
Getting Integrate to perform numerical integration
I am trying to calculate the mutual impedance of two antennas which is just a big integral. I defined my function in terms of my variable, but when I execute it, Mathematica runs for a while and then ...
4
votes
0answers
399 views
Controlling the time step in NDSolve?
I generally use NDSolve for stiff non linear partial differential equations of 4th order. I find that a BDF1 method generally does well to placate my beast of a PDE.
I've also tried out ...
1
vote
1answer
153 views
NIntegrate is resetting my variables and not giving me a result?
I am trying to check if mass conservation holds by integrating the area under a curve but to no avail.
...
7
votes
1answer
189 views
What does MaxStepFraction do?
I find that with NDSolve[...] while solving a partial differential equation, changing the MaxStepFraction from ...
7
votes
1answer
229 views
Setting the DifferenceOrder Option
I've been playing around with Method in NDSolve[...] and can't quite seem to figure out how to force ...
5
votes
1answer
703 views
NDSolve, Schrödinger equation, and decaying solution
I am trying to solve a Schrödinger equation for a particle hitting a step potential using NDSolve in Mathematica. Here is my code:
...
6
votes
2answers
424 views
How to set the NDSolve method to LSODA
I notice that off all the Method options available for NDSolve[...], LSODA is invoked quite ...
18
votes
1answer
421 views
Publishing results obtained in Mathematica
I've been using Mathematica to solve nonlinear partial differential equations for my doctoral research for the last 2 years or so. I am not an expert in Mathematica or mathematics and I am an engineer ...
16
votes
2answers
493 views
11
votes
1answer
262 views
Boosting the performance of expensive NIntegrate by feeding in a cheap approximation of the integrand
I need to integrate an expensive likelihood L[x] over its n-dimensional domain.
I know that L[x] is decently approximated by a ...
12
votes
3answers
426 views
NIntegrating within an Ellipsoid
I need to numerically integrate an expensive positive-definite function over a 2D domain. I know by other ways that the function is basically zero for values outside the following ellipse:
...
0
votes
1answer
362 views
NDSolve does not give me the expected solution
I have an assignment where I need to compute chemical reactions by solving ODEs. I use NDSolve to do this. However, for one problem it does not give me the ...
3
votes
1answer
399 views
NDSolve Problem
I am trying to solve a chemical equilibrium ODE with NDSolve where one function is the argument to another.
I.E. My equations look like:
...
