# Tagged Questions

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

74 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 ...
85 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 (≈ ...
110 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: ...
25 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 ...
67 views

...
151 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 ...
1k views

### Can Mathematica Handle Open Intervals? Interval complements?

Open Intervals Following up on this question, I was wondering whether Mma can handle open intervals. For example, the union of the intervals, $$1<x<5$$ and $$5<x<8$$ should not ...
550 views

### Real Numbers in the Wolfram Language

Epilog: Much of the discussion in the answers below revolves around the distinction between Real as a data type and real numbers as a domain or class of numbers (irrespective of the form in which ...
276 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 ...
118 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 ...
429 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: ...
109 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 ...
150 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 ...
78 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 ...
383 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 ...
60 views

### DSolve for first order nonlinear equation is solution numerical or analytical?

Hi I'm new to mathematica so I may have a somewhat trivial question. my code below solves and plots the results of a first order nonlinear ODE. The solutions mathematica gives me contains & and #1 ...
239 views

### Numerical Instability?

Current Status Please skip ahead to Update 2: the key questions are now: 1/ Why does Mma generally fail to find the minimum for a well behaved function when the function does not have infinite ...
111 views

### How to speed up Min of DateObjects?

I'm in version 10.0.1 using a Dataset to do some plots and things. For one of the plots I need to get the minimum date of a some filtered set of the ...
104 views

### How can I use the command Minimize of this trigonometric function? [duplicate]

I want to find the minimum of the function $\sin^6 x + \cos^6 x$. I tried Minimize[{Sin[x]^6 + Cos[x]^6, 0 <= x <= 2 Pi}, x] I got {Cos[2 ArcTan[1 - ...
199 views

### Help Please : Error in plotting the solutions of FindRoot

I want to find the roots of an equation using FindRoot as a function of a real parameter K and then plot the real and imaginary solutions vs. the parameter K. The function I'm trying to find the ...
43 views

### How shortening argument test when declaring functions?

When defining some functions which depend in many arguments sometimes we need to include question Q constraints to diminish processing time. My question is simple, there is a way to shorten a long ...
1k views

### Water Hammer - Numerically solving system of PDEs

I'm trying to use Mathematica to solve the water hammer effect. ...
140 views

### Increasing number of decimal places with FixedPoint

I've tried: In[169]:= newton3[x_] := N[1/2 (x + 3/x)]; FixedPointList[newton3, 1.0] Out[170]= {1., 2., 1.75, 1.73214, 1.73205, 1.73205, 1.73205} Of course: ...
108 views

### Iteration of NDSolve

I have a problem with iteration of the result of NDSolve. Namely, the following code works fine ...
104 views

107 views

### Why Abs[Infinity] is an element of the real numbers

Element[Abs[Infinity], Complexes] returns False, that's right. But ...
55 views

### Handling Accuracy and Simplifying

I have the following problem. I have a system of non-linear equations that I log-linearize around a certain point, let's call it point A, using a function that I ...
144 views

### High-Precision NSolve

I need to calculate the intersection of two curves f1[x_] := ((Zl ρ ) Exp[-x]) f2[x_] := (α k e^2 /x^2) Where ...
34 views

### How to make a real number parameter go 2 decimal precision? [duplicate]

I'm new at community and I'm starting with Mathematica. I'm now having a trouble with a very simple problem which for many of you might be really obvious. In documentation ...
3k views

### How to discretize a nonlinear PDE fast?

I wish to numerically solve the following PDE. Although there are some complete discussions for solving PDEs in tutorial/NDSolvePDE, there is no hint for the nonlinear case by discretization. Thus, I ...
148 views

### NMinimize ignores constraints

I have a problem with NMinimize - I try to minimize quite a complicated function and use a couple of constraints (the way it is shown in the documentation). Now, ...
133 views

### How to find all roots of a complex number [duplicate]

Finding all roots, and I know there are four f them, of this (1 - i)^(1/4) Not only real, but imaginary as well
153 views

### RegionMember with some tolerance?

Can I specify some tolerance for the new geometric-computation function? RegionMember[Line[{{0, 0}, {1, 0}}], {.5, 0}] (* True *) While: ...
51 views

### Error messages from NIntegrate [closed]

I've been trying to work on some integrals (Actuarial Science, for those interested) but somehow this always returns an error for me. ...
Suppose that I have a number $n$ with many decimal digits of precision. What is the code to use to get Mathematica to recognize possible closed-form expressions for that number?