14
votes
3answers
250 views

On making a graphical real-time memory usage monitor

I'd like to make a graphical version of Dynamic[Refresh[MemoryInUse[], UpdateInterval -> 1]] A naive implementation would be something like: ...
2
votes
3answers
89 views

network visualization with different colors for different edge labeled

I have a network with 3 different edge types, edgelist file is a three column file with id1, id2 and edge label. I uploaded the file here What I need know is to find a way to plot this network, as ...
5
votes
3answers
227 views

Removing background from peak function

Let's say I have a a very large list of data in the format {{n,f[n]}} so something like {{1,600},{2,700},{3,1100}...} and if this data is plotted, then it will look like a sum of Gaussian functions+a ...
10
votes
4answers
201 views

Timing problem with ReplaceRepeated

I have the following data: ...
5
votes
1answer
88 views

Hatching pattern in ColorRules for MatrixPlot

Using ColorRules with MatrixPlot, how does one get a hatching pattern in one of the cells? For example, consider the ...
4
votes
2answers
100 views

How to plot a graph with some disconnected vertices?

I am trying to plot a graph with $6$ vertices but I do not want some of the vertices to be connected. I have drawn a picture to illustrate my problem. So far I know how to plot $6$ vertices without ...
6
votes
2answers
370 views

Exception with GatherBy: gathering complex conjugates

I want to gather the complex-conjugates that are in a list, but with an exception: only if the imaginary part isn't zero. For example: ...
11
votes
1answer
260 views

Struggling to understand Query

The documentation for Query starts with: ...
5
votes
2answers
92 views

Extracting factors from an expression

I want to transform expressions into lists of elements. For example, b*c + a*b*c /. Plus -> List /. Times -> List ...
2
votes
2answers
89 views

Plotting cones from data read from a file

I would like to plot cones centered at specific points in a lattice and with different orientations and colors that depend on them. For this, I have the data in an external file with 11 columns: 1) ...
2
votes
1answer
197 views

Constant Heat Flux Boundary Condition for the Differential Heat Equation

I am attempting to solve the transient heat equation for a very simple geometry and I am getting a junk solution. I have identified two distinct regions (wall and super-heated fluid layer) with their ...
8
votes
1answer
81 views

On an existing notebook, how to transform all “double brackets” into “DoubleBracket”

Sometimes, having all double brackets [[...]] transformed into \\[LeftDoubleBracket] ... \\[RightDoubleBracket] can really ...
11
votes
3answers
359 views

get position index for all element in a list

For example mat={{a,b},{c,a,a}} How to write a function posindex that posindex[mat] will ...
1
vote
1answer
77 views

Finite Difference equations - slow computations

The following code I have written runs very slow, in fact, so slow that it does not finish computation. ...
1
vote
1answer
381 views

Numerical solution of Schrödinger equation

I want to solve the following differential equation numerically. The geometry of the problem is as shown below. Electron 1 is located on the inner ring of radius $R_1$ and electron 2 is located on the ...
5
votes
2answers
100 views

Parallel function evaluation for minimal value

