# All Questions

358 views

I'm looking for a robust way to add vertices to a graph by modifying its AdjacencyMatrix. Here's what I have so far: ...
647 views

### How to perform a depth-first preorder traversal of an expression?

Due to confusion of terminology on my part I asked the wrong question before. Since it has already received other answers I shall not edit it, but instead ask the question I meant to in the first ...
475 views

### ContourPlot - plot contour lines for minimum of list of functions == 2nd minimum of list of functions

I have a list of (ten or so) functions of two variables (x and y, say). I would like to plot the boundaries on the x y plane where two functions have the same value - but only the two functions in the ...
306 views

### What is Sub Mathematica?

When looking at the locally available licenses, I see four entries: "Mathematica", "MathKernel", "Sub Mathematica" and "Sub Mathkernel". Now "Mathematica", "MathKernel" and "Sub Mathkernel" are clear, ...
370 views

### Difference between sub MathKernel and MathKernel

When I try to run Mathematica processes in parallel on a Linux based server, I see that my server allows 7 MathKernels and 28 sub MathKernels. I was wondering what the difference is and how I can take ...
143 views

### Behavior of Inner depends on List dimensions?

Consider the following case: ...
349 views

### How to select all initialization cells?

Is there an easy way to select all initialization cells (and only those) in a Mathematica notebook?
628 views

### How to perform a breadth-first traversal of an expression?

Mathematica provides functions that perform a depth-first traversal on an expression, including: Map, MapAll, and ...
240 views

### How to substitute variables in interpolated function?

I'm looking for the way to substitute variables in interpolated function again to original one. (I want to know how to get P(r, theta) from Psol(v, w).) The original variables : ...
220 views

### Parts of Module body evaluated in external scope?

I have an expression that suggests that some expressions in a module body are dragging in definitions from outside the scope in a surprising way. First, consider a symbolic constant, ...
189 views

### Using mouse back/forward buttons in Mathematica's help system

I have a generic mouse with back/forward buttons. Those buttons are recognized by the system - I can use xev to see that they generate events for buttons number 8 ...
442 views

### “Evaluating” polynomials of functions (Symbols)

I want to implement the following type evaluation symbolically $$(f^2g + fg + g)(x) \to f(x)^2 g(x) + f(x) g(x) + g(x)$$ In general, on left hand side there is a polynomial in an arbitrary number of ...
325 views

### Simultaneously running the same .m file with different inputs

I have my Mathematica code in a .m file and I run it from the command line with some parameters. I was wondering, if there is no overlap in input and output files, ...
562 views

### How can the opacity of a dense data set be automatically chosen?

The problem In a dense data set plotted with opaque points, data points can pile on top of each other. This can cause serious problems with the interpretation of the plots. I'll use as an example a ...
194 views

### Build recursion in parallel?

Problem Let's define a simple recursion. f[1] = 1; f[n_] := f[n] = f[n - 1]*n; If I evaluate f in parallel ...
152 views

### splitting a list into files

