# All Questions

695 views

I am trying a read a file that's arranged such that there's alternating set of rows containing data that I don't need and data that I need. So for my case the first n lines in the files are useless to ...
2k views

### Calculating a minimum bounding box for a set of 3-space coordinates / spheres

I have a set of 3-space coordinates for the atoms of a molecule (I could also transform them into spheres with radii corresponding to the atoms they represent). I would like to place this molecule ...
118 views

### Draw only the top of the boundary of a function in Plot3d

So currently I have via combining 3 Plot3D's in a show. My question is how can I make it so that the ONLY portion of that border highlighted green, is the "curving portion" in the xy plane, rather ...
2k views

### Importing a matrix from a text file

I have a $4 \times N$ matrix in a .txt file of the form: -17.071 137.567 16.554 0.65 -16.873 136.138 16.934 0.7 -15.397 135.738 16.894 0.7 -14.7 135.982 15.9 0.6 ...
2k views

### Finding a best fit curve and plotting it [closed]

I have a list as shown below: m01 = {{250, 0.083121}, {200, 0.0888446}, {150, 0.0992422}, {100, 0.121567}, {50, 0.186825}} I'm new to Mathematica, and would like ...
339 views

### Defining a function by pieces using list of interpolated functions in order to use FindRoot

I have two lists with the interpolated functions ...
648 views

### Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs

Using global variables the following turns an "expression" into a Function: expr = 2 x; Function[x, Evaluate[expr]] Of course ...
440 views

### Running .NET/Link on Mono (On MacOS or any UNIX or Linux Distro)

Has anyone have any luck running .NET/Link on Mono? When I run .NET/Link to call Mathematica from within a Mono program, this is the error message I receive. ...
226 views

### How to find derivative of a numerical solution, where precision is ambiguous?

I am trying to take the derivative of a numerical solution. I am concerned that the way I'm doing this may be problematic due to numerical error; I think there must be a better way but I'm not very ...
2k views

### How do I create a matrix of functions?

I'm trying to create a matrix in which the elements are functions of two variables, but I can't figure out how to do it. Is it possible? The only way I could figure out is to define the matrix in ...
167 views

### Expression for the real 7/3 power

I need an expression for the real 7/3 power of a real-valued function, i.e., a reformulation of f[x_] := g[x]^(7/3) that works for negative values of ...
802 views

### Variable name string to expression

I'm not sure how to name this problem appropriately. But anyway. I have, say, three variables (arrays in my case), which I call: A1, A2, A3 I would like to ...
111 views

### Collecting roots of different equations and create a list

I solve two equations and have two solutions one by each equation. I want to create list of these roots. Could anyone please help me? Appreciate it. m02R150 = FindRoot[P1 == 0, {E1, 0.07, 0.1}] ...
192 views

### Executing C programs within mathematica [duplicate]

I have a requirement for executing a C program within Mathematica. The user will provide the inputs and the expected results on a front end. Mathematica runs the C file, obtains the result for the ...
410 views

### Variant of the cutting-stock problem in Mathematica

I'm pretty new to Mathematica and am trying to learn to solve problems in a functional way. The problem I was solving was to list the ways in which I could sum elements from a list (with repetitions), ...
777 views

### Copy and pasted graphics are fuzzy

I have a function that creates a 2D line with filling to the axis. When I copy this graphic into word it is very fuzzy, so much so that the numbers and text are almost unreadable, not to mention the ...
356 views

### How to remove some elements in a list based on a rule?

I want to deal with the following list. mylist = Table[cof[i] exp[i], {i, 1, n}]; (*n is very larege *) exp[ ] is a function ...
338 views

### Question about using a pattern in ReplacePart

