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

learn more… | top users | synonyms (1)

0
votes
0answers
30 views

How do I numerically integrate the result of NDSolve if it depends on several variables?

I am trying to numerically integrate solution of NDSolve. I am trying to integrate my result of NDsolve in line 97 of my notebook, but am getting the error ...
0
votes
1answer
93 views

How to fit parameters, not functions?

Given a set of parameters ...
0
votes
0answers
75 views

Solving numerically a system of equations using different methods

I will use, as an example, the simple Henon-Heiles potential ...
1
vote
1answer
72 views

Paramter Scans and $\chi^2$ Test in Mathematica

Is there any in-built function or a recommended package that enables one to find, say, 10 Parameters, which are used as boundary conditions in NDSolve, that minimize $\chi^2$? ...
1
vote
1answer
43 views

Differential equation for a list with parameter dependent function

I am having a differential equation: y' = (1 - y) - f[y, mu] y; f is a hysteretic function that depends on y and on the derivative of y: ...
3
votes
0answers
94 views

Constructing the coefficient matrix in discretization of a PDE

In order to solve the following two dimensional PDE $$\frac{\partial u(x,y,t)}{\partial t}-\frac{1}{2} \sigma _1^2 x^2 \frac{\partial ^2u(x,y,t)}{\partial x\, \partial x}-\frac{1}{2} \sigma _2^2 y^2 ...
0
votes
1answer
71 views

Integrate over FindRoot solutions

I have a function of bivariate normal PDF and its marginals defined as ...
5
votes
1answer
215 views

Trouble with shooting method for a 4th-order stiff ODE

The ODE I need to solve is $$\left(y^3y^{\prime\prime\prime}\right)^\prime+\frac{5}{8}xy^\prime-\frac{1}{2}y+\frac{c}{y}=0$$ where $\prime$ denotes differentiation, $c$ is a constant and ...
0
votes
1answer
50 views

LinearSolve on non-square matrices?

I just came across a strange behaviour for LinearSolve (on Mathematica 8.0.0.0). Consider the following definitions: ...
2
votes
1answer
200 views

Maximized value of a function as an additional constraint on a variable

I want to maximize a function $f(b, h)$ with respect to its arguments and subject to some additional constraints. If these constraints are satisfied, $f$ is increasing in $h$. I then want to find an ...
3
votes
1answer
384 views

Wrong result of simple math calculation. Is it possibly a bug of the program? [closed]

I encounter the following issue accidentally (shown in the screenshot) which is very odd to me. The output[4] and [5] is obviously wrong. But with the input value of 991.91, it turns out to be right ...
5
votes
0answers
70 views

How does Plus work on machine precision Real arguments?

I thought Kahan's summation method would make a nice example for students to use to think about round-off error [W. Kahan, Pracniques: Further Remarks on Reducing Truncation Errors, Commun. ACM 8  ...
1
vote
1answer
95 views

How can I increase the precision of my computation?

How can I increase precision up to 15 digits for the results (EC, and that of FindRoot) computed below? ...
3
votes
3answers
128 views

Chopping matrix elements, real or imaginary

An undesired shape of a matrix has the following form: which is created by ...
6
votes
1answer
192 views

Trouble with shooting method for a 4th-order differential equation

I'm trying to solve the following forth-order ODE with the shooting method: $$\frac{1}{5}(y-2xy^\prime)=\frac{1}{x}\left\{\frac{xy^\prime}{y}+xy^3 \left[\frac{(xy^\prime)^\prime}{x} \right]^\prime ...
9
votes
3answers
276 views

Labeling solutions of an Eigenvalue equation involving Bessel functions

I'm solving the Schrödinger equation for a particle in an annular geometry with hard wall boundary conditions and I've reduced it to the following equation: $$J_m(k\,R_1)\,Y_m(k\,R_2) - ...
3
votes
2answers
104 views

Unexpected behavior from Accuracy

This is my code Table[With[{x = 10^n + 1/17}, N[x, {Infinity, 5}]], {n, 0, 5}] // Column Or like this ...
1
vote
1answer
45 views