Given is a list with x, y, z coordinates: {{100, 94, -1.112}, {100.05, 94, -1.112}, {100.1, 94, -0.982}, ..., {100, 94.25, -1.112}, {100.05, 94.25, -0.855}, {100.1, 94.25, -0.728}, ..., ...
2k views

### Custom contour labels in ContourPlot

Suppose I wanted to draw the zero contour for the function $$d^2-g.$$ I could use the following code: ...
2k views

### solve non-linear system of equations

I have a system of equations and I want to solve it to get x, y \begin{cases} u= C_{1}+(x-C_{1})(1+k_{1}((x-C_{1})(x-C_{1})+(y-C_{2})(y-C_{2}))) \\ \\ v= ...
305 views

### Multiple simultaneous events in EventLocator method for NDSolve

I'm using NDSolve to integrate a system of ODEs, and EventLocator to stop the integration when it leaves a certain region in phase space. This works perfectly as it should. However, I've also added ...
1k views

### Remove image background of headshot in Mathematica?

For example, using ExampleData[{"TestImage", "Girl2"}]: what's a general way to make the background transparent? I've tried various combinations of ...
225 views

### Dynamic lists as function arguments

Suppose I have a function that requires a list is as input. I.e. f[list_]:=DoSomethingWithList Now, if I pass a variable as Dynamic like this ...
144 views

### How to change type order in PearsonDistribution?

I need to estimate a Pearson distribution from a batch of tables tab: ...
568 views

### Controlling the 2D $x–y$ aspect ratio of a 3D plot

I have some data representing a nested list, each element being composed of 3 real numbers like ...
501 views

### Adapt ColorFunction in Array Plot

The problem I'm facing is how to adapt ColorFunction so that it ranges from green (low values) to red (high values): ...
627 views

### 3- dimensional plot of 2-dimensional systems of differential equations

Let's take this first example of a 2D output: ...
645 views

### AccuracyGoal, PrecisionGoal, WorkingPrecision and NDSolve

I'm trying to understand exactly what WorkingPrecision, AccuracyGoal and PrecisionGoal mean ...
430 views

### Can you call a C function that takes function pointers as arguments?

I want to use MathLink to call a function I wrote in C. However, similar to an integrator, it takes a function pointer as an argument and applies it on numbers depending on the other arguments. I ...
426 views

### Visualize cluster distances in DendrogramPlot

I want to perform a cluster analysis using the HierarchicalClustering package. Is there a way to display the inter-cluster distances in a dendrogram plot? An ...
172 views

### Why didn't Reduce give me the right result?

My code: Clear[r1, r2]; par[r1_, r2_] := r1 r2 / (r1 + r2); Reduce[{5 par[r2, 32000]/(r1 + par[r2, 32000]) == 1.8 && par[r1, r2] == 5000}, {r1, r2}] ...
156 views

### Can individual locators in LocatorPane be temporarily disabled?

This follows up on another question about the sensitivity of Locators in a a LocatorPane. I would like to be able to enable/disable individual locators in a LocatorPane. In the simplified version of ...
834 views

### Solve matrix equation A*X=X*B using LeastSquares

I want to solve matrix equation A*X=X*B using LeastSquares method, but it is suited for equation like A*X=B. All matrices are 3x3 ...
1k views

### Find the dimensions of a cylindrical can that will minimize the cost of the material

A cylindrical can is to be made to hold 1 L of oil. Find the dimensions that will minimize the cost of the metal to manufacture the can. This is a standard calculus problem. The volume of the ...
126 views

Recently I have been working on group theory and I have found checking for associativity for specific Cayley tables to be rather tedious so I wrote a program to do it for me. Most of the time I would ...
242 views

### Polynomial expectations of generic distributions

Summary Polynomial expectations depend only moments and cross moments of a multivariate distribution. I would like to use Expectation to compute polynomial ...
367 views

### Word Squares and Beyond

A word square is a set of words which, when placed in a grid, read the same horizontally and vertically. For example, the following is an English word square of order 5: ...
864 views

### Animation of Differential Equations from NDSolve with ParametricPlot3D and Evaluate

I have a system of differential equations (referred to as "s") and use NDSolve to obtain the solution. I substitute the interpolated functions for the original ...
155 views

### Efficiently importing XPM matrix data into Mathematica

The XPM file format is an image file format. Although it is primarily intended for icon pixmaps, it can also be used to store matrix data. For example, the GROMACS chemical simulation package uses ...
144 views

### How to get the boolean value of an inequality involving an InterpolatingFunction?

Here's the code: yan = FunctionInterpolation[x^2, {x, -1, 1}]; FullSimplify[yan[x] > -1, -1 < x < 1] Needless to say, what I expect to see in the output ...
1k views

### How to use filling in ContourPlot

I want to fill region between different contours, e.g. ContourPlot[{c1 = f1, c2 = f2}, ...] a la the filling options for Plot ...
153 views

### Trying to generate a function from InterpolatingFunction with FunctionInterpolation

Here is the code (I'm sorry to give you such a complex code sample but I failed to reproduce the error with a simpler InterpolatingFunction): ...
521 views

### What function can I use to evaluate $(x+y)^2$ to $x^2 + 2xy + y^2$?

What function can I use to evaluate $(x+y)^2$ to $x^2 + 2xy + y^2$? I want to evaluate It and I've tried to use the most obvious way: simply typing and evaluating $(x+y)^2$, But it gives me only ...
270 views

### Substituting Symbol font for Mathematica's custom font in exported plots and other graphics

Mathematica includes some custom fonts that allow you to use a wide range of mathematical symbols in output. For example, one can write: ...
329 views

### How do I transform a rasterized graphic's coordinates back to its original ListPlot data coordinates?

From this question I successfully made an elliptical fit for my data. However, when I try and collect the datapoints within the ellipse via this question the coordinates of my ellipse correspond to an ...
237 views

### Code to draw geometry doesn't run

I'm new to Mathematica and have no background whatsoever in programming, although I will teach myself soon. I was wondering if one of you programming pros could help me out. I received a code from ...
351 views

### simplifying equations [closed]

I have a question that seems easy but I can't solve it. I have an equation like: eqgama = -8.33208*10^56 g1 + 8.18264*10^56 g1^2 == -1.42093*10^56 I use the ...
557 views

### Adding Lines to Sparklines (plots w/o frames, axes, etc.)

I have been working with Sparklines, thanks to some code found here. Here is what I am using: ...
327 views

### Generating Linear Extensions of a Partial Order

Given a set $S$ and a partial order $\prec$ over $S$, I'm looking for a way to "efficiently" generate a list of linear extensions of $\prec$. Suppose the partial order is given by a ...
570 views

### How to use and input audio wav file into a Wolfram demonstration

I am trying to send a Wolfram demo, which contains a sound wav file. sound = Import["C:/myfile.wav", "Data"]; snd := sound[[1]]; or snd = sound[[1]]; Is it ...
I am trying to find the derivative of a function defined in polar coordinates with respect to $x$ and $y$. My function is defined as follows: \$ v_x(r, \theta ) = v_r \cos (\theta ) - v_{\theta }\sin ...