2
votes
1answer
60 views

Extract Style Attributes from Style[]

Can you extract the Style attributes from a variable. For example: var = Style["aString", Bold, 24] You can get back "aString" by using ToString[var] but I am ...
3
votes
1answer
367 views

DateListPlot show all the dates in ticks

The code below generates the plot above, ...
0
votes
1answer
76 views

Scheduled tasks not preserving order with Dynamic?

In studying the last Basic Example in the documentation for StartScheduledTask, namely ...
12
votes
3answers
1k views

Plot discontinuous function with black and white disks marking discontinuities

Let's say I'd like to plot Sign[x + 0.5]: Plot[Sign[x + 0.5], {x, -1, 1}] Mathematica will give this: This plot does ...
1
vote
1answer
196 views

Interpolate a curve in 3D

I have a sequence $\{(x_k, y_k, z_k)\}_{k=1}^n \subset \mathbb{R}^3$, all points along a path represented by the function $\gamma \colon \mathbb{R} \to \mathbb{R}^3$, which maps the distance along the ...
3
votes
2answers
273 views

Different MeshStyle for different functions

By using Plot command I want to get one curve in form if circles and other like a solid line. ...
3
votes
4answers
232 views

Redefine ArcCot to be inverse of range [0, Pi]

Mathematica implements ArcCot function as an inverse to Cot on range [-Pi/2, Pi/2]. I ...
1
vote
0answers
132 views

Question about variable name autocompletion in $Mathematica$ 9 on OS X

For the command autocompletion, I can simply use Ctrk+K and then use Return or Tab to choose the completion. But when I want to autocomplete the local variables I have input, Ctrk+K works, but both ...
0
votes
2answers
81 views
1
vote
3answers
90 views

Options in a StringReplace rule

case1 Options[f] = {"t" -> "0"}; f[___, OptionsPattern[]] := StringReplace["content", "t" :> OptionValue["t"]] f[] (* con0en0 *) case2 ...
2
votes
1answer
50 views

How to randomly select and open a notebook using CDFPlayer

I have a lesson notebook for a class I am teaching. I'd like to separate the lesson content and the practice problems. Students are using the CDFPlayer program, not Mathematica. I created a button ...
2
votes
1answer
157 views

Exported PDF copy-and-pastable

Is it possible to export pdf documents that allow the user to copy and paste the exported code/text? The following table demonstrates what is pasted after copying the example symbols from a pdf ...
4
votes
3answers
153 views

Permutation count for sets with multiplicities

I am able to do a permutation counr for the set {a, a, b} which gives me 3 groups. I am happy with that result. However, if the set is ...
26
votes
1answer
315 views

Exporting extremely large images; arrays generated via TensorProduct use 5 times as much RAM as expected?

I am generating plots of the roots of certain classes of polynomials, in the spirit of the multicolored visuals on the Wiki page on algebraic numbers. I've thus far been able to make some extremely ...
0
votes
0answers
126 views

How plot the lattice QCD visualization figure? [duplicate]

The following is the 3D grid to visualize the lattice QCD simulations. Please help me, how to plot this fig. employing Mathematica. Thank you very much.
8
votes
1answer
278 views

Add lines to 3D Plot

How can I add lines that demarcate the different regions of the following 3D plot: Plot3D[1/(1 + E^(-a - c)), {a, -8, 8}, {c, -8, 8}] To give you an idea of what ...
6
votes
1answer
114 views

Mystery with ValueQ

Consider the following ClearAll[jd]; ValueQ[jd] We expect False and get it. Now consider ...
1
vote
1answer
177 views

Integral over squared Hermite polynomial

I would like to calculate the uncertainty of the nth Eigenstate of a 1-dim harmonic oscillator. To obtain the result I have to solve the integral $$\int_{-\infty}^{\infty} \psi^* x^2 \psi \:dx$$ ...
7
votes
2answers
439 views

Nonrectangular region for NDSolve

I have a PDE with mixed boundaries (Neumann and Dirichlet on some sides) in the region $(t,x,y) \in \left( 0, T\right) \times\left\{ -L \leq x \leq L, 0 \leq y \leq h(x) \right\}$ where $h(x)$ is ...
6
votes
3answers
642 views

How to make a 3D plot auto-rotate?

When doing presentation with Mathematica, I often want a 3D plot to rotate automatically, so the 3D feeling is stronger. I don't want to drag the mouse very time. So, I want a general function like ...
13
votes
4answers
544 views

Is it Possible to change dashes into circles with Plot command?

Is it possible to change the Dashed Style of a curve into circles with Plot command ? ...
0
votes
1answer
84 views

Reduce[] giving incorrect result for equation over $\mathbb{Z}^4$

This is partially in response to a question I posted earlier, although the problem in this case appears to be distinct from the problem there, so I am temporarily filing this as a separate question. ...
-5
votes
1answer
123 views
1
vote
0answers
459 views

Solve[] unexpectedly giving empty solution sets for extremely large problems

I was calculating the set of lattice vectors in $\mathbb{Z}^4$ which have taxicab norm $r$. For example, executing ...
9
votes
2answers
529 views

Memory leak issues

