6
votes
2answers
102 views

Algorithm in RandomChoice[{w1,w2,…}->{e1,e2,…},n]?

I wonder if someone happens to know the actual algorithm implemented in the particular overload of RandomChoice that handles explicitly presented discrete ...
6
votes
0answers
147 views

Using FunctionExpand to evaluate symbolic derivatives

Some symbolic derivatives of certain special function are not expanded automatically, but FunctionExpand often helps to get a derivative-free closed form ...
6
votes
1answer
164 views

Random filling of L-length line with l-length segments

I have discrete L-length line filled randomly with 2-length segments so its cover line with gaps 0 or 1. So we can describe cover configuration as sequence of gaps such as {0,0,1,0,1}. How I can ...
6
votes
3answers
295 views

Flow in pipeline graph

I have pipeline directed graph which has one source and several sinks ...
6
votes
1answer
389 views

Hatched bars and bar-specific background in BarChart

I would like to diagonally hatch the bars in BarChart and to have three different background colors for the different bars, like this: Any ideas how to ...
6
votes
2answers
2k views

Need 4D plot (3D + color for function) [duplicate]

I have a function f(x,y,z) of three variables and some constants: ...
6
votes
1answer
471 views

Integral of the Sinc product

Let as consider the following integral $$ B_n = \int_0^\infty \prod_{k=1,3,5,\dots}^n\frac{\sin (x/k)}{x/k}dx $$ By definition, Sinc[x]=Sin[x]/x therefore ...
6
votes
1answer
132 views

Creating a Block from a list of rules

How can I create a function which works like Block but takes a list of rules as its first argument, rather than a list of assignments? The function needs to be ...
6
votes
0answers
97 views

Detect when InputField gets keyboard focus

How might I detect when an InputField comes into focus? For example ideally something like this would work. ...
6
votes
3answers
401 views

Share experiences, preferably the surprising ones, with using ItoProcess

Can people please share their experiences, preferably the surprising ones, with using ItoProcess? I am a big fan of ItoProcess and have already used it for several finance-related tasks, though I ...
6
votes
4answers
285 views

How do I overlay corresponding values over each frame of an animation?

