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

learn more… | top users | synonyms (1)

4
votes
2answers
79 views

N not behaving in the way I expected it would

I'm trying to use the N function to find the percent error between a function and a rounded value of that function. The code looks something like this. ...
4
votes
2answers
124 views

Torus-geometry algebraic equations using Nsolve and Reduce

Somehow a set of naive-looking equations cannot be solved by using NSolve. Mathematica returns a message like this: ...
2
votes
1answer
102 views

NDSolve with two parameters

I was trying to solve a ODE numerically. It has two parameters (w and z0) which I want to vary. The following code gives an ...
0
votes
0answers
84 views

Solving a second order ODE numerically

I am trying to solve the following second order linear ODE numerically (for small w, say) y''[x]+ D[f[x],x]/f[x] y'[x]+ w^2/(x^2 f[x])^2 y[x] == 0 where, ...
3
votes
0answers
115 views

How can I invert a Laplace transform numerically?

I have a very complicated expression, which I want to transform using the inverse Laplace transform. The built-in function InverseLaplaceTransform doesn't work. ...
1
vote
0answers
67 views

Heron's Method of Square Root Calculation Issue with Previous Suggestion [closed]

Being interested in limit points, which always seem just a little out of reach for me, I recently came across a previous question and answers concerning Heron's (Babylonian) method for calculating ...
0
votes
1answer
196 views

How could I solve this Reaction-Diffusion PDE using mathematica?

I'm modeling a problem with PDEs, So I gotta solve numerically this Reaction-Diffusion Partial Differential Equation $$ \frac{\partial u(t,x,y)}{\partial t}=D\Big( \frac{\partial^{2}u(t,x,y) ...
4
votes
1answer
134 views

Derivation of numerical scheme for linear transport equation on a variable stencil

The question is about automatica derivation of coefficients of numerical scheme on a variable stencil. So, lets consider 1d transport equation \begin{equation} (1)\qquad u_t+u_x=0. \end{equation} To ...
4
votes
1answer
115 views

Impact Crater Sim. with added criteria

I have been trying with out success to edit this impact crater simulation script into producing a variable which calculates crater density. In addition I have been trying to figure out how to ...
1
vote
1answer
76 views

Nonlinear 2nd order ODE with regular singularities

I am tring to solve the following ODE with NDsolve $2x~(1-x)~f''(x)+(3-4x)~f'(x)+a~f(x)+b~f^n(x)=0;~~a,b\in\mathbb{R},~n\in\mathbb{N}$. The mathematica "code" is: ...
0
votes
2answers
112 views

Strange behavior of Plot over a domain containing very large x-values

When I plot a function of (1 + 1/n)^n,There you can see: Plot[{(1 + 1/n)^n, E}, {n, 1, 10^13}] When I add a option of ...
4
votes
3answers
182 views

How to read the intersect corodinate of two lines from the ListLinePlot?

Suppose I have two curves intersect at some point, how can I read the coordinates from the graph, not read by eye, but find it with more precision by computer. For example, here are two lists created ...
1
vote
2answers
129 views

Use NMinimize instead of FindFit for constrained search (of coefficients)

(My problem is more complex, but let us formulate it through this example) I am trying to find the best polynomial approximation to the following function ...
3
votes
1answer
118 views

Solving an equation containing an integral in the unknowns

I have an equation of $x$ and $y$, which reads $$ -\alpha^2+\frac{2}{3} \alpha^3+y^2-\frac{2}{3}y^3+x^3f(\frac{y}{x})=0, $$ where $\alpha$ is positive parameter and $f(x)=\int (1-\tanh x) ...
1
vote
2answers
56 views

Calculating the numerical value of the regularized generalized hypergeometric function

I'm trying to calculate the numerical value of the regularized generalized hypergeometric functions: $\qquad \sf{HypergeometricPFQRegularized}^{(\{1\},\{0,0\},0)}(\{-1.5\},\{-1.,-0.5\},3600.)$ I ...
1
vote
1answer
92 views

How to increase the precision to get the correct roots at the boundaries?

