# All Questions

2answers
517 views

### How to speed up minimization of function

I have the fallowing code (the functions within that code are replaced by simpler ones, but the code structure is identical):  ...
2answers
177 views

### Getting good-looking matrix form output from a matrix having both scalars and matrices as elements

I have a nested matrix n: ...
4answers
3k views

### How to implement Donald Knuth's up-arrow notation

How does one enter very large numbers in up-arrow notation? Up-arrow notation was created by Donald Knuth to write very large numbers in it iterated exponentiation form, for example 6↑↑3 = 6^6^6.
4answers
1k views

### An easier way to find the properties of an ellipse from its equation?

In this Q&A about fitting an ellipse to a set of points, there are multiple answers that generated general equations of the ellipse, like this one by @ubpdqn: However, the steps to find out the ...
0answers
159 views

### How to specify the time variable for NDSolve

I recall that it is possible to specify which independent variable is the "time" variable in NDSolve, but I can't find it documented anywhere. Does anyone recall ...
0answers
128 views

### Speeding up the numerical integration of a certain function

I'm using the following function f[t_] := 3/4 t^-3 NIntegrate[(x^4*Csch[x/2]^2), {x, 0, t}, Method -> {Automatic, "SymbolicProcessing" -> 0}]; I ...
1answer
102 views

### Using less memory to store and manipulate specific types

Is there a simple way to use Integer types (in particular, a table of Integer types) that require only 4 or 8 bytes (reps. 32 and 64 bits) representation? It seems that integers in Mathematica have a ...
1answer
95 views

### Why does one Monitor expression work while another fails?

I have a (somewhat involved) function f[x?NumericQ, y?NumericQ] and for some reason it behaves differently when given a Table ...
1answer
320 views

### plotting 3d points: z-axis is squashed [duplicate]

I am plotting 3D points and it occurs to me that Mathematica doesn't have an easy way to specify my points to be plotted in a uniformly scaled cartesian space. For example I plotted ...
2answers
112 views

### Using AddTo in a function

I want to create a function that will take a variable $x$ and reassign the value $x+2$ to $x$. So f[x_]:= x += 2 However: ...
3answers
268 views

### Converting expressions to “edges” for use in TreePlot, Graph

This question is similar to this: Nested list to graph. How to "flatten" an arbitrary expression, eg expr = a[b[c, d[e][f], g], h] to a list of key-value pairs ...
0answers
108 views

### Which functions automatically generate new functions?

In his video http://www.wolfram.com/broadcast/video.php?channel=362&video=1643, Wolfram gives the following example: the output from ...
3answers
196 views

### Binning events with weights

I have two vectors, one containing sampled energies and the other one for each of these energies a weight: e(i) and w(i). I ...
4answers
718 views

### How to find a path that traverses each edge of a graph exactly twice?

I have a question regarding a graph traversal problem. This is the graph I am working with: ...
1answer
146 views

### How to get correct numerical integration which should be zero? [duplicate]

I want to numerically integrate function berrycur over kx and ky. The definition of berrycur is given at the end of the ...
2answers
94 views

### Convert an expression from one form to another

I have this expression -0.433284-0.758719 x+0.00289158 x^2-0.443672 y+0.00149027 y^2 I want to express it in terms of ...
1answer
75 views

### strange result with trigonometric triple integral [duplicate]

I'm defining functions e[k_, t_] := Cos[Pi (k - 1) t] cosIntRaw[k_, l_, m_] := Integrate[e[k, t] e[l, t] e[m, t], {t, 0, 1}] cosInt[k_, l_, m_] := Assuming[Element[{k, l, m}, ...
1answer
144 views

### Probability Distribution of a Multivariate Hypergeometric distribution and maximum probability

Hello to all Mathematica Users! I have this question: Consider a box which contains 69 balls. 17 red, 1 white, 29 blue and 22 green balls. There will be picked 7 balls randomly, without putting the ...
2answers
295 views

### Delete pairs from a list

I have a data set in which I need to remove all matched pairs of entries - not just the first entry that is duplicated but both entries. To add to the complexity, the pairs must be between different ...
2answers
110 views

### Funny behavior of Ellipsoid function

From its description I thought that the normalizations of the directions d_i of the semi-axes did not matter when using the ...
2answers
370 views

### Why doesn't Roots work on a certain quartic polynomial equation?

In everything that follows I am using Roots to get the solutions to the equations. I start off with this equation: $$\frac{A}{3}x^4 - x^2 + 2ax - b^2 = 0$$ Now ...
1answer
59 views

### How to check the decimal accuracy of result? [duplicate]

I am trying to check if the result is enough accurate to use. I need an accuracy of 10^-6 from some numerical method. Something like root finding algorithm. But how do I check that in mathematica? I ...
0answers
32 views

### Clear variables [duplicate]

I'm new in Mathematica and I am working with various notebooks. My problem is that when I run a notebook, it seems taking definitions from the previous notebook. For example in 'notebook1' I make an ...
1answer
128 views

### Unexpected result from FullSimplify

In the following simplification why doesn't Mathematica get a zero when asked to compute "Y-Z" eventually? ...
3answers
283 views

### String templating

I am pretty new to string processing in Mathematica. But I'm having some problems in doing simple string template filling to my mind elegantly. For example when doing export for my answer here, one of ...
9answers
1k views

### How can a power of 0 or 1 be replaced?

