# All Questions

176 views

### How to calculate time period?

I have the starting and ending dates and times. And I need to calculate the night time in this period (from 10 pm (22) to 6 am (6)). Example: starting date and time is {2015, 1, 4, 3, 10} ending date ...
186 views

### How to parse string to expression? [closed]

When trying to make a string an expression I see some wrong results: ...
96 views

### Is there a way to search for Arithmetic Progressions in a list?

If you have a list of integers is there a way of searching that list to see if there is a trend of Ax+B in the list? Not using all of the numbers, just seeing what trends like that are embedded in a ...
66 views

### Convert Dates to values on an X axis

I have a bunch of dates and values which I put into the DateListPlot to get a graph. However I would also like to put this information into the Fit or LeastSquares to estimate what the value would be ...
207 views

### How to highlight the elements in a list that match a pattern?

For example, {{1,2,3},{1,2,3,1,2,3,4,5}}with pattern {1,_,3}is transformed to ...
129 views

### How can I speed up this NM optimization? Most delay seems to be due to long analytic expression

I am struggling with computational speed of a NelderMead optimization. Nevertheless my impression is that I lose lots of speed not only due to the NM optimization itself but rather to for instance ...
166 views

### Integration over a convex combination of a region: $\int_{\Omega} (w_1 z_1 + w_2 z_2)^{1-\sigma} d (z_1, z_2)$ where $\Omega = \{ z_1 + z_2 = 1\}$

Take $w,z\in R^{n}$. I am interested in integrating (as generically if possible) $$\int_{\Omega}(w \cdot z)^{1-\sigma} d z$$ Where the domain of $\Omega$ is $1$ dimension, and includes the convex ...
258 views

I have made a package BeginPackage["top"] t[x_]:=MessageDialog["This is top"] t1[x_]:=MessageDialog["This is top1"] EndPackage[] and used the code of this ...
81 views

### How do I integrate this function?

I am very new to mathematica and also new to this community. I have a problem given below, How to express this in Mathematica? $H=[2,4,10,5,12,34,42,\cdots 12]$ is a vector of size $N$. $h_n$ is the ...
70 views

### conditional expectation doesn't work with SmoothKernelDistribution

I'm trying to calculate a conditional expectation E[ x | x > a ], where the distribution of x is inferred from a finite ...
72 views

### How do I get a list of all the variable present in an algebraic expression? [duplicate]

I have an algebraic expression ...
325 views

### What is shorthand way of Reap list that may be empty because of zero Sow

Sometimes because of conditionals, you cannot guarantee that Sow will be called at least once. Reap[Sow[1]][[2,1]] results in ...
246 views

### Is there a way to simplify a symbolic expression at assignment, once-for-all?

I have a series of symbolic function calls that could be greatly simplified using some assumptions. I think I would like for these assumptions to be used in the definition of the function so that they ...
109 views

### What is “ (Dialog) Input [ ] := ” after evaluating a cell?

I have done a time-consuming run and calculation. After many hours ( about 7 hours!), the black color which shows that the cell is evaluating, turn into gray and a strange text appears like this : ...
136 views

### Plotting with arbitrary units

I would like to plot, say, Sin[x/a] with multiples "a" showing on the x axis as units. How can I do that ? I have tried setting the plot limits e.g. {x, -2a, 2a}. I cannot plot said function even ...
1k views

### Lie-Bracket of two vector fields

I'm new to Mathematica (installed couple of hours ago) and I need to compute a few Lie brackets between two vector fields $f$ and $g$.  f\left(\mathbf{x}\right) = \left( \begin{array}{c} ...
55 views

### It is possible to calculate a two vector integral

I have this problem: calculate the integral of: -1+Sqrt[2*d+1] with d being a distance of two points in a 60$\times$60 box ...
116 views

### Comparing elements of a set and deleting elements based on a criterion

I have a function that has two inputs. The first input is a set of 2-element sets, and the second input is a single 2-element set. My function complements each 2-element set with the second ...
867 views

### How to use Union on list of lists without sorting them first?

If I do ClearAll[a, d] lsts = {{a, d}, {a, d}}; Union[lsts] I get the expected answer {{a, d}} but if I do ...
39 views

### Procedure argument value change [duplicate]

I'm trying to create my own hamiltonian cycle algorithm using Mathematica for school, and I'm stuck on a syntax issue. I get the following error: ...
162 views

### Find value of x such that x! less than or equal to 1000

I am trying to find the maximum value of $x$ such that $x! \leq 1000$. I tried the following: NSolve[Factorial[x] - 1000 == 0, x] but I got this message: ...
68 views

### Delete permutations of subtables in a table [closed]

I've got a table of tables: $A=\{\{a,b\},\{b,a\},...,\{a,b,c,d,e\},\{e,d,c,a,b\},...\}$. How do I do to remove backward duplicates, or more generally permutations of duplicates in the table? For ...
53 views

### Create a Table depending of two variables [closed]

