23
votes
4answers
954 views

How to find out the (current) free memory on the system?

Is there any way in Mathematica to find out the currently free memory on the system Mathematica runs on (like the utility free shows on the command line)? I've ...
28
votes
4answers
2k views

Importing videos in Mathematica

Mathematica's Import command is purportedly able to import .AVI files. However, I find that many files that I want to import do only result in MMA showing a blank ...
20
votes
6answers
3k views

Using ListPointPlot3D to simulate 2D plots moving in time

I wrote a 1D solver for the heat equation $u_t=u_{xx}$, and I can animate the solution using normal ListPlot command, where the x-axis is the rod length, and the ...
9
votes
2answers
170 views

How to force neat linewrapping in Print?

I am regularly annoyed by the fact, that a neatly arranged Print statement gets ruined by a large piece of data, which - instead of linewrapping "in place" - is ...
8
votes
1answer
275 views

How to check for Mathematica’s definition of XY?

The question is: Can I ask the Mathematica kernel directly what it takes as the definition of the built-in symbol XY? After all this has to be in the kernel. And if the documentation is not giving any ...
54
votes
5answers
27k views

Get a “step by step” evaluation in Mathematica

Is it possible in Mathematica to get a step-by-step evaluation of some functions; that's to say, outputting not only the result but all the stages that have led to it? Example : Let's say I want to ...
35
votes
3answers
2k views

How to find out which method Mathematica selected?

There are commands like NonlinearModelFit[] or NDSolve[] that have the option Method it ...
53
votes
5answers
4k views

ListPlot: Plotting large data fast

Mathematica produces fantastic-looking graphics, but it can be slow on large data sets. Here is an example for a (random) time series: ...
21
votes
3answers
1k views

Sum over n variables

What is the most painless way to sum over n variables, for example, if the range of summation is $i_1 < i_2 < i_3 < \dots < i_n$, where $n$ is an argument of the function in question? Is ...
17
votes
5answers
463 views

Change syntax from other programs to mathematica syntax

Is there a good way to transform syntax from other computer algebra systems or from latex to mathematica syntax?
24
votes
1answer
419 views

which is better, using Assert[] or manual checks on arguments and other computations?

I never used Asserts in Mathematica, but trying to see what advantage they have over just argument check and additional definitions of the function to capture unwanted input. For example, which one ...
16
votes
2answers
694 views

Plot Option Precedence while combining Plots with `Show[]`

I like to build sophisticated plots by combining simpler ones with Show[]. Typically this involves setting non-default Plot-Options with the different ...
29
votes
3answers
2k views

Saving Mathematica kernel state?

If I save a notebook, I only save what I see. That is, if I close Mathematica and reopen the notebook later, all previous calculations are lost, except for those things I've output. Now I know that ...
7
votes
1answer
216 views

Can the Notation function support complex structures on its left hand side?

In my investigation of the possibilities offered by the Notation package, I came over a limitation in the complexity of the left hand side symbol. For instance, although I am able to enter ...
53
votes
2answers
2k views

Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...
13
votes
2answers
280 views

Difficulties in creating strict and robust equivalence between two symbols using the Notation package

I am investigating the use of the Notation package facilities to create strict the equivalence between pretty-printed symbols such as ...
18
votes
4answers
551 views

Continuous evaluation of complex calculations

When having a first look at some system, it's often very useful to just play with the parameters and see how it develops. Therefore, I would like to let a certain evaluation run "until I cancel it". ...
10
votes
1answer
386 views

Manipulate evaluation sequence

Manipulate doesn't always evaluate in the order I expect it to. What is the evaluation sequence for Manipulate and other ...
41
votes
4answers
2k views

Speeding up this fractal-generating code

I used the code below (which is a sample from this gist containing more similar code) in my answer to my own question about Mandelbrot-like sets for functions other than the simple quadratic on ...
27
votes
2answers
2k views

How can I improve the speed of eigenvalue decompositions for large matrices?

I often need to compute the eigenvalues of large matrices, and I invariably resort to MATLAB for these, simply because it is much faster. I'd like to change that, so that I can work entirely inside my ...
8
votes
2answers
568 views

What causes Manipulate to stop evaluating expressions?

I'm working on a N-body simulation within Mathematica, and currently I have something along these lines: ...
89
votes
2answers
3k views

What is the distinction between DownValues, UpValues, SubValues, and OwnValues?

When reading through the documentation, you often encounter the phrases DownValues, UpValues, ...
14
votes
3answers
1k views

How can I ensure graphics exported in WMF format don't have text-spacing problems?

A lot of my work involves manipulating data, drawing a pretty plot of it and then inserting that graphic into a report written in Microsoft Word, under Windows.1 The fun comes with the exporting part. ...
11
votes
1answer
213 views

Choosing among different function definitions without sacrificing speed

I'm working on some code that numerically integrates a function, let's call it G, which calls another function, F, that can be ...
10
votes
1answer
375 views

Creating custom notation

How does one generate custom symbols? For example, the physicist notation for the rotation is "nabla cross function". In this case however, Mathematica complains that the ...
16
votes
4answers
731 views

How can I randomly generate a unique, unused symbol?

