2
votes
4answers
37 views

Calculating expected value from paired values and weights

I'm very new to Mathematica. I just need a quick solution on how to multiply x with y when a data set is given as ...
0
votes
1answer
34 views

Remove color artifacts in overlay of several Graphics objects?

I am trying to create an animation with a graphic of an arm that can bend at the elbow. For this purpose I created the following two images: hand1 and hand2. I load the images with ...
30
votes
4answers
5k views

Finding all shortest paths between two vertices

The built-in FindShortestPath and GraphDistance functions find the shortest path between two particular vertices in a graph. I ...
1
vote
1answer
41 views

My evaluation is taking a lot of time

I was evaluating the roots of a transcendental equation, when I noticed that Mathematica never finishes but stays in the running state. The following is the code that I was using: ...
2
votes
2answers
78 views

How to deduce the Ramanujan's summation of this series?

I have already asked a similar question about Ramanujan's summation in general but received no good answers. Now I am interested in this exact series: $$\sum _{n\ge1}^\Re (24 n + 12 n^2)$$
364
votes
13answers
78k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
0
votes
0answers
11 views

Decouple 3 simultaneous 2nd order ODEs (of 3 dependent variables)

I have three simultaneous ODEs with coupled dependent variables. I was wondering whether there's a way for Mathematica to decouple these equations (into three ODEs of a single dependent variable ...
2
votes
2answers
75 views

Combining lists to create points to plot with ListLinePlot

I would like to make a ListLinePlot using these lists: ...
0
votes
1answer
83 views

Reduction of an Inequality in $\mathbb{C}$

Reduce[ Abs[-((4 p)/(-1 + Sqrt[1 + 4 p + 4 q])^2)] + Abs[-((4 q)/(-1 + Sqrt[1 + 4 p + 4 q])^2)] < 1 , Abs[p]] It is taking lot of time. It is running. Can ...
0
votes
0answers
4 views

Coupled partial diffential equation, with boundaries specification [migrated]

Please, help me to find a books or samples to learn how to solve such coupled equations $$\frac{\partial T_1(x,t)}{\partial t}&= \alpha_1 \frac{\partial^2 T_1(x,t)}{ \partial x^2} +f(x) ...
-1
votes
1answer
24 views

How to create pairwise difference matrix entry?

I have a $16\times 1$ array of integer entries named $H$. How do I create a $16\times 16$ pairwise difference matrix between all entries in array?
2
votes
1answer
78 views

Combination of interpolations doesn't work?

I have tables of function values f[i_] and g[i_] and I need to plot various combinations of the function and its derivatives ...
0
votes
0answers
58 views

NIntegrate unexpectedly returns complex number

I am attempting to visualise the effect of shifting parameter $\gamma$ on the 3-parameter log-normal distribution. $$pdf(x;\mu,\sigma,\gamma) = ...
8
votes
1answer
76 views

How to partition a 2-D array properly?

