Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.
6
votes
2answers
209 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:
...
4
votes
1answer
160 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:
...
17
votes
0answers
617 views
Identifying critical points of 2/3D image/cubes
Upshot
I am interested in identifying critical points of a 3D field/cubes (maxima, minima, tube-like and wall-like saddle points) and 2D field/image (maxima, minima, saddle points). I.e. the ...
15
votes
0answers
352 views
Fast Spherical Harmonics radiative transfer
This is a rather specific question and I apologize for spamming you with some lengthy code. But it could be interesting for some reader and maybe you can help out, so please bear with me.
I am using ...
7
votes
0answers
132 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 ...
7
votes
0answers
278 views
Dual complex integral over implicit path using contour plot
Context
I am interested in doing double contour integral over paths which are defined implicitely.
For the sake of debugging, let's assume its
$$\oint_{\cal C}\oint_{\cal C} \frac{1}{u\, x} d u d x$$ ...
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 ...
3
votes
0answers
113 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 ...
3
votes
0answers
178 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:
...
3
votes
0answers
256 views
How can I solve this complicated custom function numerically?
I have a complicated function that calculates the total value of payments from an account into which deposits are made annually. I'd like to solve the function for a growth rate numerically, but ...
3
votes
0answers
225 views
Numerically solving PDE with high precision
I want to numerically solve the PDE
$\partial_t u(t,x)=c\partial_x u(t,x)+(mx-l)u(t,x)$
with some initial and boundary conditions and given parameters $c$, $m$ and $l$.
Consider the code
...
3
votes
0answers
122 views
LeastSquare Solution for the Continuous Time Lyapunov Equation
I have been working with a problem which involves solving the continuous time Lyapunov equation
$$A R + R A^\top = G$$
for the symmetric positive definite matrix $R$. Here $A$ is real, invertible ...
3
votes
0answers
159 views
Semidefinite Programming
I want to solve a numerical optimization problem using semi-definite programming. Is there a package or add-on that equips mathematica with this functionality?
2
votes
0answers
173 views
Numerically/Analytically Solving a System of Equations
I have $6$ functions $f_i(x,y,z)$, $(i = 1, \ldots, 6)$ in three variables $x,y,z$, and I would like to find a simultaneous instance of these variables, say $(x_0, y_0, z_0)$, such that $f_i(x_0, y_0, ...
2
votes
0answers
115 views
Why to do parentheses change the results of a calculation?
I'm getting results that are sensitive to where I place parentheses with respect to operations that are associative1 (and should thus be insensitive to such placement). For example, if I define2
...
1
vote
0answers
113 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 ...
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
0answers
148 views
NDSolve error when solving a BVP
I'm trying to solve the following BVP with unknown parameters (p and phi) using NDSolve over the period {Pi, 2 Pi}:
...
1
vote
0answers
130 views
Parallel linear algebra with arbitrary precision
Is it possible to do parallel linear algebra with arbitrary precision within Mathematica (in a simple manner, as is done for the machine precision)?
0
votes
0answers
61 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
0answers
285 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 ...
0
votes
0answers
147 views
Boundary Value Problem
I have to solve this boundary value problem:
$$\frac{\mathrm{d}e_{3x}}{\mathrm{d}l}=(M_0+F_{0z}x-F_{0x}z)e_{3z}$$
$$\frac{\mathrm{d}e_{3z}}{\mathrm{d}l}=-(M_0+F_{0z}x-F_{0x}z)e_{3x}$$
...
0
votes
0answers
82 views
FindRoot is only passing two variables
When I run the code:
q0 = FindRoot[findarea[ch, rh, ah, lineh, intersecth, q][[1 ;; 2]] == ah[[1 ;; 2]]*r3^2,
{q, q0}][[1, 2]];
...
0
votes
0answers
72 views
Applying individual values (e.g. from a list) to the gain variable of a common PID
I am currently implementing more things into my model of a common kitchen / manufacturing scale and came up with the idea to assign different values to the gain variables of the PID controlling the ...
-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. ...
