14
votes
2answers
979 views

Is Mathematica a Turing-complete language?

Is Mathematica a Turing-complete language? If so, how can that be proved? If not, why?
14
votes
2answers
54k views

Generate a Unit Circle Trigonometry

Struggling often with Trigonometry I would like to have some code to generate this Unit Circle Trigonometry. Would be of great help when I need to transform some data :
14
votes
5answers
2k views

sprintf() or close equivalent, or re-implementation?

Is there a sprintf() command (some command that takes a printf-style format string and a list of values to insert into the ...
13
votes
2answers
487 views

Phase portrait on a cylinder

It is very nice and very easy to make a sketch of a phase portrait with StreamPlot. For example, for the classical pendulum, defined by $$ \dot x=y,\\ \dot y=-\sin x, $$ The code ...
13
votes
2answers
261 views

Export Plots to PNG in Printout Style

When creating a plot in Mathematica 10 (OS X 10.9.4 and Win 7) the FrameLabel and Ticks are greyish and only the Frame itself is black (see Screenshot bellow). Only when exporting the plot to PDF all ...
13
votes
1answer
261 views

How to determine numeric equivalent of Tiny, Small, etc. image sizes for Graphics?

Is there a way to find the numeric equivalents of Tiny, Small, Medium, and ...
13
votes
0answers
165 views

func::usage needs to be run twice? [duplicate]

There is an annoying problem that I can't figure out why it's happening. I have defined a usage for a my function tensorA: ...
13
votes
4answers
2k views

How do I plot the unit normal field for a surface?

The question is pretty much in the title; I'm about to teach my multivariable calculus students about orientations on surfaces, and I would like to be able to show them pictures. Any ideas?
13
votes
3answers
297 views

How to keep some of the results of the NestList

I'm using some iterative arithmetics to calculate wave propagation with the help of NestList. I have to use a small step size for iteration to guarantee the accuracy, which lead to too much data (e.g, ...
13
votes
2answers
863 views

Higher order SVD

Does anyone know how to do a higher order SVD in Mathematica ? A good reference seems to be here http://www.sandia.gov/~tgkolda/pubs/pubfiles/SAND2007-6702.pdf but I don't understand their formalism ...
13
votes
2answers
876 views

Suppressing negative roots in Mathematica

Problem Using Mathematica's Solve operator can sometimes lead to an output involving a positive and negative root (say when solving for a variable such as ...
13
votes
1answer
390 views

ImageAlign doesn't always work correctly

I've been working with ImageAlign in Mathematica 8 and I'm having trouble getting it working reliably. Perhaps there are some subtleties that I'm not yet aware of? ...
12
votes
6answers
634 views

Elegantly split a matrix into positive and negative parts?

I have a matrix $M$ of real components, and I want to split it into two matrices $M^+$ and $M^-$ of the same dimensions as $M$, where $M^+$ contains the positive components of $M$ (the remaining ...
12
votes
1answer
892 views

Numerical solution of coupled ODEs with boundary conditions

I have to solve the following set of ODEs and just can't get good results using Mathematica $$ r\frac{d}{dr}\left(\frac{1}{r}\frac{d}{dr}A(r)\right)-\xi^2F(r)^2\left(A(r)-1\right)=0 $$ $$ ...
12
votes
5answers
354 views

Faster way to convert triangle list to edge list with no duplicates

I have a list of triangles returned by a Delaunay triangulator, in the following format: ...
12
votes
9answers
464 views

Dropping n consecutive terms from a list periodically

Suppose I have the following list lis = Range[100]; and I want to remove n consecutive terms periodically from the list. For example suppose I want to drop terms ...
12
votes
4answers
2k views

How can I change the color of the bar in a ProgressIndicator?

I want to change the color of the progress bar in a ProgressIndicator. I want the progress bar to be red instead of green. For this purpose I wrote the following ...
12
votes
1answer
197 views

Layout a second graph of the same nodes in the same way

I have a number of graphs with the same nodes. I would like to be able to somehow save the layout that results from the spring embedded results of one graph (the first image), and have the other ...
12
votes
2answers
538 views

Using Goto and Label in compiled function?

Below I post some rudimentary code to show that there is something wrong using Goto and Label commands in compiled functions (or I believe there is something wrong). It seems that the command Label is ...
12
votes
1answer
311 views

Unexpected behavior from VectorPlot

I am surprised at the behavior of VectorPlot in the following sense: plotting a vector field and examining the output at a point $(x_0,y_0)$ reveals that Mathematica doesn't draw the tail of the arrow ...
12
votes
3answers
322 views

What is an efficient way of selecting multiple colors via Manipulate?

Background: The following snippet is what I (intend to) use in a Manipulate form where up to 12 different colors can be selected: ...
12
votes
1answer
185 views

Solve[ ] with Method -> Reduce gives a different result than Reduce[ ]

Why does Solve[Sqrt[x + Sqrt[x]] - Sqrt[x - Sqrt[x]] == m Sqrt[x/(x + Sqrt[x])], x, Reals, Method -> Reduce] give a different result than ...
11
votes
2answers
603 views

Find maximum value of interpolation function - obviously wrong result

Minimizing and maximizing interpolation function has already been asked and answered, see here for example. Yet, I observe a strange behaviour. Well, I can understand that the wrong guess of ...
11
votes
1answer
186 views

Unwanted PlotMarkers appear at non-existent places

In this simple code ...
11
votes
3answers
190 views

How to collect expressions from cells created by Print?

I have a notebook where evaluation of a certain cell produced hundreds of adjacent output cells using Print. I need to create a list containing all expressions from ...
11
votes
4answers
672 views

List comprehension in Mathematica

Python supports a concept called "list comprehensions". Following is sample example ...
11
votes
3answers
237 views

How do I put my packages into Dropbox

I don't want to necessarily put my packages in Mathematica's $UserBaseDirectory, which is on my local hard drive. Can I somehow tell Mathematica to look for ...
11
votes
1answer
197 views

How to find longest monotonic sequence?

I have a list, for example list = {2, 1, 3, 5, 4, 6} How to find longest ascending sequence of this list? There are two meanings of this question: Find the ...
11
votes
1answer
445 views

RLink and R v3.0.1?

Running InstallR["RHomeLocation" -> "C:\\Program Files\\R\\R-3.0.1"] results in a popup box titled "Version Mismatch" saying Error: R.DLL version does ...
11
votes
1answer
281 views

Overloading second argument of CountryData

For convenience I'm trying to add an extra property to CountryData ...
11
votes
4answers
690 views

Second level depth pure function?

I have the following working construction: Select[ln125, # == Nearest[ln125, 551.748][[1]] &] Here, ln125 is a one ...
11
votes
5answers
258 views

Construct an infix operation from a list

Inspired by this question, if I have a list {a, p, b, q, c} where p and q are binary ...
11
votes
3answers
932 views

Derivatives (divergence, gradient, curl) of interpolated 3D data

How can I calculate a vector derivative (i.e. divergence, gradient, curl) of interpolated data? For sample data, you can use: ...
11
votes
3answers
174 views

Emulating Sequence with my own function

I just considered if/how one could implement Sequence in Mathematica if it were not predefined. It turned out that the following simple definition has in all my ...
11
votes
2answers
602 views

Google Code Jam: Mountain View code review

After participating in Google Code Jam 2012 Round 2, it occurred to me that the Mountain View problem boiled down to solving a set of linear inequalities, which could be done in Mathematica. I've only ...
11
votes
7answers
326 views

Question about evaluation control

I want to make a function that takes a function as a parameter and prints an integral with the function inside. I've tried this: ...
11
votes
1answer
1k views

How to export transparent raster plots?

Is there an easy way to get transparent plots that work with Save Graphic As using a compatible file format such as GIF or PNG? I tried ...
11
votes
3answers
258 views

Numbers in alternate bases transcend the evaluator?

It looks to me like a number in a base other than base 10 gets evaluated before the evaluator ever gets a chance to be tweaked. For example, FullForm[16^^abcdef] ...
11
votes
2answers
667 views

How to plot a barycentric line

I want to plot a barycentric function on an equilateral triangle (ternary plot). For example f1 = {Abs[Sin[x]], Mod[x, 2], Abs[Cos[x]]}; At the moment I evaluate ...
11
votes
4answers
732 views

How do I get rid of the overlap of gridlines and tick mark labels?

I wish to include the plot generated by the following Mathematica code ...
11
votes
3answers
2k views

Poor rendering of fractals

Could someone explain why I get those ugly graphics .. ..trying to use fractals in mathematica 8 ? I'd also like to know if it is possible to draw 2D fractals in Mathematica My configuration ...
10
votes
5answers
820 views

The mysterious gap inside Grid

There's this gap inside Grid which I cannot seem to remove. Perhaps someone knows how. ...
10
votes
4answers
267 views

No response to an infinite limit

Trying to compute this limit, things seem to get frozen, even for hours. What would you recommend to fastly compute it? ...
10
votes
1answer
475 views

How do I place a texture on an irregular 3D model?

I'm trying to reproduce a textured head in Mathematica, and I'm using a kind of 'net' of a head which contains all the features on the face. The texture looks like this: which is supposed to look ...
10
votes
1answer
207 views

Is there a method to enumerate the keys/values of System`Utilities`HashTable

Lacking from the simple API of System`Utilities`HashTable is a method to enumerate the keys/values. ...
10
votes
2answers
381 views

How can I access the internal function that plots a molecule from a formatted XYZ file?

Mathematica has the ability to plot a molecule using the data contained in an XYZ file. This is a simple text file, of which this is an example. The molecule is plotted using the Import command. ...
10
votes
1answer
389 views

How to make a volume CUDA rendering isometric?

I just realized that the output of CUDAVolumetricRender[] uses (quite marked) perspective, which I do not want (for scientific data representation, it can be very ...
10
votes
1answer
648 views

NDSolve Differential Equation Error

I am trying to solve the following differential equation- ...
10
votes
1answer
202 views

Unexpected result from Flatten

Consider the following three evaluations involving Flatten: Flatten[f[f[f[x, y], 1, 2], f[x, y]], Infinity, f] f[x, y, 1, ...
10
votes
1answer
191 views

Why do DateList, DateString, and AstronomicalData ignore $TimeZone?

My reading of the documentation for DateList and DateString lead me to believe that both functions use ...

15 30 50 per page