4
votes
1answer
371 views

iterating piecewise linear maps on [0,1]

I have been trying to make code work for iterating piecewise linear maps on the unit interval in Mathematica to compare with MATLAB and Maple. Tent and logistic maps are easy to implement but ...
4
votes
1answer
367 views

NDSolve problem with matrix valued function

I got a strange problem when using NDSolve to solve a matrix value function σ[t] = {{σx[t], σxy[t]}, {σyx[t], σy[t]}} when I ...
8
votes
3answers
301 views

Patternmatching sets

How to match set-patterns against sets? A set (in the mathematical sense) is a list of elements without repetition and order of elements does not matter. For example, we have a pattern set ...
5
votes
1answer
194 views

Using CellPrint with a TraditionalForm string

I am trying to use CellPrint to print a cell that asks a user to solve an equation. This equation is randomly generated right beforehand, and I would like to have it print in Blue. The whole Cell ...
5
votes
2answers
431 views

Contour plot doesn't look right

I have an implicit function expression ...
0
votes
2answers
199 views

Number of edges to each polygon of a graph constructed from an image

I have an image which looks like from How to convert an image to a graph and get the positions of the edges? which by using MorphologicalGraph becomes a graph ...
0
votes
1answer
239 views

Why does my attempt at parallelization not work?

I want to run some function with different parameters, parallel on 4 cores (i5). When I run it without using Parallelize, processor has ~25% utilization. It's a ...
1
vote
0answers
190 views

Automatic inverse for Lambert’s Azimuthal Equal-Area Projection

I’m interested in finding closed-form inverses for map projection equations in general (of course, this is not always possible). I’m hoping Mathematica can help me with some of the trickier ones. As ...
3
votes
1answer
235 views

An ancient MIDI keyboard?

There is a demostration project http://demonstrations.wolfram.com/KeyboardAndComposer/ where you can compose Western music using a 97 keys simulated midi keyboard. I study eastern and ancient music ...
4
votes
2answers
222 views

Partition a set into $k$ non-empty subsets

The Stirling number of the second kind is the number of ways to partition a set of $n$ objects into $k$ non-empty subsets. In Mathematica, this is implemented as ...
110
votes
1answer
21k views

Mathematica Minecraft

Some time ago I asked myself: with all these great graphics and interactive capabilities of Mathematica, what kinds of 3D games can be implemented in it? And the answer which came to mind is ...
11
votes
1answer
245 views

Is it possible to use Compile on a function with optional arguments?

My Mathematica is a little rusty, so apologies in advance. I think my problem is quite simple, but I can't seem to find the answer on my own! Simple example : ...
8
votes
2answers
184 views

How do I write a function that can be used in a rule to modify both sides of an equation? [duplicate]

I sometimes need fine grain control over equations in Mathematica in order to help me understand how to solve a problem manually. A greatly simplified example of a session might be something like ...
6
votes
2answers
329 views

Distorted graphics when using custom ticks and AspectRatio -> Full

I am having a problem using custom tick specifications along with AspectRatio -> Full. The problem affects both Ticks and ...
1
vote
3answers
813 views

Finding the square root of a random number with Newton's method, using While/Do/For loops?

I am trying to construct a program that will find the square root of a number, using Newton's method, which is $$x(n+1) = x_n- f(x) / f'(x_n)$$ The number, will be a random number, generated by: ...
2
votes
0answers
107 views

Strange double evaluation using MorphologicalGraph

(MMA 9.0.0 on Mac OS/X 10.8) Please consider the following snippet (this is as SMALL as I could make it -- my attempts at making a smaller repro-case eliminated the effect that I am investigating) ...
1
vote
1answer
150 views

Efficient way to give symbolic elements symmetry

I have a symbolic expression that represents a set of operators. These operators have quite a bit of symmetry to simplify expressions: ...
16
votes
1answer
206 views

Exclude Sections/Subsections/… from evaluation

I'm working on a large notebook and I want to exclude some sections and subsections from being evaluated when I evaluate the whole notebook. Is there a way to exclude specific sections or ...
0
votes
1answer
320 views

NIntegrate Error-Estimate Question

When I do some complicated 4-dimensional integral numerically, Mathematica tells me its estimate for the value of the integral, and its estimate for the value of the error in the calculation. The ...
1
vote
2answers
831 views

How to make plot with frame and two different scales on the x-axis (CMB power spectrum example)

Let us take CMB spectrum as an example. I get data of $C_l$ as a function of multipole moment $l$. Also, multipole moment is a function of angular scale. The question is: how to make a plot with a ...
2
votes
3answers
873 views

Why doesn't Mathematica make an obvious simplification?

I am doing some calculation with summation and the Kronecker symbol. Here are my steps : ...
2
votes
2answers
1k views

Product of Fibonacci numbers using For/Do/While loops

I want to find the product of the first 20 Fibonacci numbers (the fibonorial). I want implementations using While, Do, and ...
7
votes
3answers
316 views

Piping and Replacement

I haven't been able to figure out how to use piping with certain functions. Specifically, I would like to apply a replacement at the end of a pipe, like the following: ...
2
votes
2answers
1k views

Faster way to convert real strings into numbers [duplicate]

Working with big files, I have to convert some numbers that are in string format into real MMA numbers. I know that I can use ToExpression but it's slow when ...
2
votes
1answer
214 views

Grid generation around airfoil from data

Here is the data http://wikisend.com/download/405620/datapoints.dat I have (x,y) data for a grid around an airfoil and I am trying to figure out how I can draw radial and polar lines for the grid to ...
3
votes
2answers
211 views

How can this DivisorSigma code be made fast?

