0
votes
0answers
7 views

ListDensityPlot seems to break down for large arrays

(Using Mathematica 10) When using ListDensityPlot to plot 40000 + data points, the produced plot seems to be blurred/incorrect for points occurring later in the list. For instance, in the following ...
-2
votes
2answers
35 views

How to display line numbers in the Mathematica?

Is there such a thing in Mathematica; something like line numbers in Notepad++?
0
votes
0answers
14 views

Extra spaces when exporting strings

Here is a simple string "Amin,new". If I export it into pdf with Export command, I get instead: $\text{Amin ,new}$ Question: Note the space before comma. Why ...
3
votes
3answers
49 views

Vertex styling in CommunityGraphPlot

Is there a way to change the colours of nodes within one community? Mathematica assigns vertex colours automatically to each community. However, I'd rather like to use my own colour set. ...
15
votes
4answers
2k views

how to differentiate formally?

I have been wrapping my head around this for a while now and I have not found a solution so far. I want to work with an arbitrary number of variables in mathematica and use some built in functions. ...
2
votes
1answer
25 views

Applying a function which operates on lists of unequal dimensions

I have a list of 30,000 elements, each of the element is a list in itself {{a, b},{p, q, r}, {a, p}, ... {z, x}}. Second one contains unique elements ...
2
votes
1answer
46 views

Code reuse between files in the same directory

At the moment, I am producing various complicated interactive plots. They all share a common "code base", with modifications on top of it. I would like to refactor my code so that the various files ...
0
votes
1answer
42 views

What is the simplest way to plot x^(1/3) on the interval [-3,3]?

My question is: What is the simplest way to plot x^(1/3) on the interval [-3,3]?
0
votes
0answers
13 views

Plotting the Schwarz D minimal surface

With the aid of the following paper I'm trying to plot the Schwarz D minimal surface: paper. So far I have followed all the instructions to the best of my abilities and have come up with the following ...
3
votes
1answer
29 views

Typesetting for different powers

Suppose that I want to typeset an object such that it looks differently for different powers. The simplest example would be a three vector. For odd powers I want it to look like $$|\vec{v}|^n,$$ while ...
0
votes
0answers
22 views

Initial values/parameters in equation system of dimension 32

This is a system of equations of dimension 32, that describes an economic system. I want to find a set of parameters and initial values in which the system can be solved, and solve the system of ...
6
votes
5answers
145 views

Input a square matrix and return a list of the matrix entries read by antidiagonals

I have a square matrix: {{1,2,3},{4,5,6},{7,8,9}} and I want to get a list: {1,2,4,3,5,7}
1
vote
1answer
27 views

Characterising the set of parameters that satisfy a system of non-linear equations

I am looking for a solution to the following problem and could not find an answer so far. I have a quintic equation, $f(x;a,b,c,\cdots)-x=0$, where $x$ is the variable with respect to which I need the ...
2
votes
0answers
34 views

Answer Set Programming (ASP)

I am deeply involved in product configuration, i.e. in developing a software infrastructure, which ensures, that a customizable product can actually be manufactured. This involves defining rules for ...
0
votes
0answers
15 views

Code to import and export “.cine” image format?

I need to work with a set of experimental data in the form of ".cine" format image files. This is a data format developed by Vision Research for high-speed imaging and video. I would like to import ...
2
votes
1answer
40 views

Strange appearance artefact in ActionMenu

I've noticed a strange thing with ActionMenu which can also be seen in the documentation for V9 and V10 on OS X. It seems that when an ...
0
votes
2answers
45 views

Cases Except - Selective Exclusion

Please help me use Cases,Except on list data. I just want to remove all primes, or equivocally to see only the values in the list produced that aren't prime. the prime factorization of those values ...
3
votes
2answers
39 views

ReadLine[file] after reopening a closed stream doesn't read at the beginning of file?

Take a text file from your system: file = OpenRead["path/to/your/file"] ReadLine[file] Close[file] Here ReadLine[file] ...
2
votes
1answer
75 views

PrimitiveRoot function

The function PrimitiveRoot[n] claims to return the smallest primitive root of n. I believe this is not true. For example ...
1
vote
1answer
150 views

solve recursion equation with condition

How can I find $f(x)$ in terms of $x$ in the following equation? $ -k\, x \,f(x) + k \, (x + 1)\, f(x + 1) - r \, f(x) + r\, f(x - 1) =0$ $r$ and $k$ are constants and $f(x)$ should satisfy: ...
1
vote
0answers
40 views

LayeredGraphPlot Vertex Spacing

For anyone who has used LayeredGraphPlot, you have probably seen that the vertex spacing is consistent throughout, that vertices have the same minimum unit of ...
3
votes
1answer
46 views

Strings with exclamation marks in Mathematica

Given this input FullForm[ToString[TraditionalForm[x]]] Mathematica outputs "\!\(TraditionalForm\`x\)" It seems like ...
0
votes
2answers
35 views

Maximum likelihood estimation based on frequency table

I have a frequency table of grades, I'm trying to estimate the distribution as a truncated normal distribution (a grade below 65 is a failing grade and doesn't count). Since I don't have the actual ...
3
votes
1answer
81 views

3D plot of concave data set

I have the following data set ...
28
votes
2answers
787 views

