Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.

learn more… | top users | synonyms (1)

3
votes
1answer
70 views

Define and refine mesh around a hole

I am solving Laplace equation with particular geometry and boundary conditions: ...
0
votes
1answer
73 views

Floating point arithmetic bug caused by Table[]

I was doing something fairly ordinary and noticed something I can't, for the life of me, explain. For context, I wanted to take make a function that takes an array of data like the one below, then an ...
3
votes
2answers
135 views

NDSolve in Mathematica won't use all the cores avaiable

When I solve a system of differential equations in Matlab, the task manager shows that all the CPU cores are in use. This is not true when I solve the same system in Mathematica. I have six cores. ...
0
votes
0answers
43 views

Any way of solving this system of nonlinear equations with non integer powers?

I have a system of four nonlinear equations. Some of the exponents are fractions. I was wondering if this is what is causing NSolve to run for hours without giving ...
0
votes
2answers
120 views

Spiral roots, how?

I found this picture on the net, as I can play in mathematica
1
vote
1answer
27 views

Implicit region is not “valid” in ParamatricNDSolveValue function?

I am trying to solve a geometric problem with relation to my Schrodinger equation and its boundaries. Here is my code: ...
1
vote
1answer
43 views

Determine whether one value is divisible by another [closed]

How do I determine whether one number is evenly divisible by another in the case of large numbers, for example: 52^52 / 52!
1
vote
1answer
59 views
1
vote
0answers
56 views

NIntegrate over a list of functions

This question is the result of these other two questions. Question 1 and 2. I thought it would be better to ask a new question rather than deleting previous one. I think When ...
0
votes
1answer
60 views

Numerical integration and plotting

New to Mathematica, and trying to numerically evaluate two integrals: ...
2
votes
2answers
149 views

Entropy of the elements of a general data set

I have the following data set, and wish to track the evolution of the entropy of each element within the set. I have evaluated the entropy for some elements, but how does one evaluate the entropy of ...
1
vote
1answer
96 views

Quantum Physics question [closed]

I'm not sure if anyone here would be able to help me. But if you know a more appropriate place where I could ask for help, please let me know. So here's the question: And here's my attempt at ...
1
vote
1answer
127 views

Slow evaluation of NIntegrate when used as a pure function

I asked a perhaps related question here. Here is my code in below. The goal is that to define a function which must be integrated numerically. The function itself first is calculated over different ...
4
votes
4answers
142 views

First digit difference between two numbers

I was trying to build a function that finds the first decimal place difference between two decimal numbers of same sign. An example: ...
0
votes
0answers
31 views

real eigenvalues, imaginary eigenvectors

