11
votes
2answers
454 views

Fast Simulations with Compile

this post relates to another post that I didn't follow up propely. If I wanted to simulate a system of stochastic proesses like the following, and loop over this run many many times would writing the ...
9
votes
5answers
652 views

convert long string to integer list

at first, i would like to thank all the people here. i'm working with mathematica for half a year now and always found great advice and tricks. now, i came up with a problem i couldn't find a ...
14
votes
4answers
1k views

How to insert a plot into another plot

I would like to know whether there is a way to insert a plot into another plot. I would like to do some plot from a function an then, inside this plot, in the right down corner add a smaller plot of ...
9
votes
4answers
506 views

Dual-Grid Graph Paper With Mathematica?

Is there a slick way to generate the dual-grid graphs such as you can see on pages 7, 9, and 10 of this article, or this one? I've searched, but found nothing. Thanks in advance...
1
vote
2answers
627 views

How to take matrix elements as input to another matrix or loop?

Say I have matrix tmp1 of size 1000 x 5 (shown is just a small section for illustration purpose), consisting of real numbers and 0: How can I iteratively take every non-zero real number elements and ...
1
vote
1answer
548 views

How can I get a Taylor expansion of the Sin[x] function?

How can I get a Taylor expansion of the Sin[x] function by the power series?
8
votes
1answer
229 views

Antialiasing of horizontal lines