Is there a name for #1@#2&?

Why does the pure function # @ #2 & have no name? I'm asking because sometimes I find inelegant to write expressions like ...
10
votes
4answers
415 views

Exporting data extensions in fits file

Context In Astronomy the de facto standard for images and data is FITS. I would like to export heterogenous data sets into a single fits file. Attempt I am ...
1
vote
1answer
38 views

Table of references

I have a list of variables (say a, b, c, d, e) that I want to assign in a single command. {a,b,c,d,e} = {1,2,3,4,5} would ...
6
votes
1answer
159 views

Speed up MinimalPolynomial

My Mathematica code runs slowly MinimalPolynomial[Sqrt[2] + Sqrt[3]+ Sqrt[5]+ Sqrt[7]+ Sqrt[11]+ Sqrt[13], x] runs slowly, but the Maple version ...
2
votes
0answers
17 views

Design problem with an an InterpolatingFunction-like object: bad performance over a remote kernel

I these last times, I found myself using often the following approach. Given some data, I make some preliminary, common, computations and I store these results in an ...
6
votes
4answers
139 views

Define Function with Sum over a list

I want to define a function that would symbolically look like $$ t(s,\underline{a})=\pi s + \sum_{n=1}^{n_{max}}a_n\sin(n \pi s) $$ (something like a finite Fourier series). Here $s\in [0,1]$ and ...
0
votes
2answers
39 views

NIntegrate and Integrate of a Spherical Bessel function

I am trying to integrate over a spherical bessel function. I have used both the Integrate and NIntegrate functions in Mathematica but the values given by each do not match. Any reason why this ...
2
votes
1answer
42 views

Writing a procedure that invokes Manipulate[]

I would like to write a procedure with the signature: Foo[vars, params] which produces a Manipulate object. The procedure ...
1
vote
3answers
40 views

Form a matrix to have inequality elements

It looks like a silly question, but I could not find any answers online. Your help is greatly appreciated! Say I have two lists now. ...
326
votes
12answers
63k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
22
votes
1answer
323 views

Visual representation of a Ranking over time (image provided)

[Disclaimer: I initially posted this question on stackOverflow 2 months ago and think it might be better suited for this forum (link to original question)] The graph below shows a ranking of ...
0
votes
2answers
36 views

How to continuous apply a function to an argument? [duplicate]

In order to calculate x = sqrt(1 + x) for a given number x, 40 times, I tried this: ...
2
votes
1answer
81 views

How to make hollow Graphics3D?

I keep seeing a notebook to use of Mathematica as a 3D Printing tool (e.g.: this link). In the notebook on slide 8/11, we find these pictures: I'd like to design it as such that, but I don't ...
0
votes
0answers
38 views

“cannot be used as function” error. Mathematica 9

I am trying to use Mathematica do solve a system of differential equations through a series. For the time being, I want the solution to be in terms of a quadratic. So here is an example, ...
1
vote
1answer
80 views

Changing default behavior of Series to give slightly different SeriesData

I am working with complicated expressions expr that contains the symbolic function f[x] which I know to have a pole at ...
10
votes
2answers
386 views

Floating point operations — division vs multiplication; how do they affect accuracy?

Given two functions: f[x_] := x ((x + 1)^(1/2) - x^(1/2)) g[x_] := x/((x + 1)^(1/2) + x^(1/2)) Which one is more accurate? Side note: If you could explain why, ...
0
votes
1answer
39 views

Simplifying square root expressions

I have read lots of questions on square root simplification on MMA, but I haven't really seen my problem posted (or understood a clear way to deal with this issue). I am simplifying some expressions ...
0
votes
1answer
44 views

How to subset datasets in Mathematica 10

I'm sorry if this is obvious but I can't find a way to select only a certain amount of columns of a dataset (or delete a certain amount of columns from a dataset) using the key of each column. I ...
0
votes
3answers
45 views

Trouble using Manipulate and NDsolve for coupled ODE's

I'm aware that there are a few threads on the topic of solving coupled ODEs using NSolve and Manipulate. Based on those, I wrote the following code, solving my system of equations: ...
5
votes
1answer
62 views

Why does Mathematica remember print settings?

Mathematica has a strange behavior with respect to printing and saving to PDF. It remembers the print settings, such as page range and number of copies along with the file. So if I print 50 copies ...
0
votes
1answer
33 views

Subscript und Superscript in FrameLabel and Export

I'm creating plots that I want to export as png. Which works, but when I add sub- or superscript into the FrameLables or get 10^x in LogPlots the sub- or superscript letters in the exported png will ...
1
vote
1answer
44 views

Is this caused by meomory usage ? (Something odd/hard to describe)

I really can't make a "smaller" example, but the files are here, for the data and for the notebook. It will cost a LOT of memory, up to 30G of RAM (maybe more). Here is the problem, (from a Linux ...
-1
votes
0answers
55 views

Plotting RandomVariates

I have simulated 10000 random variates from a copula distribution. I would like to plot them on a graph. How would I do this for a) If the random vector is 2 dimensional (so one on x-axis and one on ...
3
votes
1answer
35 views

Adding Assumptions changes the result of Integrate

When I try to calculate the following integral: ...

15 30 50 per page