Solving the most basic eigenvalue problem, the 1d Schrodinger equation in Mathematica can be tackled either through a ParametricNDSolveValue (which I don't like) or implementing a full numerical ...
2
votes
1answer
61 views

Fixed Points Problem with 2D Mapping

I have been playing with the mapping given by ...
0
votes
0answers
33 views

NDSolve dependence on initial values

I'm checking some results in this paper and I'm currently having some issues with a numerical integration of a set of differential equations using NDSolve (section 2 and 3.1-3.2 in the paper). I'll ...
3
votes
2answers
93 views

Finding solutions at non-differentiable points of a numerical function

Let's consider a 2D function we can evaluate numerically, but which is opaque to symbolic manipulation (this is just an example): ...
0
votes
1answer
47 views

Numerical integration of a three dimensional array

I need to integrate a scalar valued function $f\left(\boldsymbol{x}\right)$ where $\boldsymbol{x}$ is a three dimensional position vector; in other words: $\int_{\Omega} f\left(\boldsymbol{x}\right) ...
6
votes
1answer
197 views

How trustworthy is NMaximize?

Suppose I solve a constrained optimisation problem using NMaximize. How confident can I be of the accuracy of the result? For concreteness, suppose that F,G are ...
0
votes
1answer
72 views

How to obtain a convergent solution iteratively for a linear system of equations

I am working on a problem that requires an iterative procedure to solve a linear system of equations, the system of equations in matrix form is: $$\underbrace{\begin{bmatrix} r_{11} & r_{12} ...
3
votes
2answers
63 views

Slow application of `Outer` on a matrix

I have some performance issue with the calculation of a gaussian kernel applied to a not-that-large dataset. I'm not very good with performance tuning in Mma and I have the feeling this one could be ...
1
vote
0answers
37 views

Is it possible to circumvent this overflow?

I'm trying to evaluate the following function numerically: $ f(A,B)=\frac{2A\pi ^{5/2} (-1)^B}{(A!)^2B!} \, _4\tilde{F}_3\left({\frac{1}{2},1-A,1-A,1-B\atop ...
1
vote
2answers
74 views

Performance in calculating maximum-likelihood- based estimates

My probability density function is a complicated one for which numerical estimation is necessary. Here my pdf: ...
4
votes
1answer
79 views

FindFit runs extremely slow for my Function,how do I optimize this?

My function is the first order Bessel Function, and I am basically just trying to get this to fit in a way that does not take forever. I define the function as follows, (it seems to work faster if I ...
0
votes
1answer
26 views

How to force numeric evaluation?

I need to evaluate the PolyLog function at some points, but I'm interested in numeric values. E.g. PolyLog[3, 2.7] works fine, but PolyLog[3, e] just prints the same PolyLog[3, e]. I somehow need to ...
9
votes
2answers
202 views

Solve a PDE over a region defined by a Bezier patch

I am using NDSolve to find the solution to a PDE over an arbitrary domain. The domain is specified by a Bezier patch. ...
10
votes
1answer
256 views

Does NRoots own an abstract counterpart? If not, can we write one?

We know when solving linear algebra equations, despite its abstract syntax, LinearSolve is much faster compared to Solve: ...
1
vote
1answer
76 views

NSolve on bounded domain

I don't expect NSolve[] to be able to obtain all solutions in generalfor example. In principle there should be an algorithm that finds all solution to $f(x)=0$ for ...
6
votes
1answer
110 views

Numerical Integration different in Mathematica version 9 and 10 with same options

I have noted that the same function with the same settings gives me different results in Mathematica version 9 and 10. This involves integrating numerically interpolating functions and so on. Here a ...
0
votes
2answers
60 views

Derivative after numerical Integration

So I have a function that I want to numerically integrate with respect to temperature, so the integral changes depending on the value of temperature being used as it is one of the bounds. After ...
1
vote
1answer
56 views

Characterising the set of parameters that satisfy a system of non-linear equations

I am looking for a solution to the following problem and could not find an answer so far. I have a quintic equation, $f(x;a,b,c,\cdots)-x=0$, where $x$ is the variable with respect to which I need the ...
-1
votes
1answer
70 views

My code of plotting a two-variable function is too slow [closed]

I have a code in which my complicated function to be plotted is F(x,p). I would like to graph it for 5 values of p equal to 10^7, 10^8, 10^9, 10^10 and 10^11 for x values between 0.01 and 0.99. All ...
0
votes
0answers
100 views

Problem with FindRoot applied to functions

I am having difficulty with the error "is not a list of numbers with dimensions..." when using FindRoot (and other numerical routines in Mathematica) to solve equations numerically when the argument ...
1
vote
1answer
68 views

Wrong generalized eigenvalues of large numeric matrices

I've been working on a toy model of a variational method of a Hamiltonian H with an overlap matrix S. The point is that when H and S are small enough, Mathematica gives the correct eigenvalues (≈ ...
0
votes
0answers
21 views

why i cannot get appropriate number with my custom precision? [duplicate]

why i cannot get appropriate number with my custom precision? In[25]:= N[(1 + Exp[-30])/(1 + Exp[-29.9]), 1000] Out[25]= 1. I expect to see a few digits after ...
1
vote
1answer
83 views

How to properly apply NumericQ or s.th. similar here? - NDSolve inside NMaximize

I wrote a function that numerically solves a given Schrodinger equation and returns replacement rules to obtain the time evolution operator. It looks and is used as follows: ...
3
votes
0answers
133 views

Numerical integration: complicated 2D integral seems to be poorly estimated

In the course of some physics research I've been working on, a very annoying integral has appeared that I'm having difficulty evaluating numerically. Any help you could offer would be greatly ...
0
votes
1answer
102 views

Writing a Code to plot a function that includes a double integral [closed]

I am trying to write a code in Mathematica. Here are my steps: F[u_] = Some nontrivial and long expression in terms of u; Umax[x_, y_] = Some expression in terms of x and y; W[x_, y_] := integral ...
2
votes
3answers
144 views

Plot a bunch of lines in 3D from point data

I have a 12*25 array, wherein each entry is of the form $\{x,y,z\}$. So 12 different $x$ values, 25 different $y$ values and 12*15 $z$ values in all. I'd like to plot 12 curves of various $x$ values ...
10
votes
3answers
238 views

Why is (-1.)^2. a complex number

Why (-1.)^2. in Mathematica returns a complex number? It looks like in both C and Fortran it returns 1. Why does Mathematica behave differently than the other ...
6
votes
4answers
227 views

Function for a series of joined slopes

I need a function for a series of joined slopes and my solution feels a bit kludgy. Is there a better way? A list of pairs of transition points and slopes: ...
15
votes
2answers
395 views

Why is my data 10 times slower than random data when doing matrix multiplication

I have some data generated from some program, and it appears that matrix multiplication on these data are about 10 times slower than on some random data: ...
1
vote
1answer
81 views

Efficient method of raising matrix to a variable power?

I have a $2 \times 2$ matrix $A$, where each element is a 12th order polynomial in a parameter $a$. I need to raise this matrix $A$ to the $-t/T$ power, where $T$ is a known scalar (for this ...
1
vote
3answers
95 views

Speed up NIntegrate, which takes eigenvalues from another function

I have simplified my problem here, in my actual problem the matrix is much bigger which makes it impossible to find eigenvalues analytically. So, I chose standard BCS problem (2x2 matrix) to ...
2
votes
1answer
73 views

How to make N apply to exponent?

For example, I want to covert y+Sqrt[x] to y+x^0.5, where y and ...
1
vote
2answers
248 views

NDSolve with Explicit, Implicit Euler and Trapezoidal method

I am using Mathematica 9.0 both on Linux and Windows and I would like to integrate the Van der Pol equation numerically using various techniques such as Explicit and Implicit Euler and Trapezoidal ...
2
votes
2answers
98 views

WorkingPrecision causes issue in the NIntegrate

I really can't figure out why my code sometimes is not working. My integrals involve two variables (k and kz). The integration ...
1
vote
1answer
85 views

The problem (time) caused by ?NumericQ

In here, I asked a related (similar) question. Using ?NumericQ seems have slowed down the entire calculation. But I now have a more serious problem: ...