In a previous question on collecting terms for a multivariable polynomial, I answered with a solution that required a unused symbol to be used for a temporary substitution and back substitution. It ...
16
votes
1answer
517 views

What are the exact guidelines for what is allowed in a CDF?

I have read the guidelines published by Wolfram (these are restricted: non-numeric input fields, dialog windows, and data import and export) but I have a CDF that seems simple enough and seems to ...
15
votes
2answers
192 views

Clearing a specific definition

Consider the case where a symbol has multiple definitions attached to it, a /: Subscript[a,2] := 1 a[b_] := 2 a[b_, c_] := 3 How does one clear (/unset/remove) ...
9
votes
2answers
709 views

How can I get Overlay to position graphics according to coordinates?

If I draw graphics like this, I get exactly what I need: Graphics[{{Blue, Disk[{0, 0}, 10, {0, Pi/2}]}, {Red, Disk[{0, 0}, 3, {0, Pi/4}]}}] But I need to ...
35
votes
3answers
4k views

Best way to give presentations with Mathematica

I have typically used PowerPoint or plain PDFs of slides to give presentations, but with heavy mathematical content, it can be tedious to create these presentations and make them look good. How can I ...
34
votes
4answers
2k views

How can I implement dynamic programming for a function with more than one argument?

Dynamic programming is a technique for avoiding the repeated computation of the same values in a recursive program. Each value computed is immediately stored. If the value is needed again, it is ...
14
votes
2answers
1k views

Texture mapping and resizing a sphere primitive in Mathematica

Background Info In Mathematica, it's only possible to texture map a sphere through the use of SphericalPlot3D or ...
12
votes
7answers
596 views

How to use Union on list of lists without sorting them first?

If I do ClearAll[a, d] lsts = {{a, d}, {a, d}}; Union[lsts] I get the expected answer {{a, d}} but if I do ...
21
votes
1answer
905 views

How to create regular (planar) graphs?

How to programmatically create and plot regular planar graphs with $k = 3, 4$ or $6$ (not hypercubes) and regular nonplanar graphs of $k = 8$ (see figure)? Note that what matters is the average ...
12
votes
4answers
741 views

Is there a way to Collect[] for more than one symbol?

Oftentimes you find yourself looking for polynomials in multiple variables. Consider the following expression: a(x - y)^3 + b(x - y) + c(x - y) + d as you can ...
25
votes
4answers
576 views

Is it possible to invoke the OEIS from Mathematica?

I had always wondered if there might be a way to write a function, which I'll call OEISData[], that more or less works as a curated data function for The On-Line ...
13
votes
1answer
362 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? ...
76
votes
1answer
3k views

File-backed lists/variables for handling large data

Background Currently I am working with some large data (most of it generated by Mathematica itself). I usually find it a hassle to do this. For example, I just exported a large amount of data to ...
11
votes
1answer
706 views

How to run mathlink external commands in parallel?

I have an external function called increment (for the sake of illustration) that I call from Mathematica using MathLink. I.e., ...
16
votes
2answers
811 views

RegionPlot is producing odd gaps, even for simple functions. Is there an option to prevent this?

When I use RegionPlot to plot the region between two functions, I get strange gaps in the resulting figure. Is there a way to prevent this from happening? For ...
293
votes
12answers
52k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
37
votes
10answers
2k views

Can Mathematica propose an exact value based on an approximate one?

Sometimes, I use Mathematica to do some hypothesis on homeworks to make the question easier. For instance, when I have to compute big sums when $n\to\infty$ and Mathematica can't give the exact ...
18
votes
3answers
2k views

How to symbolically do matrix “Block Inversion”?

Consider a block (partitioned) matrix matrix = ArrayFlatten[{{a, b}, {c, d}}] where, a, ...
20
votes
2answers
581 views

Is there a way to have Plot draw points on a function where the function is undefined as circles as in textbooks?

A very common feature of graphs of functions used throughout textbooks are simple indications, such as open circles, of the points at which a function is undefined. Is there a way to do this in ...
12
votes
1answer
369 views

Generating a topological space diagram for an n-element set

Over on StackOverflow I asked a similar question for the n=3 case, but the answer given doesn't easily generalize. How can I make a diagram such as this: But for a general n-element space ...
22
votes
3answers
2k views

How can I embed a Manipulate (or other interactive graphics) in my website using CDF?

The new CDF (computable document format) lets you embed a Manipulate or other interactive graphics on your website, and users can play around with your little ...
46
votes
4answers
1k views
30
votes
4answers
663 views

Usage of \[InvisibleApplication] and other related invisible characters

From the front end, \[InvisibleApplication] can be entered as Esc @ Esc, and is an invisible operator for @!. By an unfortunate ...
11
votes
3answers
363 views

Why do buttons with ChoiceDialog freeze the front end?

Pressing the button below will freeze my front end. An unpainted white dialog box comes up, then it completely freezes, and I need to forcibly kill the front end. CPU usage stays at zero during ...
15
votes
3answers
229 views

What is the most convenient way to change options for Graph[] objects?

What is the most convenient way to change options such as VertexLabels in existing Graph objects? (Version 7 users note: ...

15 30 50 per page