2
votes
1answer
176 views

Finding the minimum of a function

I asked this question Mark Minimum Value in DensityPlot. Another question has come up, or better said, a task: Find the minimum of a function. I haven't been able to write the needed code for that, ...
10
votes
2answers
150 views

How can access to curated data needed by GeoRegionValuePlot be speeded up?

Seems that GeoRegionValuePlot requests data from the internet multiple times to process its plot. As an example, let's graph smoking per capita worldwide. ...
12
votes
5answers
770 views

GroupBy several keys while keeping the Dataset as a Table (List of Associations)

Assume you import data from a Table source of the following format. ...
7
votes
3answers
342 views

Generating a polynomial that's accurate to within an error of no more than 1/10^5

I'm currently stuck on a question for class that asks... "Find a polynomial p[x] that you can use to calculate 6 ArcTan[x] to ...
1
vote
1answer
55 views

Interpolation function evaluation and timing

Lets define two identical functions $f$ and $g$ in a slightly different way ...
3
votes
2answers
158 views

Inserting rows of one matrix into rows of another matrix sequentially

I have two matrices M1 and M2. Both have same number of columns but different number of rows. I want to make a new matrix M which should have 1st row form M1, second row form M2, third row form M1, ...
1
vote
1answer
162 views

When plotting vector fields what is the difference between the following?

I am a new Mathematica user, and I have run into a question. What is the difference between the output of the commands: ...
3
votes
4answers
225 views

Replace all symbols in a matrix with their numbered forms

I have a matrix made mostly from "x" with a few 0's thrown in: ...
2
votes
2answers
125 views

Integrate returns unexpected result

Consider the following function $$g(x,y):= \frac{1}{( (1+y)^2+x^2 )( 1+ax^2y^2 )^2}$$, where I assume that $y\geq 0$ and $a\in (0,1]$ is a parameter. When I try to evaluate the integral $\int ...
15
votes
1answer
209 views

File-name completion for custom functions

Mathematica 10 has introduces file name completion. It works only with certain built-in functions such as Import, SetDirectory, ...
12
votes
4answers
327 views

Dataset: get number of levels and elements

The summary box for Dataset objects shows the number of levels and elements at the bottom. How can we get these values programmatically? For example, "4 levels, ...
5
votes
2answers
238 views

Mark Minimum Value in DensityPlot

Let's take this example: DensityPlot[Sin[x] Sin[y], {x, -4, 4}, {y, -3, 3}] How do I retrieve the minimum value and position of the minimum of a plot from the ...
0
votes
1answer
58 views

Assign keyboard shortcut unique to notebook

What is the most portable way to assign keyboard shortcuts unique to each notebook? To clarify I would like to have the keyboard shortcut change when simply changing the current ...
3
votes
3answers
98 views

Replacing a sum of expressions

I have an equation which Mathematica solves but gives a huge output. However I notice in this output that the same expression occurs many times. Namely: $E=864 a^6 - 432 a^4 b^2 + 54 a^2 b^4 - b^6 + ...
1
vote
0answers
56 views

Moments Ratio Plot using “ProbabilityDistribution”

I am trying to plot moments ratio plot with the following code: ...
3
votes
2answers
172 views

The value of an option inside a native function

I'm looking for something similar to AbsoluteOptions but that can be evaluated inside the function. That is, I want to read the absolute settings of options ...
4
votes
1answer
127 views

What would be a pattern for a general row of an identity matrix?

I know this is a novice question but I would like a pattern for a list containing zero or more zeros followed by exactly one 1, followed by zero or more zeros. Something like: {0___,1,0___} But ...
6
votes
2answers
309 views

Problem when defining function through NIntegrate and NDSolve and Interpolation - Bug?

More than a single question, I have some doubts about the output of certain functions when defined through the result of other calculations. I am an active user of Mathematica, but maybe I haven't ...
2
votes
1answer
67 views

How to create a numerically “equal” function?

A simple example about what I need to do. For example, I have three functions: t1[x,t] t2[x,t] t3[x,t] and, ...
16
votes
5answers
422 views

Mismatch between numerical and analytic evaluation of an integral

I evaluated the following integral $$\int_0^1 \sqrt{r} \left | \cos \left(\left(k+\frac{1}{2}\right) \pi r\right)\right | dr$$ ...
3
votes
3answers
396 views

ContourPlot - unequal contour spacing

how can i specify the contour spacing or how the color range is distributed amongst the function values? Let's say i plot some function depending on x and y. Function values differ between [0, 1]. I ...
4
votes
3answers
229 views

unlisting a nested list

I have a list like this: list = {{a,{1,2,3}},{b,{1,2,4}},{c,{{1,4,5,5},{6,3,2,1}}}} This is a nested list which each element has a name. I want to export it to ...
10
votes
0answers
118 views

Is Mathematica 10 color managed?

With ColorProfileData[] Mathematica 10 can handle device-dependent color spaces. However, images with embedded color profiles, e.g. sRGB, are rendered and displayed ...
1
vote
3answers
121 views

Removing some data and replacing them with new ones

I have a data list where the elements have the form (time, velocity ). I need to remove some malformed elements in places where the data does not change smoothly and then replace those points by ...
5
votes
1answer
109 views

Strange behaviour of UpSet [duplicate]

Can anyone explain what is going on here? I want to modify TensorRank for IdentityMatrix, but it fails on its first attempt: ...
2
votes
0answers
124 views

Quartic equation [closed]

