2
votes
1answer
126 views

Declaration of variables in large Linear Programming model with NMaximize

I want to solve a large LP problem using NMaximize. This is a small instance of my bigger problem: $$max \sum^{4}_{t=1}(\sum^{4}_{c=1} V_{c}*f_{c,t})\\ s.t\quad ...
0
votes
1answer
126 views

Summation matrix

I have problem with summation when it is in matrices. I want to make mathematica compute this: Large X I have added dataset for as well as e. Would anyone be able to show me how to compute this in ...
3
votes
1answer
243 views

Windows Explorer Natural Order

Currently there are a list of notebooks in Windows that I am processing in a folder. Ideally I would like the notebooks to be concated in the same order as how they display in Windows Explorer. I ...
5
votes
1answer
566 views

How to display each step of an A star algorithm?

I wrote a pathfinding program: A*, which is an extension of Dijkstra. I want to see the result of each step at a time. Which function should I use? The main program is the notebook Astar, which is ...
1
vote
2answers
253 views

Changing Default Color for Titles, Sections, Subsections, etc., and Items (bullet color) [duplicate]

I'm new to Mathematica 9, and I assume there must be an easy fix for my problem, but I have not been able to find any yet. Essentially, I want the default color for the text of all of my titles, ...
2
votes
1answer
61 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
456 views

DateListPlot show all the dates in ticks

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

Scheduled tasks not preserving order with Dynamic?

In studying the last Basic Example in the documentation for StartScheduledTask, namely ...
14
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
218 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
309 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
249 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
141 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
82 views
1
vote
3answers
91 views

Options in a StringReplace rule

case1 Options[f] = {"t" -> "0"}; f[___, OptionsPattern[]] := StringReplace["content", "t" :> OptionValue["t"]] f[] (* con0en0 *) case2 ...
2
votes
1answer
53 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
174 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
166 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 ...
27
votes
1answer
339 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
145 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
299 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
200 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
514 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 ...
7
votes
3answers
819 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
610 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
89 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. ...
-6
votes
1answer
149 views
1
vote
0answers
628 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
553 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
178 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 ...
12
votes
1answer
227 views

Inconsistent behavior of WhenEvent[ ]

Consider the following simple example: ...
2
votes
0answers
80 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 ...
103
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
247 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
154 views

I got wrong answers when solving an equation

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

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

Can you explain me about the result of Integrate. ...
1
vote
1answer
328 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
173 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
125 views

Problems with WhenEvent

Any help/explanations will be highly appreciated: This works: ...
1
vote
0answers
74 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
91 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
154 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
981 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
127 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
73 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
336 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
344 views

Incorrect value of infinite sum

Wolfram Alpha and Mathematica give an incorrect result (numerically) for the following infinite sum: ...

15 30 50 per page