2
votes
1answer
1k views

Constructing variable names from a string

I have groups of descriptive variable names and dont want to write explicit code for each group, e.g. (and this is a contrived simplification) ...
3
votes
1answer
208 views

How to align grid dividers of inner grids in a grid?

How to have the vertical dividers of inner grids aligned to each other in the following? ...
6
votes
1answer
429 views

The difference between “SymbolicProcessing” -> 0 and restricting the function definition to numeric values only

The Documentation tells us that there are two ways to disable symbolic processing of the integrand by the NIntegrate function when it is known that it just slows ...
3
votes
3answers
440 views

Limiting form of a polynomial expression

When simplifying an expression by hand, a trick that is often used is to remove terms that are lower powers of the independent variable, for instance, as $x \rightarrow \infty$, $x^2 + x$ becomes ...
5
votes
1answer
244 views

Resolving reduced resolution issues in WSMLink

I have been attempting to evaluate Wolfram System Modeler (WSM) and it has not been going smoothly. It looks like some of the Modelica Models (combiTable1D for instance) supplied are not complete or ...
15
votes
6answers
2k views

Visualize Pascal's triangle and other triangle shaped lists

How can Pascal's triangle be visualised like this in Mathematica? Or more generally, how can a 'triangular' list like {{1},{1, 1}, {1, 2, 1}} be visualized in ...
8
votes
1answer
439 views

Generating dynamic Inputfields

I want to create a bunch of input fields, four in this case, one for each element of the list "x", but since Dynamic has ...
7
votes
3answers
543 views

Shading regions in ParametricPlot

I am using ParametricPlot to get an X vs Y plot. I want to shade the area enclosed by the curve falling in the region where Y<0. For example, how to shade the area enclosed by the Sin curve where ...
11
votes
2answers
2k views

How to change the style definitions for Default.nb?

I have looked over other questions related to style definitions, and looked through the Mathematica 8 documentation, but I do not know why I am having so much difficulty setting the default font in my ...
0
votes
1answer
326 views

StringJoin/FileNameJoin doesn't quite work in script

My mathematica script is as follows: ...
2
votes
3answers
177 views

How do I interpret the following syntax?

I have been given some code with the following line PeriodicExtension[g_, x_] := If[Abs[x] < Pi, g[x], PeriodicExtension[g, x - 2 Sign[x] Pi]] I do not ...
3
votes
2answers
507 views

Precision of number not maintained when saved via Export

Assume that the output of my calculation is a and is a number such as: a = 100.1252135246354847; ...
27
votes
5answers
2k views

Identifying critical points of 2/3D image/cubes

Upshot I am interested in identifying critical points of a 3D field/cubes (maxima, minima, tube-like and wall-like saddle points) and 2D field/image (maxima, minima, saddle points). I.e. the ...
3
votes
9answers
1k views