Since Project Euler problems are now fair game for questions I have a question of my own. A certain problem* states: For a positive integer n, let σ2(n) be the sum of the squares of its ...
2
votes
1answer
435 views

Importing data sets from plain-text files and performing operations on them

I am working with a lot of daily weather files in the txt format. I need to calculate a daily quantity from each of them, e.g., daily light intensity, which ...
3
votes
3answers
517 views

Sum of Multinomial Coefficients

Basically, I want to write a function to compute the following sum $f(m,L):=\sum_{0\leq k_1,\cdots, k_n\leq m} \binom{m}{k_1,k_2,\cdots k_n}$ and $\mathrm{supp}(k)=L \subseteq \left \{ 1,...,n \right ...
3
votes
1answer
4k views

Quick Hessian matrix and gradient calculation?

I am absolutely new to Mathematica and I actually want to try implementing a little optimization method . Long story short assuming I have a predefined two-variable function f(x,y) I want to ...
6
votes
1answer
211 views

Obtaining standardised regression coeffiecients

Regression coefficients are the constant that indicate the rate of change in one variable as a function of change in another. Standardised regression coefficients are the same, but refer to a change ...
3
votes
2answers
131 views

Find condition under which variables fall away

I have a somewhat lengthy expression, looking like expr = 1 + x + b + Pi + 2*a Is there some way of generating a relationship between ...
-1
votes
1answer
297 views

Where is KeyEventTranslations.tr in Mathematica 9?

I can't find the file in it's usual place /Library/Mathematica/FrontEnd/... was it removed?
1
vote
2answers
615 views

Parametric plot from two NDsolve solutions

I have two independent ODE systems. A = NDsolve[..., {x, y}, {t, 0, 10}]; B = NDsolve[..., {a, b}, {t, 0, 10}]; I can draw a ...
6
votes
0answers
290 views

Reproducing the Integral Definition of the Modified Bessel function

I need to simplify some integral expressions in terms of special functions, such as the modified Bessel function of the first kind. See for example Eq. (5) on this page. Notice that the real ...
6
votes
2answers
1k views

Is it possible to do vector calculus in Mathematica?

I am trying to rearrange and manipulate some vector differential equations in Mathematica. As far as I understand you have to tell Mathematica that a variable is a vector by specifying the components ...
1
vote
1answer
240 views

Summation of If statements

The following made me curious. Suppose you want to sum the if statement If[x[i] < 1., x[i]^2, 0.] over i=1,2, i.e. ...
2
votes
1answer
230 views

Directional derivative of SiegelTheta

I'm working on a problem where I have to integrate both the Mathematica function SiegelTheta and some of its second order directional derivatives. Using the function works well but something goes ...
11
votes
4answers
490 views

What is a good way to plot some difficult implicit equations?

Here are several equations, it seems that Mathematica couldn't plot them well, although I set PlotPoints>100 ...
4
votes
2answers
312 views

Improve performance and style of solution to Project Euler #32

Since I'm fairly new to Mathematica, I'm trying to learn better ways to improve my coding skills so I've turned to Project Euler and this site to speed up my learning pace. Anyways, I was trying to ...
0
votes
1answer
231 views

Create heat map from RMSD values

After looking through these forums for answers that could work for my problem, I could not find anything. I want to make a heat map comparing values that are in a nested list. That is, I have a ...
-1
votes
1answer
858 views

How can I make a plot of the Higgs potential?

I was wondering, how would could I make a drawing of the Higgs potential aka "mexican hat potential". I am quite new to Mathematica and don't know where to look to learn how to implement such a ...
20
votes
2answers
2k views

What are the possible ways of visualizing a 4D function in Mathematica?

I have a function $F$ that maps the xyz space to a set of reals, more clearly: $c = F[x,y,z]$ Where $c$,$x$,$y$ and $z$ are reals. What are the possible ways of visualizing this 3d function in ...
3
votes
2answers
135 views

Get DownValues that do not involve patterns?

Say I have a function with a few definitions that also implements memoization: f[x_] := f[x] = x^2 f[x_, y_] := f[x, y] = x^2 + y^2 I then apply the function to ...
8
votes
4answers
393 views

Best way to modify values in a list of rules?

Recently I had to solve a problem similar to this: Let's say I have a list of list of rules ...
3
votes
1answer
146 views

Evaluation order of Button[]'s action

it looks like it should be well known issue but I haven't found answer anywhere. Please tell me why the result (after clicking) of this: ...
14
votes
2answers
350 views

Why use Column with Rows instead of Grid?

In general, what are the advantages of using Grid versus a combination of Column and Row? Is Grid better in some situations but not others? For example, is there any reason why one would do this: ...
3
votes
1answer
465 views

How to label the Vertex and, or Edge labels with their weight

I noticed that the Mathematica 9.0 documentation only mentions the usage of "Name" to label the vertexlabel or edgelabel in the Graph. Is there an option to use the Weights automatically just as ...
10
votes
1answer
233 views

Forming Cone with Tube fails to work in version 9.0.1

I use two different radii in a Tube expression to draw a cone. I know for a fact that this worked in Mathematica 8, but when I reevaluated my code in versio 9.0.1 ...
34
votes
3answers
3k views

Image processing: Floor plan - detecting rooms' borders (area) and room names' texts

Here is a simple building floor plan. I would like to derive the rooms as (rectangular) components and the names of the rooms. This is very common representation of building floor plans. The ...
14
votes
1answer
2k views

Compare C++ Standard Library's Mersenne Twister with Mathematica's Mersenne Twister

The C++ standard library does contain a set of random distribution classes, among other things a Mersenne Twister engine. What I'd like to do is to generate the same random number distribution, using ...

15 30 50 per page