# All Questions

1k views

### How can I rationalize the denominator of an expression?

Mathematica doesn't rationalize the denominator automatically, and I haven't found anything in the documentation about it. But I found an old post on MathGroup, which proposes a solution using ...
247 views

### Calculating the Mean of a Truncated Multinormal Distribution

First, I'm a little disappointed that Mathematica balks at: Mean[TruncatedDistribution[{{0, Infinity}},MultinormalDistribution[{0}, {{1}}]]] Second, is the ...
267 views

### Thread a function over a list and with a non-atomic 2nd parameter?

From the documentation, Thread's behavior on functions where the first parameter is a List and the second is an atomic expression, is this: ...
568 views

### How to find the maximum value of an integer that satisfies some inequality

Consider the following Mathematica expression: Reduce[2^j/(j + 1) <= 10, j, Integers] which outputs: ...
320 views

### Getting Internal Self-Test Error

I have two questions related to this simple code: ...
1k views

### Mathematica vs. $\LaTeX$? Replacement for Legacy “Authoring Tools” package?

I'd rather write in Mathematica than in $\LaTeX$, but it's not really practical, especially for big works (> 100 pages) without good tooling. I'm just starting to look into what's available for big ...
211 views

### Symbolically associate vectors and their norms

I am wondering how to handle the following situation: I do have vectors of known dimension that I would like to handle symbolically. I suppose I can do something like ...
700 views

### Sorting a list with secondary criterion

Is there an easy way to sort a list on multiple levels of criteria? By this I mean, first the list should be sorted according by criteria A (the same as using the usual sort function, ...
223 views

### Combinatorica: Girth[] and FindCycle[] disagreement

Warning: run the following code in a fresh Mma session, as some symbols could be shadowed (depending on your Mma version) While trying to answer this question, I fell into the following: ...
165 views

### Asking for input in an event handler

Why won't EventHandler["text", {"MouseClicked" :> (output = Input[];)}] work? When I click "text" the kernel hangs.
245 views

### Why doesn't Mathematica pack Boolean arrays?

I've been wondering about this for a while now, so I'm going to ask. This is a question about the design of Mathematica, which perhaps cannot be directly answered by anyone but the designers, however ...
401 views

### Changing background colour of a Manipulate element

Please consider the following: Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}]; Now, I would like to change the background colour to yellow. I tried ...
495 views

### Computing polynomial eigenvalues in Mathematica

MATLAB offers a function polyeig for computing polynomial eigenvalues, which appear, for instance in quadratic eigenvalue problems (see here for some applications) such as: ...
288 views

### pH calculations, speeding up code involving Solve

I'm trying to calculate pH values of solutions containing water and acetic acid. The relevant equations have been defined and I now want to find a solution using Mathematica. For a specific acid ...
96 views

### What is the best way for an application to provide customisation options for the user?

Suppose that an application needs to be configured specifically for a user's system. e.g. the application needs to be told the location of certain data directories. What is the best way to provide ...
288 views

### Finding first instance of a relationship between elements in two lists

Suppose I have two lists, say: A = {1,5,10,200,50,7} B = {4,3,19,78} For each element in A, I would like to find the index of the first element in B which ...
574 views

### Using constraints in Solve[]

I'm not sure if the title fits. I'm basically just looking for a way to define a value and constrain it to $[a,b]$ when I use Solve later. More specifically, I ...
335 views

### How to properly remove the CUDAResources paclet?

I have Mathematica 8.0.0.0 installed on my Mac, and while I tried to see what it could do with CUDA, it downloaded a large directory (~1 GB) named ...
730 views

### How can I tell mathematica to generate an histogram from nominal data?

If I write: Histogram[{1, 1, 1, 2, 2, 2}] I get a nice histogram chart but if I write ...
70 views

136 views

### How do I mimic the functionality of “<>”?

The Cell expression for: <> is Cell[BoxData["<>"], "Input"] However similar expressions are parsed into ...
1k views

### Map a function across a list conditionally

It seems that this is a really basic question, and I feel that the answer should be obvious to me. However, I am not seeing. Can you please help me? Thanks. Suppose I have a list of data ...
558 views

### Manipulate a Differential Equation result

I want to Manipulate the result of Differential Equation like : ...
81 views

### MousePosition Scaling over a cell

I'm trying to have the button follow the mouse while within the output text cell. The scaling does not exactly work as intended (fails to follow mouse correctly). ...
494 views

### Determine whether some expression contains a given symbol

Given a symbol t and an expression expr, how can I determine whether or not the symbol t ...
138 views

### Problem with UpdateInterval

I want to monitor current results with Dynamic ...
248 views