Consider this given example for ReplaceAll 1 + x^2 + x^4 /. x^p_ -> f[p] This returns ...
2answers
142 views

### How can I speed up the export of graphs in DIMACS format?

I'm creating random graphs with suitable properties and exporting them in the DIMACS format. Already, for rather small graphs with, say, ~60k vertices and ~240k edges, ...
1answer
184 views

### Factoring terms out of a polynomial

I don't do much algebra in Mathematica and was surprised to discover, while attempting to answer this question, that I had no idea how to factor out an expression from a polynomial. The question was, ...
2answers
397 views

### How to color separate a colored-in-pencil drawing?

I'd like to pick out just the "pencil" color in some drawings done by a young member of the household (he'd like to print out copies of these pictures and distribute them to his class mates on the ...
1answer
104 views

### Symbolic Output after numerical computation

I have a small question about the symbolic output. I started to write a program that generates the coordinates of n-dimensional polytopes by Wythoff construction. For crystallographic groups, all is ...
3answers
409 views

### How to use LineLegend and SwatchLegend together

I am wondering if one can place on the right of the plot frame a single legend that is a combination of a LineLegend and a SwatchLegend. What I want is to see the line with its label on top of the ...
4answers
847 views

### Is there a way to increase the smoothness of a cylinder?

I am using Cylinder to produce wide flat disks (in Mathematica 8). This works just fine except that the circular base of such a cylinder turns out to be really just ...
1answer
235 views

### More efficient Omnibus number determination?

Amusing myself with concepts from "Omnibus Sequences, Coupon Collection, and Missing Word Counts", in particular the sequences. To paraphrase the concept, a string is k-Omni over some alphabet a if ...
1answer
71 views

### How to joint symbolic expressions together [duplicate]

I want to joint symbolic expressions together to create a another symbolic expressions. one way to do that is as follows: ...
0answers
116 views

### A derivative encountered in matrix factorization using gradient descent

I want to factorize a matrix $a_{ij}$ as $$a_{ij} = \sum_k u_{ik} v_{jk}$$ using variational method for some reason. That is, I want to minimize the cost function $$F = \sum_{ij} b_{ij}^2$$ with ...
1answer
206 views

### Why does show combined plots and graphics fail in CDF Player but not in Mathematica?

The question is, how might I get the following script working as a CDF demo of complex inversion in a circle? It works fine in my home edition of MMA 8 run on OS X Mavericks. When saved as a CDF file ...
3answers
197 views

### Circumnavigating a curve or going through it to show different behavior

I am not sure if what I want to do is possible in Mathematica. I've provided something simple below to convey what I want to do. Basically what I want to happen is that when the ...
2answers
91 views

### Using Table with arbitrary number of variables [duplicate]

Let $P=\{p_1,...p_n\}$. I would like a way to implent Table[Expression,{$p_1$,lim},{$p_2$,lim},...,{$p_n$,lim}] where n and lim are parameters defined by the user. Any ideas?
1answer
77 views

### Finding the right DeleteCases pattern for <<199>>

I have a list in Mathematica with several items like <<199>> and <<104>>, I would like to get rid of them using DeleteCases, but none of the patterns I ...
2answers
125 views

### Comparison Operation for Nested Matrices

I have a nested matrix n as bellow ...
2answers
268 views

### After executing MessageDialog[] how can I wait for it to close before continuing

After executing MessageDialog[] how can I wait for it to close before continuing? I want to popup up a message and wait for the user to hit OK before continuing. Is there a mechanism for this?
1answer
2k views

### wolfram mathematica intersection of two surfaces [duplicate]

I use wolfram mathematica. There is a function of two variables which defines the surface z = f(x,y), the second surface is defined as z = const. How to find the line of intersection of these two ...
2answers
96 views

### Creating function with matrix argument

I am completely new to programming, so I apologize in advance for a stupid question. I want to program an algorithm for computing invariant factors of a finitely generated abelian group, so in ...
4answers
350 views

### Defining a pure function involving a function argument

I've got an expression involving x and y that I want to use as a MeshFunction: ...
0answers
32 views

### Why I am not getting the same frequency when sampling a waveform? [duplicate]

I am trying to simulate the sampling of a waveform to then apply FFT Analysis to it. Here is the sample code I have now using a square wave: ...
1answer
408 views

### Smooth out contour in RegionPlot/ContourPlot

I would like to smooth out the jagged edges in the outermost contours in the following plot: I have data of values as a function of variables (x,y) in the form ...
4answers
764 views

### Exponential of a Differential Operator

In Mathematica, is it possible to exponentiate a differential operator such that the operator will act on a function, $f(x,p)$? Specifically, I wondering if I can get Mathematica to do this: ...
5answers
2k views

### A question regarding 1 divided 243

Here is a problem due to Feynman. If you take 1 divided by 243 you get 0.004115226337 .... It goes a little cockeyed after 559 when you're carrying out the decimal expansion, but it soon straightens ...
1answer
175 views

### Laplacian in D Dimensions

Is it possible to compute $\Delta F=\nabla^2 F$ for $F=F(x^1,x^2,…,x^D)$ with $D$ finite? I seem to be only able to specify spherical coorindates, for example, if I want to leave standard ...
4answers
121 views

### Drop row if sum of part of row is equal to zero

My problem is the following: Suppose I have a matrix A which looks the following: ...

15 30 50 per page