Consider the following graphic: g = Graphics[{Circle[], Table[Line[{{-1, i}, {1, i}}], {i, -1, 1, 0.2}]}, ImageSize -> 150] (You may need to look directly ...
4
votes
2answers
1k views

How do I set the font for output in my stylesheet?

I'd like to change the font that Mathematica uses for output by setting the font of the corresponding style in my stylesheet; bit simply overriding the default ...
7
votes
2answers
199 views

How can I get information about properties of a style?

I'd like to make some features of my notebooks responsive to some properties of styles in the active stylesheet. Is there a way to do this? I can't seem to get anything out of ...
11
votes
3answers
176 views

Why can't I use Sequence to perform a Select like task?

Suppose I wanted to write down a list of $p^2$, for $p$ a prime between $1$ and $20$. I would expect Table[If[PrimeQ[k], k^2, Sequence[]], {k, 1, 20}] to work. ...
4
votes
1answer
282 views

Is there a way to globally set when to treat a very small number as zero?

I understand that I can use Chop to force a very small number to be treated as 0 and can use ...
3
votes
0answers
71 views

Reading a specified line number from a text file [duplicate]

Possible Duplicate: How to read data file quickly? I have a huge text file (~500 MB). The file is too large to Import into Mathematica, although I can ...
19
votes
3answers
1k views

Can we teach Mathematica about functional differentiation?

The key relation for functional differentiation is $$\frac{\delta}{\delta f(y)}f(x)=\delta(x-y), $$ where $\delta(x-y)$ is the Dirac delta function, and the usual properties of differentiation (e.g. ...
8
votes
2answers
696 views

Light syntax parser for Mathematica?

My netbook is too slow to install Mathematica. I'm not set against working in a text editor, but I like having an automated highlighting/formatting environment; can anyone recommend a good gedit ...
1
vote
2answers
131 views

How to take input from user?

Since I'm new to Mathematica I want to have a Notebook which takes inputs from user and returns average of the inputs entered and plots it on x-y coordinate. How can I do this?
3
votes
1answer
250 views

Operations on a List of Vectors (Norm)

I have a List containing vectors. The coordinates are random numbers: r = {RandomReal[{-1, 1}, n], RandomReal[{-1, 1}, n], RandomReal[{-1, 1}, n]}; Now I want to ...
4
votes
1answer
188 views

Why to do parentheses change the results of a calculation?

I'm getting results that are sensitive to where I place parentheses with respect to operations that are associative1 (and should thus be insensitive to such placement). For example, if I define2 ...
0
votes
2answers
119 views

Matrix conditional operation

Say I have a matrix of: tmp1 = 5; tmp2 = 5; tmp3 = RandomChoice[{0, 1, 2, 3, 4, 5}, {tmp1, tmp2}]; MatrixForm[tmp3] How to do a conditional operation of elements ...
2
votes
0answers
480 views

Inconsistent boundary and initial conditions: BC ignored altogether

Consider the following diffusion-decay equation with von Neumann b/c in the origin and Dirichlet at the other boundary: ...
2
votes
1answer
698 views

How to define the Einstein summation convention in Mathematica?

How to define a Einstein summation convention in Mathematica? Say, how to let Mathematica know T[i,i] equals ...
8
votes
1answer
661 views

NIntegrate error bound

I am trying to evaluate a highly oscillatory integral using NIntegrate. I fear that due to limited resources (time and/or memory), I will not be able to evaluate the integral to the desired precision. ...
1
vote
1answer
84 views

How do I craft this constant to a specific accuracy?

An earlier post was migrated to Physics.SE and we determined that if this converged, we would have a constant close to the mass of the proton in kilograms. This constant is constructed by summing the ...
14
votes
5answers
625 views

Get number of combinations without “forbidden patterns”

I need to get the number of all combinations of binary digits in an 8-digit binary number, but minus some "forbidden" patterns like: xxxx0xx1 x1xxx0xx x1xxx0x0 ...
7
votes
2answers
2k views

Building matrices by attaching vectors (columns) and matrices

Having the need to attach a column to a matrix or to join matrices to make longer rows is an operation that I use very frequently and I find the Join function ideal ...
2
votes
1answer
393 views

Restrictions problem

I tried to program a simple linear optimization model and don't know where my mistake lies. The function should be a sum over "t" and "z" from the product of two constants ("e" and "H") and the ...
2
votes
1answer
144 views

#[[1]]//FullForm = 1?

I have a set of symbolic algebraic expressions that I'm trying to get some speed into. To illustrate the issue, I'll use a simple form like { k0 X, k1 Y, k1 Z}, ...
10
votes
2answers
265 views

Why is NeighborhoodGraph so slow?

To get neighboring vertices I first tried: gg = GridGraph[{10, 10, 10, 10}]; VertexList[NeighborhoodGraph[gg, 1, 1]] // AbsoluteTiming {5.539308, {1, 2, 11, ...
2
votes
1answer
220 views

How do I create a histogram out of this datastructure: x[i] = value_i?

Here is my SSCCE: a[1] = 2; a[2] = 3; a[3] = 6; Histogram[a] This throws and error though. Here are my questions: What kind of data type is a? Is it an ...
7
votes
3answers
394 views

Filter list based on date

What I would like to do is remove entries from a list of instrument data when it is in maintenance. The maintenance data I have is a series of dates which look like this; ...
1
vote
1answer
1k views

problem solving coupled second order differential equations using Dsolve

I have three coupled second order ODE's given as below $x''[t] = -c_1*y'[t]-c_2*z[t]-c_3$ $y''[t] = -c_4*x'[t]$ $z''[t] = \frac{c_5}{c_6}*x[t]-c_6$ where $c_i$'s are know constants. The ...
16
votes
3answers
747 views

3D view of a route shown on a map

You should have already seen such a thing, specially in documentaries about ancient life: the movement of a tribe is shown on an ancient map along a route with a dashed arrow. I want to do the same ...
2
votes
4answers
210 views

Extracting RHS from Rule

In an example from another question, the rhs of a list of rules can be simply extracted: ...
12
votes
4answers
1k views

Is there a way to hide or toggle the visibility of code?

Many of my notebooks have a similar repeating structure, which is very convenient and reliable for my workflow: a chunk of code defining a Manipulate for exploring ...
8
votes
1answer
124 views

Prevent Plus from threading InterpolatingFunction

For an InterpolatingFunction $y:\ \mathbb{R}\to\mathbb{R}^2$, Plus is unaware of this, so when I do any modifications to it in ...
3
votes
0answers
358 views

Ubuntu 12.10 no window focus on help browser

The help browser is not getting window focus when clicked on it. Clicking links or buttons in the help browser works without window focus, but copying code or typing in it doesn't. I can get window ...
2
votes
0answers
83 views

How do I create inline TraditionalForm expressions, and control their formatting? [duplicate]

Possible Duplicate: How to replace the style of the inline cell in a StyleSheet I'm trying to figure out the best practice for creating short, inline expressions that display as ...
2
votes
2answers
360 views

Plotting several numerical solutions plus the analytic solution of ODE in one plot

I want to be able to plot several numerical solutions of an ODE plus its analytical solution in one plot in order to see how the numerical solutions converge towards the analytical one w.r.t. the ...
24
votes
1answer
555 views

Reduce distances between vertices of graph to minimum possible?

This simple graph has vertex shapes of different sizes: ...
6
votes
1answer
336 views

Obtain Data points from a graph on an image without axes

I have the following image: (which is a oscillation of the "magnetic susceptibility of gold" in y-direction, in arbitrary units, over the "magnetic field strength" from bmin = 36540 Gauss to bmax = ...
2
votes
2answers
158 views

Updating a tracked symbol inside Refresh?

I have some code inside a Manipulate, whose goal is to allow the user to edit the upper half of the matrix while keeping it symmetric at all time. The minimal code ...
2
votes
1answer
86 views

Cleaning the hyperlinked string from its hyperlink property

I need to rename a number of files. These are graphic jpg files, and I have an Excel table in which the initial names of these files are collected. For example, this is the name of one of these files ...
9
votes
2answers
1k views

Convolution with interpolated function

I have some problems to calculate in reasonable speed the convolution of an interpolated function with a Gauss function. I have here (ExampleData.txt, alternate Pastebin link) data which I ...
2
votes
0answers
60 views

How can I focus cursor at specific position? [duplicate]

Possible Duplicate: Programmatically move the cursor to a desired location on the screen I made a Button with the name of "Click",if we have to click on ...
1
vote
1answer
682 views

How to scale vectors in VectorPlot?

I generated some pics from 2 datum,one in $x$ direction and the other in $y$,so I used the commands: ...
2
votes
1answer
148 views

Why do I have to install my stylesheet each time I make changes to it?

I gather that it should be possible to preserve changes to a stylesheet by simply saving it, but this is not the behavior I'm getting with a stylesheet I've "installed" using the "Install ...
1
vote
1answer
249 views

How do I define functions in TraditionalForm?

I'd like to be able to define functions (at least simple ones that Mathematica can otherwise understand) using TraditionalForm; but this seems to require the use of ...
5
votes
1answer
122 views

How can I remove a style from the list of available styles?

I have a stylesheet that has inherited some base definitions from another, but would like to "prune" the list of available styles, by removing or disabling1 some. Is there a way to do this? 1. This ...
9
votes
1answer
120 views

Is there a way to base one style on another?

I'm setting up a stylesheet and and finding the process of defining related styles tedious and error prone. In particular, I have several related styles that need to have synchronized settings (e.g., ...
8
votes
1answer
354 views

Integral with HeavisideTheta takes too long to evaluate

I tried to compute $$\int_{-1}^1 d x_1 \int_{-1}^1 d x_2 \int_{-1}^1 d y_1 \int_{-1}^1 d y_2 \theta(x_1 x_2 + y_1 y_2)\,$$ where $\theta$ is Heaviside's step function, by using ...
9
votes
3answers
413 views

How to remove accents from text?

I would like to know how I can remove accents from a string. For example, how can I transform "string test áéíóú" into ...

15 30 50 per page