I want to solve an equation and Plot a graph of $\delta(\tau)$, where $0<\tau,\delta<1$. In principal $\delta(0)=1,\delta(1)=0$. However, when I solve the equation, the points near $\tau=1$ ...
6
votes
2answers
281 views

How to implement a numerically efficient Airy Zeta Function

Define the Airy zeta function for $n=2,3,\dots$, by $$ Z(n) := \sum_r \frac{1}{r^n}. $$ where the sum is over the zeros $r$ of the Airy function $\operatorname{Ai}$. In Mathematica the ...
5
votes
0answers
64 views

How to pass a custom method to a particular option?

In an answer to my question More efficient method to compute moments of the Johnson $S_B$ distribution, J. M. has come up with a method to compute the moments of the Johnson $S_B$ distribution, which ...
16
votes
2answers
269 views

More efficient method to compute moments of the Johnson $S_B$ distribution

Here is a very specific feature request. I need Mean[JohnsonDistribution["SB", γ, δ, 0, 1]] When I issue e.g. ...
2
votes
0answers
129 views

How to solve an equation where the unknown variable is inside the integration [closed]

I have an equation: $$ \frac{1}{g}=\int_0^{\frac{1}{\delta}\sinh \frac{1}{g}} \frac{\tanh\left(0.882\, b\,\delta\sqrt{1+z^2}\right)}{\sqrt{1+z^2}}\mathrm{d}z $$ I want to obtain the relation ...
0
votes
0answers
73 views

How to solve boundary value problem with singularities at boundaries?

I have a boundary value problem, solving a system of differential equations with a singular boundary condtion (V[0] = 1/s, s->0) ...
1
vote
2answers
75 views

Need help getting the intercept of two lines in a ContourPlot

I am trying to find a set of parameters $\{\epsilon,\epsilon_b\}$, so that the two local minima have exactly the difference of 15.1 (see code below) and the left sided local minimum and the local ...
2
votes
1answer
104 views

Is there a good way to check, whether a small value produced numerically is a symbolic zero?

I have a complicated 4x4 matrix and need to know the eigenvalues. I expect a zero eigenvalue for physical reasons. Giving numerical values first gives me an eigenvalue of $\mathcal O(10^{-15})$. Now ...
2
votes
1answer
90 views

Singularity while solving PDE

I have to solve a PDE (in the context of the functional renormalization group in physics). I have a function of two variables, $U(l,p)$. I know $U(0,p)=U_0(p)$ and then I have an equation (eq925) that ...
2
votes
3answers
467 views

Plotting a Bifurcation diagram

I have the following system equation v'(t)=2*G*J1[v(t-τ)]cos(w*τ)-v(t) How do you plot the bifurcation diagram, τ in the x ...
2
votes
1answer
217 views

Non-linear curve fit problem