I tried to create a table depending of two variables as: W= Table[{G[[i]], G[[j]]}, {i, 1, 3}, {j, 1, 3}] I wanted it to look like ...
368 views

### Place legend without border above the plot

I use Mathematica 7.0 and as far as I know, there is not method PlotLegends, only PlotLegend. I want to set my legend - without background, shadow and frame - above my plot, as in the example belowe: ...
39 views

### How to use FindFit to find the parameter in Laplace space(numerically inverting Laplace transforms)

I am trying to find the parameter in Laplace space, and a very simple example is shown below: I have known the solution $y_{laplace}$ in the laplace space is $a/s^2$, and I also have some discrete ...
140 views

### How to obtain Laurent series coefficients of an (almost) arbitrary function?

I have observed that Series in Mathematica assumes that the given function is smooth in the point around which one wants to perform series expansion. For instance: ...
187 views

### Periodically tiling a function

I have a function which creates a hole of varying radius, depth and would like to tile it in x and y. ...
514 views

### What is the status of ::usage` and Templates in Mathematica v10.1?

In Mathematica 9, a number of issues concerning the ::usage and templates were raised. In 9.0, there was a bug first reported here and better diagnosed here, where ...
107 views

### Using InterpolatingFunction in equations

I tried to use InterpolatingFunction in another ODE, but it doesn't work, because it seems for Mathematica that 2 functions are unknown instead of one. ...
68 views

### Block Matrix Multiplication [closed]

I have a = {{-1}, {0}, {0}} b = IdentityMatrix[3] c = {a, b} d = {{7}, {2}, {0}, {0}} and would like to compute e = c.d ...
53 views

### Some problems about ListPlot3D, plot 6 faces of a 3D region [duplicate]

I get the data of six faces of a 3D region. ...
63 views

### Strange “Collect[…]” behaviour

I have a large expression which I need to simplify by pulling out a load of constant terms. Collecting terms seems to only work when the expression is expanded out, e.g. ...
166 views

### Limit the number of processors used by ParallelTable?

By default, ParallelTable will use all the processors available in a PC. Is there a way to set a limit to the number of processors used by ...
70 views

### ? (Definition) versus ?? (Information)

What is the difference between ? Definition and ?? ...
111 views

I have a list of about 50 conference attendees with 3 columns (First name, Last name, University). I would like to use Mathematica to generate the conference badge for each people. The badge dimension ...
94 views

### Finding the intersection of two graphs [duplicate]

I'm having difficulty with finding the intersecting point of two graphs. Here is what I have done so far: Plot[{8*n^2, 64*n*Log2[n]}, {n, 0, 100}] which produces ...
641 views

### What is the difference between Composition (@*) and sequential applications (@)?

What is the difference between f@*g@*h@x and f@g@h@x Both evaluate to f[g[h[x]]] ...
163 views

### Numerical 3D Integration in Mathematica [closed]

My question in short is: Is it possible to make numerical 3D integration in mathematica efficiently? Or am I gonna have to move this to C++? I feel this problem is way too trivial to go to C++, so ...
196 views

### How to make a world map with a coloured ocean and transparent land surface?

I'd like to make a world map with a blue coloured ocean and transparent land surface (to be used later as an overlay). With: ...
171 views

### What is “MouseDragged”?

Maybe I'm picky but I don't consider static pressed button: "dragging". EventHandler[Framed[1], {"MouseDragged" :> (Print@RandomReal[])}] neither does ...
2k views

### Finding a Concave Hull

I have a 3d clustered data: Is there any other way to get concavehull of 3D data points?
104 views

### How do I map a function onto the result of an expression that already has a pure function as an argument

I admit that I have only a basic understanding of the way Mathematica handles pure functions - enough to be dangerous, unfortunately. I have some data that is in a list of lists of lists. I would ...
67 views

### Is there a shorthand for Optional with Condition?

I have a recursive function that does some work to an object for a repeatedamount of times. ...
245 views

### SystemException[MemoryAllocationFailure] with Memoized function [closed]

Version 10.1 Win7x64 Enterprise. This is more of a report than a question but others may have seen the same / have insights. I have some code (that I can't really post as it's too big) with a large ...
116 views

### Plot roots of polynomial system of equations in 3 variables

I have the two equations $x^2 + 2y^2 + z^2 = 1$ and $xz -y^2 = 0$ I want to plot the roots in 3D. i.e the coordinates $x,y$ znd $z$
138 views

### DeleteDuplicates in a list of 2-tuples under condition

Having a list of 2-tuples, I would like to delete such 2-tuples that have 0 at second position, but only those, whose first element is not unique in the list. E.g. ...
58 views

### Improving RationalInterpolation Result

The following code produces a {4,4} rational interpolation approximation accurate to 10^-6 or better over the range ...
243 views

### Region bounded by Ellipse and Line

I have an ellipse defined either as algebraic or geometric: algebraic: ax^2 + bxy +cy^2 + dx +ey +f = 0 geometric: major Axis, minor Axis, x center, y center, ...