After using Solve I am choosing the physical root of my equation and dealing further with this root. However, when I am changing parameters using Manipulate, I clearly see not smooth behaviour. Is ...
3
votes
1answer
102 views

Dealing with square roots [duplicate]

Consider following expression: $$ \sqrt{-\left(2 \sqrt{x^{-8/3}-x^{-4/3}+1}\, x^{4/3}+5\right) x^{4/3}+4 \sqrt{x^{-8/3}-x^{-4/3}+1}\, x^{4/3}+2 x^{8/3}+5} $$ In code: ...
3
votes
2answers
306 views

Plot “OilReserves” using CountryData from 1985 until 2014

I am newer using Mathematica to plot with the Function: CountryData, I am trying to plot "OilReserves" in "UnitedKingdom" from 1985 until 2014. I don't know how to do it, please help me!
1
vote
2answers
181 views

Replace a value in a nested array

When I run the following, ...
0
votes
0answers
134 views

Why is Mathematica 10 giving me the junk data from Instagram?

Instagram: instagram = ServiceConnect["Instagram"] ServiceExecute[conn,"request",params] sends a request to the connection identified by conn, in my example ...
2
votes
3answers
113 views

Finding the maximum order derivative of an expression

I have an expression that is the the sum and product of undefined derivatives and their derivatives. e.g. fg+ Dt[f,t]g +Dt[g,{t,2}]f+ What I would like to find ...
4
votes
2answers
131 views

Create composite key - operating across rows in a dataset

I would like to be able to create a new dataset by extracting 2 columns to make a composite key, and also extracting other columns. For example, suppose my dataset looked like: I would like to ...
2
votes
3answers
86 views

Take a list with the amounts of the random samples from another list while holding the index

I have a list called cant with some amounts of samples to take from the list community as follows: ...
-2
votes
1answer
147 views

$SU(4)$ Structure constants in mathematica

How can I write a mathematica function which will output arbitrary structure constants of SU(4)?
9
votes
4answers
737 views

Join two datasets on keys

I want to be able to join two datasets by keys, pretty much like I'd do in SQL. I thought the JoinAcross function might do it, but it doesn't operate the way I thought. The example in the ...
2
votes
1answer
169 views

Plotting in projective space

I am having difficulty figuring out how to plot to projective space. Suppose I have a region which I have plotted such as: ...
3
votes
2answers
92 views

Running “Animate” Using a Button

I made the button below for launching an Animate, but it doesn't work at all! Why? ...
2
votes
0answers
171 views

Maximizing Large Multivariable Function over Region with Parameter Constraints

Brand new Mathematica user here. I have a complicated function to maximize, and thought I would try software like Mathematica instead of taking derivatives by hand. I found some Mathematica ...
2
votes
1answer
338 views

Solve ODE $d^2u/dx^2 + u/A = 0$

How can I solve following ODE with Mathematical: $$d^2u/dx^2 + u/A = 0 \quad (\text{or } \ C),$$ with the conditions: $$ \left.\frac{d^2u}{dx^2}\right|_{x=0} = 0, $$ $$u(x=0) = B$$ and ...
5
votes
6answers
229 views

First pair out of order

I would like to know how to efficiently determine the first pair of elements in a list that are not in order according to some predicate p. That is, list[i] > list[j] according to p, and i is the ...
2
votes
2answers
219 views

Postfix with two arguments

This must be duplicate but can't find any related post. I'm want to pas it two argument in postfix like f[a_,b_]:=a+b; 1,2//f ...
2
votes
0answers
174 views

Copy As PDF in MMA 10

Wondering if this is a known issue.. I usually export graphics and Grids using the Copy As PDF menu item. The results looked quite good in MMA 9 on Yosemite. However in MMA 10 on Yosemite, the PDF ...
12
votes
2answers
622 views

Parsing a CSV file using Interpreter

The new Interpreter functionality in version 10 looks like it has the potential to make parsing custom data formats very easy. I'm trying to create a CSV parser. ...
3
votes
3answers
136 views

Matrix manipulation

Thank you for looking and answering this question. I am trying to create a new matrix from an old one. Meaning, I have a original matrix that's 20x20. I want to keep the first five lines of the ...
1
vote
0answers
111 views

Cross-validation of a FittedModel

Although I would know how to perform cross-validation tests after fitting a model using a function like NonLinearModelFit, I wonder if there is a way to do this providing the right parameters to the ...
6
votes
2answers
102 views

ClassifierInformation's “ClassPriors” misreporting?

To the TLDR people It seems to me that when you explicitly set ClassPriors when running Classify, it creates a ...
1
vote
2answers
95 views

How to define a variable updating function? [duplicate]

I tried to program a Sudoku solver when I suddenly ran into this problem: I need a function which effectivley does this: ...
1
vote
1answer
151 views

Simulation Beta Distribution

Suppose a function such as: $\phi^{\alpha} (x,y) = \left\{ \begin{array}{l l} \alpha x & \quad \text{if $x < y$}\\ x & \quad \text{if $x = y$}\\ \alpha x + (1 -\alpha) & ...
4
votes
8answers
437 views

How to sort my list?

For example I have two lists of such structure L1 = {{"Australia",a1}, {"USA",a2}, {"Norway",a3},...} L2 = {{"Russia",b1}, {"Norway",b2}, {"Japan",b3},...} I ...
1
vote
1answer
108 views

WhenEvent “StopIntegration” problem

The first example on the WhenEvent help page is ...

15 30 50 per page