I am working with noncommuting objects and basically I am using Mathematica to sort large expressions by normal ordering and simplifying them. To this end, I first create an object called ...
0
votes
1answer
164 views

A function generating particle-in-a-box eigenfunctions

The function sequence is defined over $[-\frac{L}{2},\frac{L}{2}]$ (all elements are valued 0 outside this interval): $$\psi_n(x)=\begin{cases}\sqrt{2/L}\sin{(\frac{n\pi x}{L})} & n \space even ...
11
votes
1answer
216 views

Inconsistent behavior of WhenEvent[ ]

Consider the following simple example: ...
2
votes
0answers
77 views

Different delays in notebook and command-line?

I was surprised by the following sequence of expressions: Remove[foo$, bar$]; foo$ = Function[Set[bar$, 42]]; At this point, I expected ...
100
votes
7answers
17k views

How to generate a random snowflake

'Tis the season... And it's about time I posed my first question on Mathematica Stack Exchange. So, here's an holiday quest for you Graphics (and P-Chem?) gurus. What is your best code for generating ...
10
votes
3answers
244 views

Can I return lists with different dimensions from a compiled function?

Sometimes I'll need several lists with different dimensions to be returned by a compiled function, but compiled function will fail if an irregular list contained: ...
1
vote
1answer
153 views

I got wrong answers when solving an equation

I have this expression: ...
4
votes
2answers
342 views

How can I simplify $\log(512)$ to $9\log(2)$?

Can you explain me about the result of Integrate. ...
1
vote
1answer
238 views

Way to input caligraphic letter as a axis label in Mathematica plot

In my paper written in LATEX, I used a symbol $\mathcal{T}$ and I want to put it in the axis label of my plot. However I could not find such functionality in Mathematica. Is it possible?
3
votes
2answers
154 views

Complex limit gives wrong answer

I'm evaluating $$\lim_{z\to e^{i \pi/2 n}} \frac{z-e^{i \pi/2 n}}{z^{2 n}+1}$$ with Mathematica 9.0.1: ...
1
vote
2answers
118 views

Problems with WhenEvent

Any help/explanations will be highly appreciated: This works: ...
1
vote
0answers
69 views

How to simplify expressions

I read several similar posts but I have not found a solution yet. However, I think that my problem should be quite easy. So here we are. Relations ...
19
votes
4answers
2k views

How many Christmas gifts?

This question is based on the old song, The Twelve Days of Christmas In a comment made on a recent question, Yves Klett remarked, "no seasonal questions this year?" This reminded me of one I solved ...
0
votes
0answers
87 views

How to find near circular objects in an image [duplicate]

I have an image similar to the one shown below, and I need to find all the red circles and count them. How could I possibly extract them? I am trying to do this in Mathematica for now, but eventually ...
2
votes
1answer
134 views

Piecewise function with user-input interval

I would like define a function g[data,bins,x] which is a piecewise constant function taking value data[[i]] in the range ...
1
vote
1answer
663 views

How to replace multiple variables at once

I would like to make a replacement "c1 C1 -> F1, c2 C2-> F2...." such that the expression like this "c1 C1 c2 C2 c3 C3 c4 C4" becomes "F1 F2 F3 F4". I used the standard replacement method: ...
2
votes
1answer
120 views

Simplifying expressions involving square roots and 'i' factors

I am doing the contour integration using Mathematica. After extraction of residues, my expression contains a lot of unwanted pairs such as ...
2
votes
1answer
2k views

Simple way to plot a complex valued function of one real variable

How can I plot a complex valued function of one real variable, $f(t)$, as $$x=-\Re f(t),\ z=\Im\ f(t),\ y=t \space?$$ My aim is a 3-dimensional path, treating the complex valued function as if it ...
1
vote
1answer
68 views

Hide output from when mouseover Locator graphic

When the mouse pointer passes over the Locator graphic (or one clicks at any point in the frame), the underlying equation that generates the ContourPlot is visible ...
4
votes
4answers
331 views

Deleting powers of a common prime except the highest one from a list with further only primes

In a list with factors of which most are prime, some are integer powers of some common prime as base. All the powers from 1 to ...
3
votes
2answers
315 views

Incorrect value of infinite sum

Wolfram Alpha and Mathematica give an incorrect result (numerically) for the following infinite sum: ...
5
votes
1answer
367 views

Functional programming Style & Performance

Hello i have been spending time to convert my R tools into Mathematica Packages mainly because i like the functional programming style in Mathematica. In doing so it seems that i run into one ...
1
vote
2answers
177 views

How to sort Table/Matrix including legend(Labellings)

I want to sort table including its legend for graph I have table similar to M1 M2 M3 1 5 2 3 1 4 4 2 -10 5 7 11 6 -2 1 ...
3
votes
1answer
172 views

Faster Solve for Fermat 4n+1 conjecture

Assuming that Fermat 4n+1 conjecture (each prime of the form 4n+1 is the sum of two squares) is true then I like to solve the ...
8
votes
3answers
1k views

Which ColorFunction should I use to get such a gradient of blue-cyan-green-yellow-orange-red?

I want to get the effect in the above Figure. Here is my code: ...
0
votes
1answer
128 views

Why is my plot so small?

This code ...

15 30 50 per page