How to find palindromic numbers (Project Euler #4)?

I'm trying to solve the fourth Project Euler's problem with this: ...
0
votes
1answer
838 views

How to plot the convolution of dirac delta series with a sine function [closed]

I am new to mathematica. I do the convolution of dirac delta :(DiracDelta(x-10)" with "sine(t),t=0-pi". How to plot the output ? Theoretically, the full wave should appear at the location of the ...
7
votes
3answers
238 views

How can I efficiently check if a graph is unit distance?

A unit distance graph is a graph that is embeddable in the plane so that every edge has length 1. ...
15
votes
1answer
564 views

Why are all the lines commented when I create a Mathematica script?

When I created a Mathematica script, I found that all my lines were commented out (when opened with vi or gedit or any other ...
4
votes
1answer
167 views

Where can I find a list of functions, specifically views, that can be translated to a C standalone executable?

I want to create a standalone mathematica executable. I would like to have some view capabilities like CreateDialog or TabView or those kinds of things. I would like my users to have an interface to ...
1
vote
2answers
197 views

How to arrange a list on a triangular pattern?

I've made a multiplication table with this: Then I removed the repeated permutations with: gg = Range[1, 10]; Subsets[gg, {2}] // TableForm Now, when the ...
6
votes
2answers
144 views

Why is StringMatchQ[“IP1”, “IP”] returning False?

Maybe there is a knot in my head, but I would expect that StringMatchQ["IP1", "IP"] should return True (which it does not) ...
6
votes
0answers
774 views

Limiting the use of discrete graphics card on Mac

Apple's laptop running Mac OS have a pretty nice feature to make the battery last longer: the dynamically switch between the low-power integrated graphics card and the higher-performance dedicated ...
26
votes
4answers
3k views

Density plot on the surface of sphere

I would like to make density plots of a list of (size 2 or 3) spherical harmonics on the surface of a sphere. I'd like to plot it so that each element of that list is using a different color (red ...
5
votes
3answers
166 views

Creating a Tooltip that knows what platform is currently being used

I have Mathematica 8 on my PC. I also have a new Mac with CDF-player, but not Mathematica. I want a Tooltip that shows one thing if running on a PC, and something ...
0
votes
2answers
633 views

Plotting multivariable integration

If I have a multivariable integration like NIntegrate[x^2 + y^2, {x, 1, 5}, {y, 6, 10}] But I need to plot its result in terms of ...
6
votes
1answer
271 views

ArrayPlot with cells labeled by corresponding values

I would like to have ArrayPlot[] also present the value of each cell in it, similar to the LabelingFunction that is available in ...
4
votes
2answers
163 views

Standardizing a coset table via matrix manipulation

Suppose we have a group $G$ and a subgroup $H$. A coset table encodes the permutation representation of $G$ on the right cosets of $H$. When we want to use these coset tables in calculations, it is ...
3
votes
2answers
759 views

Numerically Solving two dependent Transcendental Equations

I need to solve a system similar to the following (Except it is quite large. Solving this ought to do the job): $$ \tan[2f(t)] = 1+ t^2\ $$ and $ f(t) $ is $ k $, such that$$ \tan[2kt]-(1+k^2) = 0\ ...
5
votes
4answers
583 views

Swap two entries in a matrix

Is there a nice, simple script one can use to swap two entires in a matrix? For example, suppose we have the matrix below: $A=\begin{pmatrix}2 & 4 & 1\\ 3 & 1 & 2\\ 4 & 3 & 1 ...
8
votes
3answers
1k views

How can I rationalize the denominator of an expression?

Mathematica doesn't rationalize the denominator automatically, and I haven't found anything in the documentation about it. But I found an old post on MathGroup, which proposes a solution using ...
1
vote
2answers
276 views

Calculating the Mean of a Truncated Multinormal Distribution

First, I'm a little disappointed that Mathematica balks at: Mean[TruncatedDistribution[{{0, Infinity}},MultinormalDistribution[{0}, {{1}}]]] Second, is the ...
11
votes
4answers
291 views

Thread a function over a list and with a non-atomic 2nd parameter?

From the documentation, Thread's behavior on functions where the first parameter is a List and the second is an atomic expression, is this: ...
8
votes
2answers
747 views

How to find the maximum value of an integer that satisfies some inequality

Consider the following Mathematica expression: Reduce[2^j/(j + 1) <= 10, j, Integers] which outputs: ...
0
votes
1answer
353 views

Getting Internal Self-Test Error

I have two questions related to this simple code: ...
18
votes
2answers
1k views

Mathematica vs. $\LaTeX$? Replacement for Legacy “Authoring Tools” package?

I'd rather write in Mathematica than in $\LaTeX$, but it's not really practical, especially for big works (> 100 pages) without good tooling. I'm just starting to look into what's available for big ...
1
vote
2answers
226 views

Symbolically associate vectors and their norms

I am wondering how to handle the following situation: I do have vectors of known dimension that I would like to handle symbolically. I suppose I can do something like ...
11
votes
2answers
1k views

Sorting a list with secondary criterion

Is there an easy way to sort a list on multiple levels of criteria? By this I mean, first the list should be sorted according by criteria A (the same as using the usual sort function, ...
3
votes
2answers
283 views

Combinatorica: Girth[] and FindCycle[] disagreement

Warning: run the following code in a fresh Mma session, as some symbols could be shadowed (depending on your Mma version) While trying to answer this question, I fell into the following: ...
7
votes
1answer
180 views

Asking for input in an event handler

Why won't EventHandler["text", {"MouseClicked" :> (output = Input[];)}] work? When I click "text" the kernel hangs.
10
votes
1answer
257 views

Why doesn't Mathematica pack Boolean arrays?

I've been wondering about this for a while now, so I'm going to ask. This is a question about the design of Mathematica, which perhaps cannot be directly answered by anyone but the designers, however ...
6
votes
3answers
528 views

Changing background colour of a Manipulate element

Please consider the following: Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}]; Now, I would like to change the background colour to yellow. I tried ...
20
votes
3answers
557 views

Computing polynomial eigenvalues in Mathematica

MATLAB offers a function polyeig for computing polynomial eigenvalues, which appear, for instance in quadratic eigenvalue problems (see here for some applications) such as: \begin{equation} ...
4
votes
1answer
312 views

pH calculations, speeding up code involving Solve

I'm trying to calculate pH values of solutions containing water and acetic acid. The relevant equations have been defined and I now want to find a solution using Mathematica. For a specific acid ...
2
votes
2answers
100 views

What is the best way for an application to provide customisation options for the user?

Suppose that an application needs to be configured specifically for a user's system. e.g. the application needs to be told the location of certain data directories. What is the best way to provide ...
9
votes
5answers
330 views

Finding first instance of a relationship between elements in two lists

Suppose I have two lists, say: A = {1,5,10,200,50,7} B = {4,3,19,78} For each element in A, I would like to find the index of the first element in B which ...
6
votes
3answers
366 views

How to properly remove the CUDAResources paclet?

I have Mathematica 8.0.0.0 installed on my Mac, and while I tried to see what it could do with CUDA, it downloaded a large directory (~1 GB) named ...
14
votes
3answers
834 views

How can I tell mathematica to generate an histogram from nominal data?

If I write: Histogram[{1, 1, 1, 2, 2, 2}] I get a nice histogram chart but if I write ...
2
votes
1answer
74 views

Why do syntax errors make a 8.` run through $PreRead in a TagBox?

Modified code from the help file on $Pre: ...
4
votes
2answers
140 views

How do I mimic the functionality of “<>”?

The Cell expression for: <> is Cell[BoxData["<>"], "Input"] However similar expressions are parsed into ...
27
votes
12answers
1k views

Map a function across a list conditionally

It seems that this is a really basic question, and I feel that the answer should be obvious to me. However, I am not seeing. Can you please help me? Thanks. Suppose I have a list of data ...
2
votes
2answers
681 views

Manipulate a Differential Equation result

I want to Manipulate the result of Differential Equation like : ...

15 30 50 per page