I noticed that "ReplacePart" can use pattern. For example: ReplacePart[{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, {i_, i_} -> x] {{x, 0, 0}, {0, x, 0}, {0, 0, x}} So ...
277 views

### Extracting data from a table under conditions

I have a very large table with two columns. Let's say the name of first column is E and the name of the second is P. How can I get the E values when P = 0.
2k views

### 2D Heat equation: inconsistent boundary and initial conditions

I'm attempting to use NDSolve on a 2D boundary value problem with initial conditions. Upon running my code, I get the following message: "NDSolve::ibcinc: Warning: Boundary and initial conditions are ...
695 views

### Filling only when one curve is below the other

I want to fill the area between two curves only when curve-1 (Black) is below curve-2(Blue). So In this example, I don't want the middle portion shaded but just the left and right tails to be shaded. ...
1k views

### Keep function range as a variable

Plot[2*x^2 - x + 2, {x, -1, 1}] plots a function of x from -1 to 1. As far as I can see, I cannot "save" this range in a variable: ...
618 views

### How do I get a two-term polynomial with a leading negative sign to display in the correct (i.e. textbook) order?

The first three expressions evaluate as expected and the polynomial is displayed in what I would call "textbook" form. The last expression, however, switches the order of terms. Mathematica employs ...
490 views

### Efficient way to utilise Parallel features to make use of many cores

Let's say I have 100 cores/kernels as my disposal and want to compute a function of two variables f[x,y] over {x,1,10}, ...
118 views

I'm trying to get this expression to display as typed instead of evaluating the 1/1.121. ...
89 views

### Formatting Equation Output Neatly

I looked around and couldn't find the answer to this anywhere, so I'm sorry if this is a bad question - I'm pretty new to mathematica. I wrote a program to help me compute some annoying series ...
90 views

### Calibrating Precision in calculations

As the title says, I encounter an irritating problem which has to do with the accuracy or the precision used in the calculations. To be more specific, I have the following code: ...
702 views

### Octonions in Mathematica

Is there a package or Notebook for Mathematica that can enable me to do some numerical calculations with octonions? Maybe a way to plug-in the octonion multiplication table?
173 views

### How to programatically save a notebook created by CreateDocument

I've already written code that generates about 20 notebooks using "CreateDocument" and I was wondering if there exists a method to automatically save them. Is there an easy way to create a notebook ...
504 views

### A Faster way to combine two Lists of different structures into one of a different structure [duplicate]

I have the following two lists (each containing over 500,000 elements). Here is a sample: ...
1k views

### Voronoi diagrams for generators other than points

Any suggestions how to determine Voronoi diagram for sites other than points, as e.g. in the picture below? Input is a raster image.
526 views

### Forcing evaluation of ArgMax

How to force evaluation of ArgMax before its output gets used in Solve? Background: I'm trying to solve for the Nash ...
227 views

### Why does ; suppress Dynamic output? [duplicate]

Dynamic[x=7]; does not make x dynamic! But Dynamic[x=7;] makes ...
347 views

### How does the built-in debugger decide what to highlight?

How does the built-in debugger decide which definition to highlight in the notebook when Break on messages" is enabled? Here's an example to illustrate what I mean. First, enable the debugger ...
333 views

### What is the value Re[Sqrt[1+I*2*x]]?

When I try to evaluate Re[Sqrt[z]], for some values of Mathematica fails to evaluate it. For example, Re[Sqrt[2 + I*x]] ...
251 views

### Color coding based on 4D data within a building

I am trying to create something similar to a Heatmap within a building. Suppose I have a room with dimensions, {30,40,50} as length, width, and height respectively. I have a set of data that is of ...
205 views

### ContourPlot of a complicated function

I have the function $pot_1(x,y,z)$ which is given in analytical form. So, in order to plot the contours at the primary planes $(x,y)$, $(x,z)$ and $(y,z)$, I use the following ...
353 views

### Why does compiling a function with ConstantArray give an error when used in parallel?

Here is a sample compiled function: ...
245 views

### ConditionalEntropy and StatisticsLibraryNConditionalEntropy

There is a function available from the StatisticsLibrary context called NConditionalEntropy that appears to compute ConditionalEntropy. Thus ... ...
414 views

### Solving an equation involving a determinant

I have a matrix which doesn't include numerical values. There are four variables in it. It is defined by ...
1k views

### Custom mesh in ListPlot3D

I have the following data: ...
119 views

### Proper treatment of roots and powers in Series?

I have the following problem in Mathematica 9 on Linux. I let Mathematica compute the Series expansion: ...
399 views

### How do I draw multiple 3D shapes defined by lists of points?

I'm attempting to draw $N$ cones on a 3D object, where each cone is specified by a pair of 3D coordinates. The first coordinate is for the cone's base, the second one for the cone's apex. Here, I ...
570 views

### NonlinearModelFit returning nonsense for very simple data

In fitting the following data, if I first log transform the y-values and use LinearModelFit I get a set of parameters that fits the data: ...
351 views

### Evaluate Numerator and Denominator Separately

I have this function. ...
146 views

### How can I keep a plot's filled area from obstructing other lines when exported as EPS?

I am plotting several functions, some of which have fillings. After I combine all the functions together on a plot and export the plot to an EPS file, the fillings obstruct other lines. Exported PDF ...
108 views

### Erfc Not Returning Results Specified in Documentation

In the documentation for Erfc (under "Possible Issues"), the following command returns a number that is extremely close to 2: However, when I run this same command in a fresh kernel, I get: ...
953 views

### Error message from evaluating NonlinearModelFit

I am trying to fit data to a Morse potential using NonlinearModelFit as follows: ...