# All Questions

194 views

### How can we ensure the result of Mathematica is exactly correct?

This is an example, I plot a function and find it has a defect when x approximates 400. Plot[Cos[.3 x] Exp[-0.01 x], {x, 0, 1000}, PlotRange -> All] Another ...
226 views

### Improving ListContourPlot mesh triangulation

I have a irregularly placed measurement data. I bring here a small example. I am sorry for that. mdata = {{20., 1.6, 0.218084}, {4.02807, 1.71068, 0.227565}, {19., 1.6, 0.240074}, {18.8333, ...
195 views

### Assign values to variable names in lists

I hope somebody can help me in this (I guess) simple question: I have a list of variable names ls={w0,w1,w2} and another list of values ...
98 views

### How do I sum up p items in a sequence?

I have the following sequence list = {p1, p2, p3, p4 ....} I am summing up the p items as follows: p1 + p2 + 2*sqrt (p21*p2) = p12 p12 + p3 + 2*sqrt (p12*p3) = p123 p123 + p4 + 2*sqrt (p123*p4) = ...
342 views

### Loop until convergence of two variables

I have the following program which i need to repeat steps until until two variables converge and I want this to be printed with the number of iterations: What I have : Input variables: ...
569 views

### Is it safe to launch/close kernels in the middle of a parallel calculation?

It appears that it is possible to launch additional kernels (or close existing ones) during a parallel calculation. The newly launched kernels will be utilized for the rest of the calculation. ...
749 views

### Export high resolution figure causes missing ticks

I understand that Mathematica has a bug when exporting images. The ticks are scaled not correctly when exporting at high resolution. For example: when you do: ...
285 views

### How can I create a class of matrices programmatically?

I am trying to figure out how to create a function that can create the matrix pattern below, where: f[1] returns {{1}} ...
2k views

### How to calculate volume of convex hull and volume of a 3D object

I have a set of random 3D data points. How can I calculate the volume of the convex hull?
488 views

### How to use a ConvexHull as RegionFunction?

I have a set of data supported over a region in 2D. I want to use RegionPlot and ContourPlot on interpolations of my data, but want to restrict the Plots to the region over which my data is supported. ...
2k views

### How can I manipulate TemporalData?

Version 9 introduced TemporalData but, truth be told, the documentation doesn't suggest that one can do much with it. Many of us have probably assumed we'd be ...
384 views

Is there a way to convert a Delaunay Triangulation into a Graph structure so that one can generate an AdjacenyMatrix of the Delaunay?
154 views

### Generating EventHandler using Table

I would like to change the edge color of a graph when double clicking on it, the following code works: ...
372 views

### Does Eigenvalues evaluate in a parallelized way?

I use mathematica on a computer with linux operating system. The computer has 2 cpus and each cpu has 4 cores, so there are totally 8 cores available. Now I got confused with whether the evaluation ...
183 views

### Choosing a branch of the square root when performing a series expansion

I have the following problem. Consider expression f=Sqrt[(x-2y)^2] There is an obvious ambiguity in the definition of f ...
723 views

### In a ListPlot of LinearModelFit, plot error band

This is similar to this question. The fitted line can be plotted alongside with the data with this code: Show[ListPlot[data], Plot[lm[x], {x, 0, 5}]] I would ...
439 views

### Nested list to graph

The following nested list can be regarded as a representation of a (tree) graph: ...
187 views

### Using FortranForm

I need to use in Fortran, matrices that I create in Mathematica, therefore, I need to format them, so that Fortan can understand them. I focus on the simplest example: Let's say I have tha matrix A ...
98 views

### Historical Prices via FinancialData

I downloaded the historical stock prices for some stocks in the period 1990-2013 via FinancialData some months ago and computed the financial returns. Now I downloaded the data again for the same ...
143 views

### Creating nested matrix using random integers

How do i create 15x2 matrix with 2x2 random integer elements? My code only returned identical 2x2 elements:
415 views

### Plot has red 'film', no error message

I am encountering really strange behavior: I wrote a function that plots values some data. After executing the code the resulting plot has the red 'error' colour, but only momentarily (maybe 0.1 sec). ...
177 views

### How to include constraints in NMaximize

I am trying to find maximum likelihood estimates of parameters for a fairly complicated multivariate distribution. The support of the distribution depends on its parameters so I need to include some ...
78 views

### Calculating the recursion at the Fourier domain

I would like to calculate the following recursion with mathematica $$f_n(x)=\int_{B}^{A}f_{n-1}(x-\omega)f(\omega)\mbox{d}\omega\quad\quad f_1(w):=f(w)$$ This is simply the convolution of $f$ with ...
3k views

### Making Axes logarithmic in 3d plots

I've been trying to get loglog plots in 3D, but to no avail. My initial approach was to take the logarithm inside the plot i.e ...
393 views

### Making a flag with six vertical stripes

A flag is to be made with six vertical stripes by using colours yellow, blue, green and red in such a way that no two adjacent stripes should have the same colour. In how many ways is this possible? ...
123 views

### Multi-legend issue in ChartLegends?

Been fiddling around with the legends and trying to place one in each corner and I bumped into an issue: ...
139 views

### how to find iso-cost contours on a 2d plot efficiently

Consider a 2D plot in which dimension 1 and 2 represent quantity 1 and 2 respectively ranging over 0 to 100. Each point in the space corresponding to (x,y) represent cost of choosing quantity 1 as x ...
131 views

### The algorithm of ListGraphs[n,m]

I'm not sure if this is a Mathematica problem, math problem or a CS problem, so if this is off-topic please transfer it. In the package Combinatorica there is a ...
803 views

### Write any positive integer as a sum of squares

With n = 17 I would like to get {4, 1} and with n = 999 {31, 6, 1, 1} so that, for example, ...
116 views

### Integrating a function forcing parameters to be real and positive

I'd like to integrate the function $f(x)=x^{a-1}e^{-b x}$ over the interval $[0,\infty)$. f[x_] := x^(a - 1)*Exp[-b*x] Then: ...
84 views

### Numerical integration with purely numerical integrand

I'm trying to perform a numerical integral with an integrand that should not be manipulated with any symbolic preprocessing whatsoever. Consider the following simple test : ...
295 views

### How to highlight the whole selected cell

Is there any way to highlight the whole selected cell? some times if I want to delete a certain cell and if the code is long and cells are without output, it is hard to know which cell that you are ...
103 views

### How to eliminate (hide) output numbers in a slide show

I am creating a slide show with several imbedded Manipulate objects. I can hide the Manipulate command by clicking on the ...
165 views

### Solve a system of M equations without specifying M

This post has been edited heavily in response to the comments: my initial question was very confusing. I am trying to write my game-theoretic model in Wolfram Language. There is only one remaining ...
78 views

### Compiling function with predefined expression

I'm using the Compile function in Mathematica to compute say the following : f=Compile[{x,_Real},Cos[x]] Then I can compute f[x] for x taking any real value. Ok, ...
144 views

### Vertex Names of Subgraph in Order of Connectivity

I extract path subgraphs $P_4$ of an undirected graph $G$. And want to list the VertexNames of the subgraphs in the same order as they are connected. Here is an example: ...
76 views

### Defining a function (but not explicitly)

I have a question that must have a simple answer, but googling and searching this website did not produce an answer, so I'm asking it here. I'm working with three variables $x, y, \theta$, and I want ...
697 views

### How can i get the solution of complicated equation?

This is the equation about zeta. NSolve[eq] could not solve this equation. (I think it is too complex to solve by NSolve.) I ...
108 views

### Change Default Font Color of Commands [duplicate]

I encountered to two problems with Mathematica: one: How can I change the default font color of commands and functions in Mathematica (which is black) to another color, so that whenever I wanted to ...
327 views

### Absolute value and argument of a complex expression

I would like to find the absolute value and the argument of the expression: $x + \sqrt { x^2 + y^2 }$ under the assumption that the absolute values of $x$ and $y$ are equal. I have written: ...
112 views

### What is the 'Mathematica-way' to test a variable transform?

Hello Mathematica experts. I would like to play around with a simple variable transformation, to test some claims about it. I wonder if there is a Mathematica-like way to do this. The specific case ...
189 views

### How can I obtain the complex root of an equation with FindRoot

I want to obtain the complex roots of some equations that are similar,but each of them has a different condition. this difference is the value of α in these ...
1k views

### NIntegrate: integrand has evaluated to non numerical values

I have pasted a code that has been giving me some trouble and errors when I try to compute. ERROR: "The integrand 1435.1232 E^(-6.4703566*10^6 s^2) deEntrance[s,phi]^2 has evaluated to ...
588 views

### Tracking iterations of a function

I'm learning MMA with Wagner's book. On page 41, he uses this to display the iterative steps of a FindRoot. However, I can't seem to replicate this (code at end), perhaps due to the difference in MMA ...
292 views

### Integration and Fourier transform

I would like to calculate the distribution function from the characteristic function. There is a formula given as F_X(x)=\frac{1}{2}+\frac{1}{2\pi}\int_{0}^\infty \frac{e^{i w x}\phi(-w)-e^{-i w ...
1k views

### Smooth Peter de Jong attractor

Today I was playing with Peter de Jong attractor. At the bottom of the page I've linked there are beautiful examples like: My attempts are not so great: It is around 10^5 points. For more than ...
156 views

### Inverse of a restriction of a non-invertible matrix

Let $A∈R^{4×4}$ be a non-invertible matrix, with $2$-dimensional kernel. How can I compute the inverse of the restriction of $A$ on a subspace where it is invertible: $A^{-1}v \,\,\,\,$ where ...
275 views

### NIntegrate (multi-dimensional integral)

I am interested in the numerical evaluation of the following integral: $\int \prod_{i=1}^n dx_i \delta(\sum_{i=1}^n x_i) \prod_{i=1}^n f_i(x_i)$ where $f(x)$ is a complicated function. Unfortunately ...