I am having a problem with making a fit to data in Mathematica, which may involve my understanding of the methods available. I am trying to fit the derivative of a Frota function (which is a Single ...
0
votes
0answers
58 views

Use FindRoot to plot function restricted to path through domain

I have a function complex-valued $z(x,y)$ defined on a torus and I have a nice routine which plots paths through $(x,y)$ space satisfying the constraint $\rm{Im}(z)=0$: ...
1
vote
1answer
324 views

How can I use Mathematica to solve a Stefan Problem using an explicit scheme?

I would like to plot the temperature distribution for a particular case. the problem is stated in the paper, behind a paywall here, summarized as Consider a one-dimensional container of length l, ...
4
votes
1answer
39 views

Different AccuracyGoal for different variables

Is it possible to set different AccuracyGoals for different variables in numerical commands like FindRoot and NDSolve?
7
votes
1answer
145 views

Why don't 1. (0. + a) or (0. + 1. a) simplify?

I'm handling some mixed-numeric-analytic expressions, and I feel I'm missing some subtleties of how Mathematica handles simplification of such expressions. In particular, I was initially puzzled by ...
0
votes
1answer
109 views

How to specify a NeumannValue in a system of non-linear partial differential equations?

I am trying to solve a nonlinear system of partial differential equations. If I assume DirichletConditions it all works well. ...
1
vote
1answer
80 views

Numerically solving a transcendental equation as a series

Given a transcendental equation $f(x,y)=0$, is there a way for Mathematica to automatically solve the equation as a series? I already know that I can use ...
1
vote
1answer
81 views

Limited Precision calculation in Mathematica

I apologize upfront for the simple minded question, however i couldn't find an answer in either the Mathematica documentation or Stack exchange. I am trying to explore the effect of finite precision ...
4
votes
1answer
233 views

Is this a bug of NSum?

Check this: NSum[Log[Abs[m]],{m,1,24}] (*54.7847*) NSum[Log[Abs[m]],{m,1,25}] NSum::nsnum: Summand (or its derivative) (Abs^[Prime])[m]/Abs[m] is not ...
5
votes
3answers
119 views

Differentiate a numerically defined function

My function is f[a_, b_] := NIntegrate[Sqrt[(Cos[t] - a)^2 + b^2], {t, 0, Pi}] I want to calculate g[1,1] where ...
2
votes
1answer
285 views

What is wrong with FindRoot?

I am trying to find a numerical solution to the following transcendental equation ...
4
votes
1answer
169 views

EquationTrekker using Mathematica 10.2

I wonder whether the problem that arise with the following code is specific to my machine, as it seem to work with the documentation example. ...
3
votes
0answers
122 views

NSolve doesn't work on an equation containing a numerical integral and constraints

I'm having trouble getting Mathematica to solve equations numerically. I know that its important to specify the type of variables for pattern testing (see e.g. here) but this doesn't seem to work. ...
1
vote
2answers
174 views

How to solve this two algebraic equation simultaneously for u and H ?(all real number)

I want to find the non-zero value of H when beta is changing(especially what value of beta when increasing will there be a non-zero H value). H is between [0,100]. This is actually the calculation ...
3
votes
2answers
152 views

Maximizing a function defined using NIntegrate [duplicate]

I have two functions fn[x,y,z] which is in integral form and I have another function gn[x,y] which is also in integral form ...
7
votes
2answers
221 views

How to do multi-dimensional principal value integration?

The toy model is: $$\int_{-2}^{2}\int_{-2}^{2}\frac{1}{1-(x^2+y^2)}\, dx\, dy$$ The integrand have opposite sign across the circle $x^2+y^2=1$, so one would expect that the integral has meaning only ...
1
vote
1answer
60 views

Solving recursions

This question is tied to my previous question. I have a few recursion formulas, and I keep getting Recursion depth of 1024 exceeded. error. I need to get the ...
8
votes
1answer
125 views

FindMaximum failing on a trivial problem [closed]

I am trying to solve a trivial optimization problem with FindMaximum but for some reason it is not going. I reduced the problem down to the following non-working ...
4
votes
1answer
115 views

Why doesn't NSolve work for this equality? Wildly incorrect solutions are given in certain cases

I am trying to write a function that solves for p in the following equation: PDF[BinomialDistribution[n, p], x] == op The ...
3
votes
1answer
68 views

In NMinimize, how can I efficiently handle NIntegrate errors for non-integrable functions?

I am using NMinimize to find parameters that minimise the integral of a function in the least squares sense: ...
4
votes
4answers
267 views

How to stop a summation when a variable is small enough?

I meet with a problem. I hope to get an infinite summation of $f1(x)/f2(x)$ which converges to zero. So my code is Sum[f1[x]/f2[x],{x,Infinity}] or ...
1
vote
2answers
71 views

Condition on Inside of Region

How do I handle boundary conditions present in the region. Mathematica complains about the condition v [1 , t ] == u [1,t]. The condition should be given to this ...
0
votes
2answers
74 views

Varying results from the Round function

My problem is simple. Consider the following. ...
3
votes
1answer
116 views

High precision calculation of infinite product involving prime numbers

I'm recently studying some topics in analytic number theory and I have encountered results involving the infinite product $$C=\prod_{p}\left(1-\frac{1}{p(p+1)}\right)$$ where $p$ denotes calculating ...
4
votes
2answers
100 views

How to use Evaluation Monitor in conjunction with NonlineaModelFit?

I am trying to find out how many function, gradient and hessian evaluations are made when i run NonlinearModelFit for example in this case ...