System of ODEs - NDSolve issues

I am a self-taught beginner trying to use Mathematica for the first time. If you wouldn't mind, I would like to ask for help with the code I am working on as I keep running into multiple issues when ...
5
votes
1answer
102 views

Compilation, square roots, and integers

After looking at this question, particularly this answer, I wrote my own performance test, using the two functions ...
4
votes
1answer
129 views

Saved InterpolatingFunction behaving badly

Bug introduced in 10 and persists through 10.3.1 or later I created this InterpolatingFunction, and NIntegrate gives an ...
10
votes
3answers
383 views

Bug: Wrong results from NSolve on coupled polynomials. WorkingPrecision->Automatic fails

OP UPDATE: I received an email from WR on 1-18-2016: "...It does appear that the NSolve function is not behaving properly in this case and I have forwarded an incident report to our developers with ...
0
votes
0answers
57 views

Error message when using a compiled function in NSum [duplicate]

Below is a simple example to illustrate the problem test = Compile[{{n, _Integer}}, n] Now, Table works fine ...
3
votes
3answers
70 views

EvenQ not working properly on IntegerPart[real number]

Something fascinating is happening at the moment. ...
1
vote
1answer
83 views

singularity in boundary value problem

I am trying to solve a non linear differential equation with variable parameter. ...
13
votes
2answers
515 views

more numerically accurate inverse matrix

I encountered the following matrix mat = {{2, 2.161209223472559` + 1.682941969615793` I}, {2.161209223472559` - 1.682941969615793` I, 2}} and ...
1
vote
0answers
43 views

Rescale large numerical factors in rational functions

Given a rational function $$ f(x_1,x_2) = \dfrac{r_1 x_1^2 + r_2 x_2}{r_3 x_1 + r_4 x_2}, $$ with $r_i$ arbitrary real or complex numbers, is there a built-in function to get Mathemtica to rewrite as ...
3
votes
2answers
67 views

Solving an integral equation for upper boundary

I am reading a paper on High Harmonics Generation (HHG) and a Lewenstein model The paper is here. I would like to reproduce some results but I am stuck at the following problem. I have: ...
6
votes
2answers
311 views

Inverse Laplace transform

Let $r=\mu = 0.15; \sigma = 0.05; T = 1; S_0 = 100; K = 95;$ Let $\nu:=\frac{2\mu}{\sigma^2}-1$ and $\eta \equiv\eta(\alpha):=-\frac{\nu}{2}+\frac{1}{2}\sqrt{\nu^2+\frac{8\alpha}{\sigma^2}}$. ...
10
votes
2answers
219 views

Demonstrating the behavior of a function as its independent variable approaches zero

I have several questions regarding the function $$f(x)=\frac{\sqrt{x^2+9}-3}{x^2}$$ that I would like to help my students with in the upcoming semester. Now, the limit as $x\to 0$ is 1/6. ...
3
votes
1answer
38 views

How can I perform arithmetic on a list integers and some other exact numbers and get decimal numbers in the result?

I want to do a simple calculation with a list with Pi and 10^-6 and get a list of decimal numbers as the result. ...
0
votes
0answers
34 views

Handling a matrix with components greater than machine precision

