All Questions

5
votes
1answer
111 views

Why DateDifference returns machine number?

Is there any specific reason why DateDifference cannot give an exact number in this case? ...
2
votes
1answer
232 views

Drawing an implicit function using ListPlot with a constraint on the solution [closed]

I need to plot a complex implicit function, ContourPlot in this case is not very convenient for me. Therefore, I want to plot my function using discrete points. I ...
36
votes
1answer
772 views

Export Code to Pseudocode?

I'm writing a paper and all my code is in Mathematica. The snippets are mostly simple, and consist of loops, maps, variables, and conditionals. I'd like add it to my paper, however, not many academic ...
1
vote
1answer
76 views

Assigning Variables for Degree Distribution [closed]

So my code is divided into 3 different sections: 1) Calculating clustering coefficient, 2) Extracting degree distribution 3) Using the degree distribution to get the mean of 1000 networks. ...
2
votes
0answers
116 views

Question about Solve

I don't understand what Mathematica is doing to get these solutions. I ask it to solve two equations, the left hand side of both expressions are the same, the right hand sides differ by a ± sign. I ...
2
votes
1answer
111 views

Function to differentiate between date pattern and specific string format

I'd like to write a function that behaves one way when the argument is a Mathematica date, such as {2013,12,15}, or with added hours, minutes and seconds if ...
2
votes
0answers
97 views

How to solve system of differential equations of arbitrary order (symbolic tensors)?

I am interested in solving systems of ODEs symbolicly, keeping things with arbitrary dimensions for clarity. For example, assume that $x, f(x) \in R^N$ and $A \in R^{N \times N}$, how do I solve ...
3
votes
2answers
77 views

Cell copy results in jaggy, aliased output

When I copy a cells by selecting them from the collapse bars on the right, then using the context menu option "Copy", the pasted image of plots is not anti-aliased and in general the text seems to ...
2
votes
3answers
266 views

Animation is jerky, but slider is not

When I do the following simple animation (from the book Mathematica Navigator, p. 316) the slider control changes the image smoothly, but when I play the animation it is jerky. Is there anything that ...
3
votes
1answer
113 views

Frontend coloring of Table[x, {x, 0, x}]

I have a small question about how the Mathematica frontend colours in the variables that appear in (wrongly written) iterators. More specifically, I'm intrigued by the colour of the third ...
2
votes
2answers
71 views

Optimize recurrence output

I have recurrence and I need to calculate first $N$ members of the sequence ...
5
votes
1answer
244 views

Symbolic linear algebra

I would like to know how I can ask Mathematica to expand (and simplify) such an expression : $$ (\alpha A + \beta B)^\top (\alpha A + \beta B) $$ where $\alpha,\beta$ are two real numbers and $A,B$ ...
11
votes
3answers
233 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 ...
1
vote
1answer
83 views

Evaluating an ItoProcesss function

The following is my Stochastic D.E.: ...
2
votes
0answers
93 views

Error message from V6.0.3 on Mavericks

With Mavericks, everything works fine except saving documents -- then I get this error: Internal self test error MacDialog | c | 2 Fixes? Ideas? Any help appreciated.
2
votes
1answer
174 views

How to create a SparseArray satisfying multiple conditions on Parts and Elements of a Matrix?

I have a matrix m1 of size $3 \times 19$. Rows $1$, $2$ and $3$ represent $3$ different groups, and columns represent $4$ different blocks: block1 - columns $1$, ...
1
vote
1answer
158 views

Mathematica won't simplify multiplication by zero

I'm getting a huge output, but it appears that almost every term should actually be zero, unless I'm misunderstanding the expression. For example, part of the output reads ...
3
votes
2answers
101 views

how to load packages on local computer when using remote kernels

I usually works remotely using kernels on our hpc and front-end on my local laptop. This enable me do relatively large computation within my laptop(IP address of my laptop may change frequently). But ...
4
votes
1answer
117 views

Forcing optimal solution for FindShortestTour

I use FindShortestTour as explained here and it works nicely for a small number of cities. However when I try this with as little as 16 cities, the given tour isn't ...
3
votes
2answers
121 views

Mathematica regex equvalent of \l

In normal RegEx \l will make the character to the right lowercase. However, it seems like the RegEx in Mathematica does not have this functionality. For example ...
12
votes
9answers
694 views

How to partition a list of numbers in two lists of numbers such that each lists elements sums up to the same number?

I have the following list of squares. {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256} Their sum is $1496$, I want to make two partitions ...
7
votes
1answer
410 views

Issue with the NDSolve code

With this procedure, one may determine an eigen-value function $R(a)$ for any given $\Xi$ (say 0, 25, 50, 75, 100) ...
1
vote
1answer
152 views

Create Slider to start/stop/move Point

I want to be able to start, stop, and move the dynamically moving point simultaneously in both animations. The "PlayPauseButton" in the animations only controls the given animation. Indeed, I want ...
4
votes
2answers
115 views

Non-convergance of the solution of the 1+1 partial differential equation

I am stacked with a partial differential equation as follows: This is the $\LaTeX$ expression for the equation $$ \frac{\partial y}{\partial t}=\frac{\partial^2 y(x,t)}{\partial x^2} ...
4
votes
1answer
152 views

List all possible elements of a set

I have this two sets: $A = \{\emptyset, \{\emptyset\}, \{\{\emptyset\}, \emptyset\}\}$ $B = \{\{x, \{x, y\}\} | x \in A, y \in A\}$ Now I want to list all possible elements that are in $B$. How do ...
0
votes
2answers
80 views