### Differentiating an unknown solution to a PDE

Sorry if this question is too basic -- I'm not very familiar with Mathematica. I am interested in a way to systematically address the following sort of problem: Suppose that $u=u(x,y)$ is a function ...
1k views

### FindFit returns worse result when putting constraints on parameters

I want to fit some data to a model of exponential decay using the FindFit function: ...
399 views

### A palette of accumulated expertise

I've been trying to put together a palette of useful functionality garnered from this site. There is useful stuff scattered all over the place, for example: Post an image Copy code Duplicate a ...
362 views

### How to simplify the following trigonometry expression such that the number of used characters is minimal?

How to simplify the following trigonometry expression such that the number of used characters is minimal? (13*Cos[t] - 5*Cos[2*t] - 2*Cos[3*t] - Cos[4*t])/4 The ...
182 views

### Odd behavior of GridGraph and DirectedEdges

For some reason the option DirectedEdges->True, albeit working internally with grid graph, does not appear in the visualisation for 1D and 2D graphs. It also ...
157 views

### Keywords to find documentation for this syntax

Mathematica allows this syntax, but I cannot find any documentation (or books) that discuss the various uses/advantages of it ...
1k views

### Solving a system of equations in two variables

I have a system of two equations in two variables $x$ and $y$. \begin{align} F_1(a,b,c,d,e)x+F_2(a,b,c,d,e)y+F_3(a,b,c,d,e)&=0\\ G_1(a,b,c,d,e)x+G_2(a,b,c,d,e)y+G_3(a,b,c,d,e)&=0 ...
282 views

### Find elements in a decay chain using IsotopeData

I am trying to write a program using the Mathematica function IsotopeData, but am finding the code troublesome. Due to my (relative) familiarity with Python, I am ...
341 views

### How to obtain a fixed number of solutions to $x+y=1$?

How to obtain a fixed number of solutions to $x+y=1$? For example, I want 4 solutions: $(1,0),(2,-1),(3,-2),(-2,3)$ I want to do this also on bigger equations such as $x+y+...=1$ and then I want to ...
302 views

### How can I interrupt Speak?

I want to use an event handler to stop speaking: Speak[ExampleData[{"Text", "DonQuixoteISpanish"}]] The only way I can stop this is by restarting mathematica!
868 views

### Efficient implementation of cubic equation of state

...In this case the Peng Robinson Equation of State. Equations of state are empirical equations with parameters derived from experimental data. They are used to predict pure component and mixture ...
418 views

### Replace values which obey certain criteria

I'd like to replace all values in a list which obey one or more criteria with another value. Example: Replace all values>30 by 30. data={{3,35},{2,7}} ...
199 views

### Arranging elements in a Grid by drag&drop

I have some elements in a Grid. I want to change their positions within that Grid. Can I swap their positions just by dragging ...
113 views

### How to explain the results of the following integrals?

Why does the following program lead to different results of a21 and a211? ...
107 views

### Using EdgeList on a once empty Graph crashes the kernel

Calling EdgeList on a non-empty graph which was previously empty causes the math kernel to crash. For example, ...
114 views

### Problems with setting style options

Consider the following: FirstOutput=Style["Test", FontSize -> 20] SetOptions[Style, FontSize -> 20]; SecondOutput=Style["Test"] I would like the string ...
255 views

### Creating multicolored meshed plots (connected scatter plots) using ListPlot

I would like to make colored scatter plots where the dots are connected by lines. I have tried the following, using Joined->True to connect the dots and ...
714 views

### Emulating R data frame getters with UpValues

What's the best way to emulate R's data frames functionality? This includes the ability to select rows and columns in a 2-dimensional table by the string identifiers positioned typically in the first ...
286 views

### Defining a function using Series? [duplicate]

Possible Duplicate: General::ivar is not a valid variable when plotting - what actually causes this and how to avoid it? I need to define a function using the output of series, i.e. ...
335 views

### Simple contour integral with a parameter gone wrong

I run into the following problem, I tried to evaluate a very simple integral: Assuming[ a > 0 , Integrate[Sin[a*s]/(s - I)^2, {s, -Infinity, Infinity}]] ...
149 views

I'm looking to create dynamic menus with multiple options, and would allow multiple selections. For example, mousing over an object (let's say a black circle of rad 1), a menu would popup at ...
471 views

### Implicit Equality and RegionPlot

I have the following problem: I would like to do a RegionPlot like RegionPlot[F[x,z,y]<1,{x,0,1},{y,0,1}] The problem is that the variable z is an implicit ...
In the following program, the fec[x] is a function depending on $x$ while q3[t] and q5[t] ...