Given that I have the following array lst = Array[Subscript[P, #1, #2] &, {5, 5}, {0, 0}] $ \left( \begin{array}{ccccc} P_{0,0} & P_{0,1} & P_{0,2} ...
3
votes
0answers
31 views

Visualising a 1-(50,15,15) design

The problem I have is the visualisation of a 1-(50,15,15) design. That is a set of 50 points and 50 blocks (lines), so that each point is on 15 lines, and each line contains 15 points. My attempts ...
10
votes
2answers
94 views

How to properly generate messages from LibraryLink function?

I'm currently using WolframLibraryData::Message to generate messages from a library function, like this: ...
8
votes
0answers
190 views

How to write markdown with Mathematica?

Usually I typeset with Latex and Compute with Mathematica and then copy the outputs as Latex code and insert them in Latex, so I have to switch between Latex and Mathematica frequently. Thanks to the ...
0
votes
1answer
64 views

How to create a vertical (smooth) Histogram on the y-axis of a function graph for an uncertain x?

This is my first time posting a question in StackExchange. I have encountered a certain problem and I can't seem too find a solution. Just a word of caution, I am kind of an amateur when it comes to ...
3
votes
2answers
202 views

Time Zone Conversion

I use Mathematica to administer my share depots. The depots contain shares of many different time zones. I update the depot values several times a day. My problem is that Sidney, Australia, (it might ...
0
votes
0answers
32 views

Creating a function that uses another function as an argument

I'm new to Mathematica and found a couple questions that were the same as mine but they did not help as much. I'm trying to create a function that evaluates another function and uses that value. ...
1
vote
2answers
63 views

How to use the output we see of expression when this expression is inside Dynamic

Consider this example: Manipulate[status = Dynamic[If[a < b, Yes, No]], {a, 2}, {b, 5}] The output of this calculation is ...
4
votes
2answers
118 views

Different results with Plot option “Evaluated” in V9 and V10

Consider this example: Plot[Table[BesselJ[n, x], {n, 2}], {x, 0, 10}, PlotLegends -> {"n=1", "n=2"}, Evaluated -> True] The results in MMA v9 & V10 ...
2
votes
1answer
114 views

IntegerQ and Element Integers give different results in one case

f1[x_] := IntegerQ[x] f2[x_] := Element[x, Integers] Both functions give identical results in everything except for such case: ...
0
votes
3answers
100 views

Complement[] changes order of elements?

Consider this example: Complement[{a, y, c, d, e}, {a, c}, {d}] (*{e, y}*) However, I was expecting the result to be: ...
6
votes
2answers
339 views

How to find valleys of data using new function in V10 PeakDetect

One of the great new function in V10 is PeakDetect. It can detect peaks according to desired sharpness as shown in this example: ...
7
votes
4answers
827 views

How to find all data points within closed curve

I want to find all data points inside curve as given below: ...
2
votes
3answers
62 views

Removing an ordered pair from a list of ordered pairs according to a certain criterion

I have a list of ordered pairs produced by evaluating {IsotopeData["Thorium226", "ExcitedStateEnergies"], IsotopeData["Thorium226", "ExcitedStateSpins"]} I'm ...
7
votes
2answers
203 views

Built in function without Attributes Listable works as if it has Attributes Listable

Can Built-in function works as if it has Attributes Listable even if it doesn't have that ...
7
votes
2answers
293 views

Creating “detached” plots

Is it possible to create detached interactive plots in Mathematica like those in Matlab, Jupyter (IPython), rather than inline ones? This is interactive GIF from Rodeo IDE for Python as an example, ...
0
votes
1answer
42 views

Part of longer code has an error - how can I debug?

Please can someone help me locate the problem? ...
2
votes
1answer
63 views

How to specify that Quiet should silence foo::shdw messages for ANY symbol foo?

I have some package code that does rather complex multi-context evaluation, and I know it's going to throw warnings about shadowed symbols. The shadowing isn't actually a problem. For the end-user's ...
4
votes
0answers
56 views

Color degrades when using Copy As Bitmap

I have discovered a problem that affects my use of Mathematica. When I use the menu command Edit > Copy As > Bitmap the colors in the copy are subtly degraded. To make this more apparent I copied ...
0
votes
0answers
34 views

Points on discriminant variety?

I am trying to find a way in Mathematica to compute points on discriminant variety for modest size systems, but I couldn't find one. The system is something like: ...
0
votes
0answers
29 views

Nested optimization (in a dynamic game) [on hold]

I have a dynamic game in two stages with two players. The solution of this game requires first to find the Nash equilibrium in stage 1 with correct expectations of the decisions taken at stage 2. At ...
0
votes
1answer
28 views

No names when loading package

I want to use mu own package. This is the procedure I take: 1) In Mathematica notebook I put the following code taken from code ...
2
votes
1answer
46 views

How to make a cell highlight on mouse down?

When a cell has WholeCellGroupOpener set to True, it becomes a clickable button that toggles its cell group open and closed. How can I make the cell change color ...
0
votes
1answer
29 views

Plot data with x and y ErrorBars from file [duplicate]

If I have a set of data like this one saved in a dat file ...
0
votes
0answers
37 views

Fill the gap between two consecutive sphere with different colors [duplicate]

I wanted to shows the radial density (thickness 1) with different color such that dark color shows for lower radius and light color for higher radius. The gap between concentric sphere should be ...
5
votes
1answer
77 views

How to avoid creating negative values when using Interpolation?

I'm having some problems with Interpolation. I'm trying to interpolating some measurements data into mathematica. But using Interpolation will create some negative data, which is actually not possible ...
4
votes
1answer
115 views

Challenge: Creating Compilable Permutations Function

As Mathematica's implemented Permutations function is not compilable I tried to write my very own Permutations implementation, called ...
25
votes
2answers
706 views

Saving my code before cell evaluations: Insurance against front end hanging

I guess my programming working style is not unique. I develop programs one cell at a time, and when I have some confidence about what I did, I put all my mess together refining the code, building up ...
3
votes
1answer
37 views

how to close all tagged input cells winout closing their output cells

I have tagged certain Input cells I want to be closed during a presentation. I close them as follows: ...
1
vote
2answers
37 views

DiscretePlot3D: Part specification is neither a machine-sized integer nor a list of machine-sized integers

I want to plot a 3D histogram of a matrix and I am using this line: DiscretePlot3D[lmat[[x, y]], {x, 1, 3}, {y, 1, 3}, ExtentSize -> Full] where ...
0
votes
1answer
40 views

Short way to query Dataset by the value of several columns

I learned how to query Dataset for rows that contain a certain value, but now I need to query for a long series of And in chain ...
4
votes
1answer
198 views

Find a Fourier series from discrete data

I am trying to fit a Fourier cosine series to discrete data. I read through this, but I was not able to understand it. The data should be periodic with a period of $0.2 \text{ m}$, and it is the ...
6
votes
3answers
1k views

Determine if solution to linear system exists

I'm trying to determine only if a solution to a linear system of equations exists. I have been using LinearSolve, which works fine, but it solves the system as ...
0
votes
1answer
247 views

Integration of linked PDFs over probability simplex

I'm trying to integrate the following expression: f[a1,p1+p2+p3+p4]*f[a2,p2+p3+p4]*f[a3,p3+p4]*f[a4,p4] Where ...
0
votes
1answer
41 views

Merging two associations

I have two associations: ...
13
votes
1answer
320 views

Why is an Identity function needed?

Today I came across the function Identity[x] in Mathematica (documentation). The example given in the documentation uses it in ...

15 30 50 per page