I am asking myself, if the evaluation of a function f looking for a minimal value over a discrete set of values can be parallelize (brute scan for a potential ...
7
votes
1answer
334 views

Causes “libGL error: failed to load driver: swrast” an Huge Overhead in Parallel under Version 10.3?

Under Linux (SUSE Linux Enterprise 11) for Mathematica Version 10.2/10.3 I observe the following error in parallel ...
1
vote
1answer
48 views
-1
votes
3answers
67 views

Multiply equations in lists

list = {x + 1, x - 3, {x - i, x + i}} The last two elements should be multiplied. Desired output is: {x + 1, x - 3, x^2 + 1} ...
1
vote
0answers
36 views

How to test if Import was successful? [duplicate]

I am importing and processing a bunch of files. Sometimes, for whatever reason, some of these files are not successfully imported so I'm looking for a way to Abort ...
3
votes
0answers
45 views

Mathematica version 10.2 does not find C compiler [duplicate]

I am running Mathematica 10.2 on Windows 7 (64bit) and when I want to use the C compiler I get the message: A C compiler cannot be found on your system. Please consult the documentation to learn ...
0
votes
1answer
53 views

Multiply elements within a list [closed]

How do I multiply elements within a list? list = {{1}, {2, 3}, {4, 5, 6}, {7}, {8,9}} Desired output: {1, 6, 120, 7, 72}
9
votes
1answer
203 views

How to discretize a BezierCurve?

Bug introduced in version 10.0 and persisting through 10.4 DiscretizeGraphics is new in 10.0. I need to create a discretized region from a ...
15
votes
0answers
150 views

ListContourPlot and ListContourPlot3D use better interpolation for arrays of values than for lists of tuples (i.e. {{x,y,z,f[x,y,z]}..}

From reading the documentation, it seems that ListContourPlot3D should work equally well on an array versus a list of tuples, ?ListContourPlot3D ...
1
vote
0answers
63 views

DiracDelta of a function

If I have, for instance, FunctionExpand[DiracDelta[x^2+x-3]] it evaluates to ...
2
votes
0answers
25 views

Approximating Pi, fraction in another [duplicate]

In a previous exam, this question was asked: We want to approximate Pi using this formula Write a function that calculates the right hand side of this equation truncated at the nth term. For ...
3
votes
1answer
72 views

How to determine the value of an angle starting from an image? [duplicate]

I have two lines drawn with Mathematica, how do I calculate the angle between these two lines to have the numeric value of that angle? Thank you
4
votes
2answers
114 views

Get value of symbol

ab := {{a, 10, 100}, {b, 0, 10}} Manipulate[a*b, Evaluate[Delete[ab, 0]], Button["SHow", Print[Evaluate[Symbol[ToString[ab[[1]][[1]]]]]]; Print[a, "---", b]]] In ...
2
votes
1answer
90 views

How to take every second element [duplicate]

If I have {1,2,3,4,5,6}, how do I take all the second elements into a new list? So I want a list like {2,4,6}.
7
votes
3answers
248 views

Write a function that returns the coefficient of x^n

Write a function C[p_, x_, n_] that returns the coefficient of $x^n$ in the polynomial equation. C[p_, x_, n_] := ... If we ...
2
votes
0answers
51 views

Mathematica Manipulate, Plot, Piecewise [duplicate]

I have two functions h2 and v2 that I need to graph using Piecewise and be able to ...
1
vote
2answers
79 views

Plot for pressure rise per wavelength [closed]

I have another question that i need to ask. I have been struggling in making the graphs for pressure rise per wavelenth. my equation for pressure rise per wavelength is: ...
1
vote
0answers
30 views

Repeat code segment from certain cell [closed]

If I have a lot of code and wish to repeat it in a different cell, but with some variables changed, how do I do it? (without copying and pasting) I tried using GoTo and Label but it did not recognize ...
7
votes
1answer
81 views

Separate integer fractions from variables?

Whenever I write a rational number times a variable, i.e.: (2/3)a the result Mathematica displays looks very cringeworthy: $$\frac{2a}{3}$$ I would prefer ...
1
vote
0answers
23 views

How to label the points in `ListPointPlot3D` [duplicate]

To label 2D point plot is easy, eg ListPlot[Labeled[#[[1]], #[[2]]] & /@ {{1, 1} -> 1, {6, 5} -> 2, {4, 1} -> 3}, AspectRatio -> Automatic] ...
1
vote
0answers
84 views

Theodorus Spiral [closed]

If the successive hypotenuses of the Theodorus Spiral are getting longer but the difference between the lengths is getting smaller reducing the distance between windings to pi, why pi?
3
votes
2answers
130 views

How do I find all cut vertices (aka articulation points) in a graph?

Given a connected graph $G = (V,E)$, we say that a vertex $v \in V$ is a cut vertex of $G$ if the removal of $v$ from $G$ causes $G$ to become disconnected. How can I find all cut vertices of a given ...
2
votes
3answers
70 views

Dual plot not working [closed]

I'm trying to plot the figure-eight curve. g1 = Plot[y = Sqrt[x^2 - x^4], {x, -1, 1}] g2 = Plot[y = -Sqrt[x^2 - x^4], {x, -1, 1}] Show[g1, g2 ] ...
3
votes
1answer
96 views

SystemException with Interpolation

Consider the following sample code Interpolation[{Range[20], 2*Range[20]}]; ...
6
votes
6answers
388 views

Rewrite a real polynomial in real (but only linear and quadratic) factors

According to my calculus book: "Every real polynomial can be factored into a product of real (possibly repeated) linear factors and real (also possibly repeated) quadratic factors having no real ...
1
vote
1answer
84 views

Why does Timing return different times for the same calculation?

I did an experiment in which I calculated the same quantity two different ways to see which method was faster. To my surprise, the kernel time was different in different runs. In fact, which method ...
2
votes
1answer
91 views

About NDSolve with piecewise inputs

I am trying to solve numerically two differential equations with NDSolve. ...
3
votes
3answers
180 views

FindFit with a sophisticated function (integral)

I am trying to find a fit to the distribution function (empiricial data) in terms of a function which is itself an integral of a product of two simpler functions (two polynomials), that is the model. ...
5
votes
0answers
46 views

Triggering events based on choices made inside of system dialogs (e.g. window close)

I'm trying to arrange for Mathematica to perform a certain action every time a notebook is saved or closed (with or without saving). The obvious way to do this would be through event handling. So, ...
4
votes
1answer
118 views

Grouping the first two elements in a list of ordered triples

I have a long list of the form ...
1
vote
1answer
70 views

Plot discontinuous function $\frac{2-x}{|x-2|}(x + 2)$ [duplicate]

I'd like to ask you about the way to plot discontinuous function $\frac{2-x}{|x-2|}(x + 2)$. What Wolfram Alpha produces: "DIY" version is below. How to achieve similar effect in Mathematica?
5
votes
1answer
83 views

Remove Tick Marks without removing Numbers on Paired Histogram

I have formatting problem that I can't figure out. I'm trying to remove the tick marks on a paired histogram without removing the numbers. The trick with other plots is to make the opacity of the ...
2
votes
1answer
53 views

Setting an upper limit in the NDSOLVE calculations

I have built a code to solve a system of differential equations in the form: $\displaystyle \frac{d(AB)}{dt}=kn(A)n(B)$ Here I present a small version of it: ...
4
votes
2answers
124 views

Unexpected behavior of ImplicitRegion -> RegionPlot

I have two semicircles that are identical except that the second is shifted one unit to the right. ...
2
votes
1answer
58 views

Using strings in defining rules

I am very new using Mathematica and I would like to define a rule of replacement which operates as below, keeping freedom for what concern the pre-factors that can appear in the equation: $$e^{\pm ix} ...

15 30 50 per page