Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.
2
votes
2answers
61 views
2
votes
0answers
31 views
NIntegrate/NSum with parameters [duplicate]
I'm trying to calculate a continuous integral within a discrete integral.
Something similar to this (yet more complex):
...
0
votes
1answer
102 views
DAE - varying initial conditions
I want to solve a DAE-system and I want to vary more than one initial conditions and to manipulate them. I looked here:
Putting NDSolve into ParametricPlot
But it does not work:
...
4
votes
2answers
102 views
0
votes
1answer
67 views
0
votes
0answers
60 views
7
votes
0answers
128 views
Numerically solve 2nd order differential equation with singularity
Consider a second order differential equation with a potential that diverges at some generic value in the variable. For example:
$$-y^{\prime\prime}(s)+\frac1{\mathrm{cn}{(s\mid k^2)}}y(s)=0$$
where ...
27
votes
1answer
429 views
10
votes
1answer
212 views
Why can't I change the value of MaxRecursion in NIntegrate when integrating BesselJ?
I am trying to evaluate this integral numerically
$$
\int_0^{\infty } J_0(q R) \tanh(q) \, \mathrm{d}q
$$
for large values of $R$. This makes the integrand oscillate more quickly and Mathematica ...
1
vote
1answer
166 views
Why is arithmetic faster for inexact arithmetic?
I have been trying to compute eigenvalues of a rather sizable matrix A, about $500 \times 500$ (but sparse). I asked Mathematica to compute ...
1
vote
1answer
92 views
why there is a small imaginary part [closed]
I encountered a problem. I have a eigenvector eigvsI[1]
...
4
votes
1answer
73 views
Minimize failing on a polynomial
Calling:
Minimize[{-0.4877 - 0.1190 r^2 - 0.1885 r^4 + 2.9703 z - 0.5531 z^2,
0 <= z <= 3.5 ∧ 0 <= r <= 1.75}, {r, z}]
returns ...
1
vote
0answers
111 views
Adapting NDSolve to circumvent NDSolve::bdord: error for 1-D Euler Equations
I attempted to use NDSolve for the 1-D isentropic unsteady flow equations with low subsonic inflow velocity and prescribed inflow total enthalpy; along with a ...
3
votes
0answers
112 views
FindRoot gives a wrong solution which obviously should not be there
I got stuck on FindRoot and I didn't see any similar problem posted, so let me explain what I am trying to do and what problem I meet here.
I try to find roots of a particular function, which in the ...
0
votes
0answers
40 views
How to force evaluation/numerical result of a function? [closed]
I defined a function m[x] using
...
4
votes
1answer
158 views
NDSolve for a large system of simple ODEs
I am solving a system of many (more than 100) ODEs.
It is the kind of standard rate equation encountered in semiconductor physics.
Here is the system:
...
-1
votes
0answers
52 views
Why is NonlinearModelFit calling the model function with symbolic arguments?
I have a model to fit which is made of numerical functions and so it can give a value for any numerical value of the arguments, but creates an error when called with symbols. ...
13
votes
1answer
260 views
Optimizing a Numerical Laplace Equation Solver
Laplace's Equation is an equation on a scalar in which, given the value of the scalar on the boundaries (the boundary conditions), one can determine the value of the scalar at any point in the region ...
1
vote
1answer
60 views
Plot FindRoot for non-trivial function
I would like to plot the results of FindRoot over certain range of inputs. I tried to do this with the code:
...
3
votes
1answer
73 views
Find point at which equation stops having roots (if it exists)
I am interested in the roots of this function:
f[M_, b_] := 1 - (2 M Gamma[2, 0, (1/M + b M)/Sqrt[b]])/(1/M + b M)
for fixed values of b. In particular I want ...
1
vote
2answers
122 views
How can I use FindRoot on an expression from NDSolve?
I have a second order ODE that I can only solve numerically using NDSolve, but I then need to use the solution in FindRoot and am running into errors. A simplified but analogous problem is the ...
0
votes
0answers
59 views
FindMaximum inconsistency
The code below seems to work for n<11. But for n=11, and above, it outputs newa then just outputs "beep" sound.
WhyTheBeep says "The kernel Local has quit ...
0
votes
1answer
79 views
How to guess initial complex value for FindRoot
I have to solve a transcendental equation for a parameter, say $\beta$. Now, the $\beta$ has a range from $ik$ to $k$ where $i$ is the usual imaginary root $\sqrt{-1}$ and $k$ is a real number. ...
3
votes
1answer
170 views
Tutorial for basic numerical methods for PDEs
I'm afraid this is probably not going to be a "good" question, but I'd like to use Mathematica to learn about basic numerical schemes for solving pdes. For example, I'd like to compute the solution of ...
1
vote
0answers
61 views
Using Root for numerical evaluation [closed]
In my expressions I have a lot of roots to calculate. For example:
Root[#1^3 + #1^2 + #1 &, 1]
Since most of them cannot be solved analytically, I would like ...
0
votes
0answers
253 views
Jacobi eigenvalue and eigenvectors algorithm
Suppose we have a symmetric matrix with dimensions n x n. I need to find the eigenvalues and eigenvectors of this matrix using the Jacobi method. I wrote this code:
...
0
votes
0answers
84 views
Speeding up numerical computations
So, after seeing this and this post, I was thinking whether there were any general rules for speeding up numerical computations (not only NIntegrate or ...
2
votes
1answer
70 views
Numerical Error with Large Matrices
I am writing a Finite Element Analysis program in Mathematica. The code involves handling a large matrix with large entries. I get an error when I try to use Mathematica's "LinearSolve" to solve a ...
-1
votes
1answer
121 views
Minimization problem using FindMinimum. Functional value “is not a real number”? [closed]
This question is a follow-up of another one I asked a few days ago. I followed the instructions given in the answer provided by the user that responded. I modified that answer to solve another ...
3
votes
2answers
134 views
6
votes
2answers
207 views
Numerical partial derivative
For a one-variable numerical function it's simple to calculate the derivative at a point with Derivative as @Szabolcs has pointed out before:
...
3
votes
1answer
97 views
Strange behaviour of PolyLog Function
I discovered some strange behaviour of the PolyLog[] Function in Mathematica which seems to me like a bug in the function implementation.
It looks like ...
0
votes
1answer
76 views
What is the correct way to use NIntegrate inside the FindMinimum function?
I'm having minor issues with the FindMinimum function when using NIntegrate inside. The functions work perfectly well but I get ...
2
votes
3answers
123 views
How can I name “a[[i]]” the parts of Table “a”? Or how to make Table “a” grow inside FindMinimum?
Let's say I want to minimize a function that uses a Table named a with the Conjugate Gradient Method of ...
14
votes
4answers
267 views
How to remove duplicates from set of machine precision 2D points?
I have a set of 2D points with machine precision coordinates. I need to remove all duplicates. Performance is important.
This is the most obvious fast solution:
...
1
vote
1answer
97 views
What do these error messages mean when numerically solving differential equations?
I am using Mathematica to numercially solve the following equations:
...
4
votes
1answer
169 views
NDSolve does not respond
For some sets of constants, NDSolve gives me true solutions, but when I try for example, T = 1/(2*2200), Mathematica does not respond. What can I do? The code below ...
0
votes
1answer
87 views
Alleviating a bottleneck involving a function call with symbolic derivatives
I have a bottleneck problem involving a function call with symbolic derivatives.
I don't have much experience with Mathematica (or any dynamic language) and I'm certain that the way I've set this up ...
2
votes
1answer
94 views
Mathematica 7: Problems when evaluating Fourier inside a ParallelTable
after I got such a great response for my first question on this site, I'm very encouraged to asked my second one!
So here it is, very generally: To speed up a "row-wise" (i.e. 1D) operation on a ...
6
votes
0answers
67 views
Mathematica 7: “LessEqual::nord:” error when using NMinimize on a real function
I encounter a problem (Mathematica 7) similar to Strategies to avoid LessEqual::nord in NMinimize? but the advised strategies don't work for me. Also, I get different results with different ...
1
vote
1answer
46 views
Can't see updating performed by NMinimize[…,StepMonitor->(…)] outside of Button in which it's called [duplicate]
I've made a peak-fitting GUI in which I have a "Fit" button that, when pressed, calls NMinimize[...,StepMonitor->(step++)] to minimize a sum of squared ...
2
votes
2answers
171 views
Weird NDSolve behavior with Piecewise (MMA9)
NDSolve in Mathematica 9.0.0 (MacOS) is behaving strangely with a piecewise right hand side. The following code (a simplified version of my real problem):
...
1
vote
0answers
72 views
Why is FindRoot initial value far from the specified one?
I am trying to numerically find the root of a function that looks a bit like: 1/x - (SchurDecomposition[A[x]][[2]])[[1]], where ...
1
vote
2answers
276 views
Running a Numerical Simulation on a System of Differential Equations with unique initial conditions
I have a system of differential equations as follows:
...
2
votes
0answers
137 views
Minimization in mathematica [closed]
I have recently had a strange problem with NMinimize. I have a very huge function with respect to 20 parameters. When I ...
11
votes
1answer
407 views
2D Heat equation: inconsistent boundary and initial conditions
I'm attempting to use NDSolve on a 2D boundary value problem with initial conditions. Upon running my code, I get the following message:
"NDSolve::ibcinc: Warning: Boundary and initial conditions are ...
3
votes
0answers
177 views
A is fast, B is fast, but together they're Mathematica-crashing slow?
I'm trying to do something with finding solutions to a quantum mechanics problem with n wells. If there are 40 wells, I need to find the solution to an equation in the form:
...
8
votes
4answers
221 views
Numerical integration of a numeric data available as a nested list
I have some numerical data in the form of a list with the following structure: {...{x,y,z},...} defining a surface z=z(x,y) in a 3D space (x,y,z). The data came from a simulation, and I am ...
0
votes
1answer
77 views
How could we define a function recursively?
Let us first consider the constructon of the following simple iteration
...
2
votes
1answer
151 views
How to solve equations self-consistently
I want to solve the following equation self-consistently. So,
H.u = e.u
{{1, d}, {d, 1}}.{u1, u2} = e.{u1, u2}
I guess an initial value for ...




