9
votes
1answer
506 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 ...
11
votes
1answer
553 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 ...
3
votes
2answers
174 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}] ...
6
votes
2answers
193 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 ...
2
votes
1answer
1k 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 ...
1
vote
2answers
2k 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 ...
4
votes
2answers
135 views

Thread[] seems to reset changes made with Manipulate[]

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 ...
15
votes
1answer
289 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 ...
11
votes
2answers
391 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: ...
2
votes
2answers
1k 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 ...
3
votes
1answer
208 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 ...
5
votes
2answers
155 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 ...
14
votes
5answers
2k 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 ...
1
vote
1answer
184 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): ...
6
votes
3answers
566 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 ...
2
votes
1answer
344 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: ...
6
votes
2answers
388 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 ...
1
vote
1answer
257 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 ...
-1
votes
1answer
395 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 ...
12
votes
4answers
623 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: ...
10
votes
3answers
376 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 ...
6
votes
1answer
837 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 ...
4
votes
2answers
881 views

Chain rule while differentiating

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 ...
5
votes
2answers
273 views

Creating a list of PopupMenus that dynamically update an element in a list

So as the title says I am trying to make a list where each element is determined by a users choice of an element in a PopupMenu. My first attempt: ...
2
votes
3answers
2k views

Passing a matrix as a function argument

I am trying to do the following: ...
0
votes
0answers
207 views

How Can I Use Conditional with Rational Domain Restrictions [duplicate]

I am reasking this question in a new thread. My previous post How Can I Use Solve/Reduce Output? seemed to have led to a an interesting dissussion of how to (better) solve the problem that produced ...
5
votes
2answers
198 views

Delete contexts from a string representation of a symbol

I want to delete the string representing the context of a symbol. For info I need such a functionality in my ShowIt function defined here I'd like to know how I ...
6
votes
1answer
653 views

vectorial ODE in mathematica with matrix exponentials

I want to solve the following equation in mathematica : DSolve[{X'[t] == A.X[t], X[0] == ( {{0},{0}} )}, X[t], t] It is a system of 2 ODEs coupled by the matrix A, ...
6
votes
2answers
235 views

How do we turn off automatic smart quotes/special character substitution?

In Mathematica 8, whenever I enter "hello" into a cell of style "text", the quote marks are automatically converted to special characters: ...
4
votes
1answer
569 views

Can DSolve solve systems with unspecified function coefficients?

I am an economic research student with no previous experience with Mathematica, so please pardon me if my questions sounds really stupid. I am hoping to solve a system of nonlinear ODEs symbolically. ...
1
vote
1answer
413 views

Fastest way to sum pairwise potentials

I've been writing a function to sum a pairwise potential on two lists, i.e. two charged bodies, each containing N >> 1 and ...
11
votes
4answers
589 views

Reproducing Image Patterns with Mathematica

Surfing on the net I stared at this pattern. It´s a bamboo steam, and it´s awesome. I'm new to Mathematica so I'm a little lost, I'd like to try to reproduce this pattern, of course in a very ...
14
votes
1answer
557 views

Detecting and counting signals in list data: checking pulse rate

Hope this isn't too much of a basic question: I'm looking for some Mathematica functions, but I don't know which ones. Background I recently read about a simple technique for reading your body's ...
9
votes
4answers
622 views

Finding the roots of Hypergeometric1F1[]

I am trying to find the roots, λ, for this equation: Hypergeometric1F1[1/4 (2 -  λ /β), n + 1, β] for certain ...
10
votes
2answers
760 views

Preventing label crowding in PieChart RadialCallout and RadialCenter

Is it possible to avoid this unreadable situation with label crowding when using PieChart's RadialCallout and ...
3
votes
1answer
666 views

Mathematica - Dynamic - ListPlot - baseline

I am performing baseline fitting to a raw dataset on a two-state equilibrium process. The process involves fitting the sigmoidal curve to an upper and lower linear baseline, and subtracting so that ...
1
vote
1answer
251 views

How to print a message dialog window

I'm trying to figure out how to print a message dialog without printing the whole notebook. FrontEndExecute[FrontEndToken["PrintDialog"]] displays the print window ...
2
votes
3answers
246 views

How can I fix CDF Windowsize as constant

I want to make CDF WindowSize as constant so that the end user can not resize it either by dragging Window or by maximizing it. ...
5
votes
1answer
1k views

How Can I use Solve/Reduce Output

Suppose I want x and y to be rationals Solve[ x^2 + y^2 == 1, {x, y}, Rationals] I am ...
2
votes
1answer
405 views

PlotRange problems

I have a Delay Differential Equation of the form: ...
3
votes
1answer
539 views

Mathematica PDF import and fonts

I am trying to put nice LaTeX labels on my Mathematica plots. I can do this manually, or by introducing an extra GNUPlot step into my workflow, but it would streamline the process considerably if ...
3
votes
2answers
801 views

Plotting best-response functions

I'm a newbie in Mathematica. I'm trying to solve for two functions (best-response functions in a simple game), and then to plot the functions on the same graph. One function is p1 = resp1(p2) and the ...
3
votes
1answer
282 views

Could the PrecisionGoal for NDSolve be a negative number?

The help of Mathematica doesn't say so much about the PrecisionGoal for NDSolve, and I never considered much about it even after ...
3
votes
1answer
199 views

How to make a package for buttons

I am trying to make a Package for a piece of code though it's not needed here as it is very small. But my actual code here is a little bit different from that ...
20
votes
5answers
752 views

MapThread over sublists of different length

I have a list which looks like this: l={{1,0,3,4},{0,2},{0,0,1,3},{1,2,0}}. Now I would like to count how many 0s the sublists contain in the first, second,... ...
7
votes
1answer
297 views

Histogram3D frame ticks with bin text labels rendered in x-y plane?

Is it possible in Histogram3D to substitute frame ticks text labels and have the layout in x-y plane? Starting with a ...
12
votes
1answer
1k views

Persistence length of a polymer chain

I'm trying to calculate the persistence length (Lp) of a polymer chain using Mathematica. The first and simplest method is to compare the EuclideanDistance between ...
3
votes
2answers
203 views

How does RootOfUnityQ work?

How does Mathematica's RootOfUnityQ function work? That is, how does Mathematica know if a number is a root of unity? Example: Let $x = \frac{1-i \sqrt{2+\sqrt{5}}}{1+i \sqrt{2+\sqrt{5}}}$. Then ...
13
votes
4answers
3k views

Cut and paste data from a spreadsheet

I have a set of data points in two columns in a spreadsheet (OpenOffice Calc): I would like to get these into Mathematica in this format: ...
5
votes
3answers
172 views

StandardForm on Graph edges

The Graph command displays edge labels in TraditionalForm. I instead want to use ...

15 30 50 per page