I recorded a phenomenon using video capturing (phen.avi, imported into Mathematica) and simultaneous measurement of some electrical properties of that phenomenon (a ...
6
votes
1answer
511 views

Problem with SerialIO package and Lego NXT

I'm following a guide from The Mathematica Journal that describes how to use Mathematica with the Lego Mindstorms NXT but have some trouble getting started and got stuck with the SerialIO package. I ...
6
votes
2answers
334 views

How to punch a hole in some 3D distribution of points

Suppose we have a long list of 3D Cartesian coordinates, defining a distribution of random points in 3D space. How could we remove all the points inside a sphere of radius ...
6
votes
1answer
772 views

Monte Carlo simulation using geometric Brownian motion

I'm relatively new to Mathematica programming, so forgive my rather unsophisticated question: I'm trying to do a Monte Carlo simulation using geometric Brownian motion (GBM). I want to write a ...
6
votes
1answer
189 views

How to create a “standard” CDF programmatically?

How can I programmatically create a CDF which is similar to the CDFs created by File -> CDF Export -> Standalone...? ...
6
votes
2answers
780 views

How can I recreate Trott's Riemann Surface plot in Mathematica?

In reading Michael Trott's Visualization of Riemann Surfaces of Algebraic Functions, he has: ...
6
votes
2answers
273 views

A good way to manage code in a complicated CDF?

When doing complicated programming in a Mma notebook I define several functions that I use in my higher level funtions, and I use a "Subsection" cell for each definition. For example I might write: ...
6
votes
1answer
329 views

Using “Raw MathLink Connections” to create a “Kernel Object”

Mathematica 8.0.0: I am stuck trying to get a Mathematica Mathlink connection from my Windows computer working that should connects to Linux over network (or vice versa) and then launches a Kernel on ...
6
votes
4answers
1k views

Determining the RGB values of the default plot color

In Mathematica 7, the default plot color is a purple-like color (although I think it is not Purple). Is it possible to use Mathematica to determine the RGB color ...
6
votes
2answers
332 views
6
votes
2answers
176 views

Control which variables get embedded inside Manipulate

While trying to analyse several different datasets I got what I thought was a good idea: define a "function" that returns a Manipulate object. But this has some ...
6
votes
2answers
458 views

How do I make NotebookEvaluate work inside Button?

The following creates a button to select a notebook to run. When the button is pressed it seems that Mathematica finds the notebook but cannot evaluate it. The following error occurs Could not ...
6
votes
4answers
372 views

Attaching persistent assumptions to symbol definition

Is it possible to attach assumptions to a symbol? This relates to this question. Most of my work involves physical equations, i.e. there are basic assumptions on variables that will always hold true ...
6
votes
1answer
2k views

How can I connect to a database using the 32 Bit ODBC on a Windows 7 (64 Bit) machine?

I am having difficulties using a DSN that was defined in the 32 Bit version of the ODBC-manager? (there are two separate managers for 32/64 Bit on a 64 Bit machine) Using the DatabaseLink package ...
5
votes
1answer
144 views

Poincaré map for dynamic billiard

There's a very nice demonstration of dynamic billiard written by Dan S. Reznik that can be found on demonstrations wolfram: here I was thinking whether it would be possible to draw the Poincaré map ...
5
votes
3answers
95 views

How to deal with the condition $u_i=u_{i+1}$ in B-Spline basis function?

The defintion of B-Spline basis function as shown below: Let $\vec{U}=\{u_0,u_1,\ldots,u_m\}$ a nondecreasing sequence of real numbers,i.e, $u_i\leq u_{i+1}\quad i=0,1,2\ldots m-1$ $$N_{i,0}(u)= ...
5
votes
2answers
215 views

Is it possible to assign different colors to parts of an .obj file?

There are four different cubes in an .obj file. After loaded into Mathematica, is it possible to assign four random colors to the cubes? ...
5
votes
2answers
146 views

Example of Integrate applying a numerical evaluation N

Here is a minimal example: Integrate[(a[1] + x)^2, {x, 1., 2.}] 2.33333 + 3. a[1.] + 1. a[1.]^2 The problem is that ...
5
votes
1answer
146 views

Is there a faster way to Map an Association?

Consider mapping an existing Association in a manner such as this: ...
5
votes
1answer
252 views
5
votes
1answer
145 views

Construct a function that can generate a geometry by extruding a section

Toady I want to construct a geometry shown as below: I know the Mathematica has the functions like Cylinder, Sphere and so ...
5
votes
2answers
229 views

Problem regarding 3D plot of a Moebius strip from a set of 2D points

First time posting here, although an experienced user of WM. I have a problem regarding graphics which I cannot seem to fix, so I am asking for your help. I start with a set of points $(x,y)$ in the ...
5
votes
1answer
166 views

calling CUDA library functions

Mathematica has some predefined CUDA functions, like CUDAMap, CUDAFourier, etc. My question is how can one call functions which are part of CUDA library but not part of predefined Mathematica ...
5
votes
1answer
91 views

How to enforce numerical precision throughout a package

I developed a big package that does quite a bit of numerics. Is there a way to enforce that all numerical computations are done with a pre-defined accuracy? For example, can one use something like ...
5
votes
4answers
863 views

Select a repeated element in a list

I want to select all elements that repeat 4 times in the list. I propose this code ...
5
votes
1answer
415 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 ...
5
votes
2answers
348 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 ...
5
votes
2answers
160 views

how to improve efficiency when I want to classify a list according to certain laws

I have a function that generates lists: f[n_] := Join @@ Permutations /@ PadLeft@IntegerPartitions[n]; For example f[3] ...
5
votes
5answers
297 views

What is the fastest way to replace all zeros in a matrix?

In the following matrix m every 0 should be replaced with a 1: m = {{0,1,2},{5,0,3},{8,0,0}} Desired result: ...
5
votes
1answer
197 views

Embedding StreamPlot in Graphics3D

I am trying to visualise the action of the infinitesimal generator of a Lie group on the solution of a 2-ODE system drawn in the 3D space (t,y1,y2): t is time and y1,y2 are the two dependent ...
5
votes
1answer
492 views

Clustering 3D Data Points on a Periodic Cubic Grid

I have a set of 3D data points on a cubic grid. The data can be downloaded from here https://skydrive.live.com/redir?resid=F96524B72DCD75FB!14240 and read into a variable ...
5
votes
1answer
229 views

Setting a Counter in Mathematica Notebook

I would like to write a book using Mathematica, but I will write one chapter on several files. How to tell Mathematica that the BookChapterNumber pointer has the ...
5
votes
2answers
199 views

Parallelizing or optimizing a script for calculating the size of all pairwise intersections between collections of sets

I need to speed up or parallelize an operation that looks essentially like this: ...
5
votes
3answers
278 views

How to disable differential styles/markers/etc. for multiple entities?

For functions that can produce multiple "style-able" entities, Mathematica by default will give each such entity a different style. Similar conventions apply to other features, either by default, or ...
5
votes
2answers
358 views

How to add new nodes to an existing graph with fixed (coordinates) nodes?

I'm ultimately trying to create a directed graph with some of the nodes in fixed positions and the other nodes placed around them in "acceptable" positions. It's better if I ask the question by ...
5
votes
3answers
239 views

Switching among view points in a Manipulate expression

Edit: Some additional viewpoints were included to make it easier to test. Here's code for an alternative function, the graph of which is a bit less symmetric. Feel free to use either code set: ...
5
votes
2answers
2k views

How to find the Shortest Path, visiting ALL vertices, without coming back to the start (Hamiltonian Path, minimum distance)

A car has to pick up each person and take them to their destination. I am trying to find the shortest tour that will do this. How can I find the shortest path between any s and t.... visiting all ...
5
votes
1answer
214 views

Assign variables automatically to a function

Lets consider that I've this function: fn = a*x^2 + b*x + c; The idea here is to assign automatically the variables a, ...
5
votes
3answers
323 views

Find the position of a string element, knowing only part of the string

I have a list, e.g.: list = {1, 2, 3, "Element 1", 4, 5, "Element 2", "Something else 1", "etcetera"} Now, I want all elements starting with ...
5
votes
1answer
149 views

question about Inner [duplicate]

question1: (code 1 something wrong, Why? and how to overcome this to achieve the next code's effect) ...

15 30 50 per page