I have four quantities stemming from a 4th order differential equation. I can represent these as a vector which is a product of a 4X4 matrix $$ M=\left\{v,\frac{\partial v}{\partial x},\frac{\partial ...
1
vote
0answers
92 views

Problem setting boundary conditions with NDSolve [closed]

I have the following system of PDEs for which I have given parameters $\gamma, \tau$ and $\mu$, $$\begin{align} T_t = &\ \gamma\,(L +\tau F-T)\\ F_t = & -F_x-(F-LT)\\ L_t = &\ \mu ...
3
votes
1answer
99 views

Fast evaluation of a function in many points

I need to feed to an external program a number of points (in Complex128 format) generated from the numerical evaluation of some function, e.g. $e^{i ...
0
votes
0answers
37 views

Multi-Precision [duplicate]

I have read in some numerical Laplace inversion papers that we can take advantage of multi-precision environment in Mathematica , Maple and etc.Can someone please explain it for me why it is not ...
2
votes
1answer
81 views

FiniteDifferenceDerivative of complex function in 2D--bug?

I want to compute partial derivatives of complex functions via finite difference approximation on two dimensional grid using NDsolve`FiniteDifferenceDerivative ...
1
vote
1answer
73 views

Estimating error in NDSolve

I would like to give a theoretical estimation of local truncation error (and then for the global one) for a solution to a numerical initial value problem by ...
6
votes
2answers
342 views

Infinite base two number to base ten

Suppose I have a base two number that repeats itself every five places (a number $x$ such that $0\le x<1$. For example: $$x=0.101011010110101101011010110101101011010110101...$$ What would be a ...
0
votes
1answer
102 views

Precision of Eigensystem? [closed]

I was using Eigensystem to obtain the rotation matrix. However, I find out Mathematica does not fully diagonalize my matrix (or say not precise enough). My matrix ...
-2
votes
1answer
78 views

Tricky ellipse problem [closed]

I have this equation and I need to show it is en equation of ellipse, could anyone help me? 5x^2 - 4xy + 5y^2 = 21
0
votes
1answer
44 views

Strange eigenvector behaviour for matrix with large numerical values

I'm trying to compute the eigenvectors of a matrix with large numerical values $$ \left( \begin{array}{ccccc} 0 & 1.\times 10^{18} & 100 \text{X} & 0 & 1.\times 10^{11} \text{X} \\ ...
2
votes
2answers
161 views

Maximizing over an integral with a single parameter

There is probably a neat approach to solve this problem...but can't get to it at the moment. How do you maximize an integral with respect to a single parameter? My code below produces error messages. ...
0
votes
0answers
34 views

Mathematica Stops Working

When I run the following code (taken from a Mathematica Blog) which is solving the NS equations; ...
1
vote
1answer
103 views

Wrong root when using numerical values

I have the following inequality: $$ \sqrt{\frac{a}{2x}}+ \frac{b}{1-\frac{a}{a+\sqrt{a(2bx + a)}}} + \frac{a}{2x\frac{a}{a+\sqrt{a(2bx + a)}}\left(1-\frac{a}{a+\sqrt{a(2bx + a)}}\right)} < f $$ on ...
1
vote
1answer
88 views

Help with findroot optimization

I'm trying to solve the set of coupled equations $$\frac{-N -2( \lambda + N(\frac{\beta}{\epsilon}-\lambda))\upsilon_l + N ...
0
votes
2answers
57 views

How to plot the solution of a function while varying a parameter [closed]

I have a function of a single variable that I want to solve numerically for different values of a parameter and then plot the results. I have a general equilibrium model that I can get to a reduced ...
0
votes
1answer
72 views

Implementing AiryAiPrimeZero function

There are some functions implemented in the Wolfram Language related to Airy functions. For example, AiryAi, AiryAiZero or ...
0
votes
0answers
38 views

Numerical derivative of a function which solves a nonlinear system of ODEs

My dear friends, I want to study a nonlinear system of ODEs and to plot a function and its derivative which is defined from the functions of the system of ODE. The question is how to find the ...
7
votes
2answers
182 views

Derivative of the Dedekind eta function fails to compute with errors I don't understand

When trying to understand better the question Eisenstein Series in Mathematica? I stumbled on the following: issuing Derivative[1][DedekindEta][.11 I] gives ...
1
vote
1answer
62 views

Error with NDSolve when used for a nonlinear system of PDE's

I am trying to solve the following system of Hamilton-Jacobi PDE's: $ V_1,_t - 0.5 V_1,_x^2/(1 - 0.2x)^2 + V_1,_x(0.1x^2+0.03x+.0.01)/(1 - 0.2x)+0.03(x-0.5)^2-V_1,_x V_2,_x/(1 - 0.2x)^2=0$ $ V_2,_t - ...
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. ...