I want to define a function that has integer power [closed]

I am defining this function: f[x_] = kr*g[x] + (c^l*x^l)/(KIR + c^l*x^l) But I want to make l bigger than 0, so if I evaluate ...
2
votes
2answers
133 views

Limit of integral gives incorrect output

I'm trying to evaluate $\lim_{e\to 0} \, \frac{i}{e}\int_{\pi }^0 \frac{1-\exp (i e \exp (i \theta ))}{\exp (i \theta )} \, d\theta$ with Mathematica 9.0.1.0 on OS X. However, I get "Undefined" for ...
2
votes
1answer
193 views

GraphPlot labels overlapping

If I plot the following graph with an EdgeRenderingFunction, the position of both the labels are at dead center, and with a large graph I have the labels completely ...
0
votes
1answer
40 views

Pruning coordinates in subarrays of a list conditional on them having non-real components

If I have a list of 2D coordinates placed in subarrays of a data structure like the following: ...
2
votes
4answers
1k views

System Modeler can't find g++ in Mac OS X Mavericks

I've just purchased SystemModeler (Mac OS X Mavericks) but can't verify the g++ compiler path. I assume it's in the Xcode package but nothing I've tried seems to work, for example, ...
3
votes
2answers
203 views

Import numeric data into Mathematica

I have a C++ program that outputs a set of numbers at each time step. A blank line separates successive time steps. Here is an example of my data format: ...
1
vote
2answers
393 views

Swapping elements of list

Say I have a directed graph inputted in the following format in Mathematica: g = {{1, "a", 2}, {2, "b", 1}} I'd like to plot this graph using ...
1
vote
2answers
120 views

Quickly pruning elements in one structured array that exist in a separate unordered array

I have two lists, which we'll call testList and modifiedTestList. The first list looks something like this: ...
8
votes
1answer
318 views

How can I scale a plot in vector graphic or PDF form?

I am not at all a computer graphics expert, but it seems that portable document format (PDF) files have a "native size," even though they may (and usually do!) contain vector graphics that can be ...
1
vote
0answers
89 views

LinearProgramming errors

I have a family of equations I want to solve over the non-negative integers. One particular instance of it is this. ...
1
vote
0answers
122 views

Multivariate resultant in Mathematica?

Is there any command in Mathematica 7 which can compute the (McCaulay) resultant of a parametric system of multivariate polynomial equations? In fact, it would be great if there is also a way to ...
3
votes
3answers
140 views

Find $Y \in (0, 5)$ such that the roots of $4x^2 + 4xY + Y + 2 = 0$ are real?

The problem is to find all $Y \in (0, 5)$ such that the roots of $4x^2 + 4xY + Y + 2 = 0$ are real. I took a straightforward approach with Mathematica with the intent of listing the only solutions ...
3
votes
2answers
186 views

Variable length list with # and [[i]] as elements

I need to create a list that as an input receives the number $N$ of elements that it will contain and that returns: ...
3
votes
2answers
233 views

Selecting for 2D points that are within a threshold distance of an upper- and lower-bound number of points

I have a very large set of 2D points: numberOf2DPoints = 10^6; pointList = RandomReal[{0, 1000}, {numberOf2DPoints, 2}]; I'd like to find a way to quickly ...
5
votes
1answer
197 views

Finding an optimal overlay of two point clouds

Imagine I have two sets of points: ...
1
vote
1answer
941 views

Animate curve parametric plot on a surface

I have a surface s = Plot3D[{x,y,F[x,y]},{x,-1,1},{y,-1,1}] with $F$ predefined, and a curve ...
0
votes
1answer
436 views

DSolve to solve a system of differential equations [duplicate]

I need to solve a system of differential equations as follows: ...
2
votes
3answers
129 views

Incorrect behaviour of Locator inside Show?

Why doesn't Locator behave correctly in the following code? ...
1
vote
1answer
137 views

Passing a joined list of symbols for Module or Block to treat as its own local symbols

The Question I'd like to write a function which itself takes a list of symbols, e.g. Foo[{x, y, z}] to pass to Module ...
5
votes
2answers
384 views

Plotting: Is anyone familiar with gradientfieldplot command?

I am trying to plot this graph showing the electric field lines and lines of equipotential based off the electrode configuration(in black) of two parallel lines. This is what I've been using for other ...
26
votes
7answers
889 views

Nice formatting for the results of a dice game simulation

One of my Mathematica interests is in problems related to the formatting of output. Getting nice formatting from Mathematica is often frustrating, but occasionally Mathematica will delight me by ...
4
votes
2answers
145 views

Finding the characteristic function of a TransformedDistribution[]

I am trying to find the characteristic function of a sum of "named" distributions, though I am interested in how to use Mathematica to find the characteristic function of $$f(X_1,\ldots, X_n),$$ where ...
2
votes
1answer
266 views

How do I label contour lines that are superimposed on a 3d plot?

I need to generate a 3D plot of a function, say $z = \sin(x)\cos(y)$, with contour lines drawn at specified intervals. I also want to label each contour line with its $z$-value. I have discovered how ...
5
votes
1answer
214 views

ListDensityPlot crashes the kernel

ListDensityPlot[ Flatten[Table[{i, j, Sin[i + j]}, {i, 1, 20}, {j, 1, 20}], 1]] gives the expected result, but a linear scale crashes my kernel (please save your ...
3
votes
1answer
409 views

Is there anything like a C pointer (or returning a reference) in $Mathematica$?

I want to do in Mathematica what the following does in C. ...

15 30 50 per page