2
votes
2answers
523 views

3N-dimensional integral

I'm trying to compute a multidimensional integral with a variable number of dimensions. The integral is as follows: $$ \int d^{3N}\!p~e^{-\frac{\beta}{2m}\vec p^2}. $$ I have tried this ...
0
votes
1answer
119 views

Is RemoveSymbolize the reverse of Symbolize?

why cann't I use RemoveSymbolize[ParsedBoxWrapper[SubscriptBox["_", "_"]]] to remove all subscripts? Just like ...
4
votes
2answers
569 views

What function returns all possible permutations with repeating list elements?

Let's say I want to find a sample space of such experiment: There are three exits from the box: Left (L), right (R) and front (F). Three mice have been put in that box. Find the sample space of an ...
1
vote
1answer
410 views

Drawing a quadrilateral inscribed within a circle

I would like to draw a quadrilateral inscribed within a circle. How can I construct this figure, taking into account arbitrary (specified) side lengths, while still ensuring that the vertices of the ...
2
votes
1answer
177 views

How can I specify the exact colors two Polygons in plots combined with Show?

I made two Polygons with different colors. Their names are p1 and p2. ...
-5
votes
1answer
120 views

Help in coding of differential equations [closed]

I need some help with Mathematica. How can I do the following? Starting with f = y[0]^2 (y[0] is basically y with 0 subscript) ...
0
votes
1answer
223 views

Why does memory run out when adding same-sized matrices in a loop?

I have written a module that it generates a 101x101x51 zero matrix at first. At every iteration, it generates a list by funct1 and based on this list, if list is empty it gives the previous result. ...
21
votes
2answers
2k views

How to form a block-diagonal Matrix from a list of matrices?

like this: I know join[...] works, but it is a bit troublesome for multiple matrices.I tried DiagonalMatrix[...], but DiagonalMatrix can only form matrix from a list of elements.
0
votes
1answer
132 views

Saving/exporting results from FindInstance and similar functions

I am dealing with a problem that requires the use of both FindInstance and FindRoot nested in a non-trivial way. The result is dependent on some parameter value $t \in [0,1)$, therefore I use ...
14
votes
1answer
272 views

Is the sharing of variables in Module/Block within Compile documented behavior?

Today I noticed something, I think for the first time. When used inside Compile variable values within Module (and ...
7
votes
3answers
155 views

Given a list of lists, build a list in which lists with equal first and last elements are grouped together

I have a list of lists, and I'd like to build a new list, in which lists are in the same list if they have the same first and last element. Here's an example. Suppose I have ...
3
votes
1answer
104 views

Is it safe to assign a variable and function of the same name for different things?

I'm writing out a notebook that goes through the van der Waals Equation of State for gases, and I run into a situation where I want to assign (simplified) Tc[b_]:=5b, use that to solve for b in terms ...
4
votes
1answer
423 views

Details about Symbolize

When I'm using Symbolize function, there are some details that I'm not sure. For example: ...
7
votes
4answers
381 views

How to set Block local variables by code?

I need to create a user defined Block function where the Block variables values are defined by code. For example, imagine I have: ...
3
votes
1answer
300 views

(Centered) Automatic Numbering of Figures

I want to create a figure caption cell style that prefixes a centred figure caption with Figure X, where X is an incremental number I have seen two methods for automatically numbering figures: ...
0
votes
1answer
116 views

Where do those nulls come from? [closed]

I have seen discussions of unwanted nulls in the output in the context of building lists with conditions on the elements, but that is not involved here. I would like to know where the nulls come from ...
3
votes
1answer
100 views

Contexts after Cell Grouping

I'm trying to separate my document into cell groups, each with their own context (much like the style of code isolation described by the answer here: Localizing variables within a Manipulate), but the ...
0
votes
2answers
488 views

Is it possible to use WolframAlpha servers to evaluate equations in Mathematica v8.0.4?

Is it possible to use WolframAlpha computational power to evaluate equations in Mathematica version 8.0.4? The thing is, it takes ages for my computer to evaluate certain equations. It would be ...
10
votes
2answers
476 views

Dynamic graphics are less responsive inside a Manipulate

I have some code which displays a GraphPlot and allows the user to click on any vertex in the graph to display some information about that vertex in a popup window. ...
5
votes
4answers
264 views

Manipulate flickering and consuming lots of CPU

I am new to Mathematica and was experimenting with a simply problem of plotting a tangent to a curve and being able to move the point at which the tangent is drawn using ...
3
votes
3answers
234 views

How to transform and swap columns of this matrix in a simple way? Version 2

So, earlier today I asked the question How to transform this matrix & swap its columns in a simple way? and was given useful and elaborated answers. Now, I'm still not used to the "Array", ...
0
votes
2answers
566 views

How to get complement from two matrices?

This is a special case of my question How to do nor on matrices? ...
3
votes
4answers
341 views

How to transform this matrix & swap its columns in a simple way?

I would like to transform matrix $\mathbf A = \begin{pmatrix} a&b&i&j\\ c&d&k&l \\ e&f&m&n \\ g&h&o&p \end{pmatrix}$ into matrix $\mathbf B = ...
3
votes
1answer
155 views

How to make a simple tree yourself with defined distances for each generation?

I'm trying to make a function that generates a tree for spin spin analysis in spectroscopy. I though it would be pretty easy, but I'm totally stocked. The tree should look something like this: ...
0
votes
1answer
153 views

How to do nor on matrices?

Supose I have matrices a b and c like a = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; b = {7, 8, 9}; c = {{1},{4},{7}}; I want to get ...
5
votes
2answers
433 views

How to declare a function of variable?

In my program, there are many functions relying on spatial coordinates: x, y, and z, which are also functions of time t, i.e., composite function. I need to differentiate some functions for example f: ...
3
votes
1answer
147 views

Creation of name.m Package

I have a structure of folders. Main Directory( has init.m, and name.m files) Subfolders under Main directory library ( has the packages, pacakge1.m, package2.m) Data (some xcel sheets and other ...
0
votes
1answer
2k views

Complex line integral

Can someone recommend an online article or introductory tutorial that will show me how to do real and complex line integrals using Mathematica?
7
votes
2answers
666 views

How to change an expression to Fortran90 form?

I have a large expression produced by Mathematica. To use this expression in my Fortran program I need to change it to a Fortran90 form. I am not satisfied with the ...
0
votes
0answers
97 views

DensityPlot on spherical surface? [duplicate]

I just checked this example Construct a Globe Showing All Weather Stations. It looks good, but I would like to add a density plot of the stations on the spherical surface. This can be done with the ...
7
votes
2answers
130 views

Method that can be used to collect the variables of a function

Suppose we have a function f[x, y, z] and we want to get all its variables Sequence[x,y,z], what method can we use then? The ...
12
votes
2answers
595 views

Simplify assumes Boolean 1 and 0 in logical expressions

Per this chat discussion and this previous question where I encountered the strange behaviour: ...
9
votes
2answers
2k views

Badly conditioned matrix (General::luc)

With some matrices I am receiving the following message ...
4
votes
1answer
384 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
379 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
196 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
201 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
244 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
194 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
223 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 ...
111
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
187 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 ...
8
votes
2answers
361 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
827 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
108 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
152 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: ...

15 30 50 per page