« first day (1518 days earlier)      last day (2983 days later) » 

12:48 AM
@MichaelE2 Attracting? Hasn't it always? I've been dealing with this years.
 
 
7 hours later…
8:01 AM
TabView[{
  1 -> DynamicModule[{x}, Dynamic[x],
    Initialization :> (x = 2; Print@DateString[])],
  2 -> "Nothing"
  },
 2
 ]
Shouldn't Initialization hold a little bit?
 
 
2 hours later…
9:37 AM
I have a question regarding Manipulate and plots of a lot of datapoints. Basically, I have this huge dataset which takes a few seconds to plot, and I want to overlay some parabola's to fit manually with Manipulate. However, every time mathematica redraws the parabola's I guess it also replots the underlying datapoints and it takes ages. Currently I'm doing a manipulate of show of the data and the parabola's.
Is there a smarter way of doing this, so that it really just overlays the parabolas on a static image of the data?
 
@user3183724 You need something like this

hugeplot = ... ;
Manipulate[ Show[hugeplot, Graphics[{Dynamic @ First @ parabolaplot}]], variables spec]
 
Ah, hmm, that makes sense. I'll give that a try!
 
 
3 hours later…
12:50 PM
Another question (which will need some refining..), I have a dataset of amplitudes over a range of frequencies, at different voltages. So I basically have a three dimensional dataset. The way I'm currently plotting it is using ArrayPlot, which works quite nicely; I'm getting the behaviour I expect. There is some background noise but not so much, and much more clearly there are curves shaped like parabolas. My next task however is to fit these parabolas, and I have no idea where to begin
The problem is (I can provide a sample picture) that the parabolas intersect, and then there is also the background noise. I couldn't find any previous posts on fitting and ArrayPlot
The above would be an example. I want to fit the middle parabola (its the square root of an absolute cosine actually), but apart from using manipulate and doing it manually, I don't really know what to do. The avoided crossing also doesn't help very much.
Writing it out, it seems enough to just open a question on the topic.
 
@user3183724 don't you have any theory behind that which you could use? This parabola is really a 2d function so either you have a 2d function model and fit it or take a weighted mean for each x value to generate list of pairs you can interpolate or fit a parabola to.
@user3183724 but it doesn't seem to be a Mathematica question, it's about a methodology of processing your experimental data, which is off topic here.
 
That might be so indeed. The thing is that I know that the dark points that lie on the (disconnected) curve follow y = a*Sqrt(Abs(Cos(b*(x+c)))) so the model is simple, thinking of how to fit without being bothered by the other points is not, to me. But you're right, this might not be mathematica specific.
 
1:06 PM
@user3183724 on the other hand many similar questions were answered here so you can give it a try. remember to put minimal example and show some efforts in the question.
 
 
1 hour later…
2:10 PM
Okay, so final question for the day. Say I want to ask a (mathematica related) question that involves a number of steps, such that one could also imagine asking three separate small questions. Should I then split it up, or post it all together?
 
@user3183724 split it up usually
 
2:35 PM
I think this is more a syntax issue (I'd know how to do it in MATLAB for sure..), but I have two tables of equal size (n by m) and I want to set element (x,y) of table 1 to zero if element (x,y) of table 2 is equal to 0. So I'm doing some comparison type of thing. I was thinking of something like /. x_ /; x = 0 -> 0 and making x the second table element, but I'm unsure of the specifics
 
3:12 PM
@user3183724 I would do it similar to the question you just asked. Take a random matrix the same dimensions as TransTable:
randTable = RandomReal[1, Dimensions@TransTable];
then set the elements to zero via
Set[randTable[[#1, #2]], 0] & @@@ Position[TransTable, 0.]
and verify it with
randTable // MatrixForm
 
Hm, that does seem sensible. I did it with For and If now, but I'm trying not to use those in mathematica
 
@user3183724 Yeah, once you figure out Map and Apply and their shorthand forms /@, @@, and @@@, then you rarely need to use a For or Do loop
This is a bit longer, but I think it's better. Assuming randTable is defined as above,

randTable = ReplacePart[randTable, Position[TransTable, 0.] -> 0.]
 
4:21 PM
someone around with a moment to test-run a few lines
v10 is preferred
@JasonB?
 
Hey Doctor B!
 
@JasonB Hi! do you have a min?
 
Ja
about 10 of them :-)
 
Please join us here
 
4:52 PM
@Szabolcs I hope I didn't disturb you.I'm in trouble with the FindKPlex's behavior.Especially when it solve a directed graph.So could you give some direction for me?
Or this function have some mysterious bugs?
 
5:38 PM
g = \!\(\*
GraphicsBox[
NamespaceBox["NetworkGraphics",
DynamicModuleBox[{Typeset`graph = HoldComplete[
Graph[{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22}, {
SparseArray[
Automatic, {22, 22}, 0, {
1, {{0, 4, 9, 9, 9, 14, 16, 19, 24, 31, 32, 36, 39, 39, 40,
44, 46, 51, 56, 59, 62, 65, 70}, {{4}, {7}, {9}, {16}, {
5}, {6}, {8}, {18}, {20}, {9}, {12}, {14}, {20}, {22}, {
11}, {20}, {6}, {17}, {22}, {2}, {5}, {6}, {10}, {13}, {
3}, {6}, {7}, {8}, {10}, {18}, {20}, {8}, {2}, {3}, {
For example the first subgraph.As the docmentation,"For a directed graph, the outgoing edges for each vertex connect to all except 6,8(first two vertexs of the list) others. "But actuall have none vertex's outgoing edges connected with 9.
 
6:07 PM
@yode Sorry, I never used this particular function.
 
Oh~Thanks all the same
 
6:28 PM
Hey guys, Chop[] is working strangely inside things like Plot3D and NIntegrate[], it seems to be only chopping for some values of the threshold
can anyone think of a reason it would do that? Here is an example
If I do Plot3D[Chop[Sin[3*(x + y)], .5], {x, 0, 5}, {y, 0, 5}], and look from the side, you can see where the function is being chopped
however, if I change the threshold to .3, Plot3D[Chop[Sin[3*(x + y)], .3], {x, 0, 5}, {y, 0, 5}], I see it chopped in one place, but not everywhere it should be
 
7:21 PM
@Searke Does this look like a bug to you too (plus a very hard to follow description in the documentation)? mathematica.stackexchange.com/q/110102/12 I'm just not familiar enough with the subject matter to be confident here. I pinged you because I hoped that the documentation could be improved here a bit ...
 
 
@kirma I see lines in it.
They radiate from the origin.
 
It's prime abundances in polynomials of the form x^2+x+n ... and yes, there would seem to be lines.
 
So what are you plotting here precisely?
 
I'm trying to work out their positions form this dataset for which more points simply are not available... not quite there yet with SmoothKernelDistributions and such.
ListPlot[ParallelTable[{a,
   Divide @@
    Sum[With[{n = i^2 + i + a}, {Boole@PrimeQ[n] N@Log[n]/2, 1}], {i,
      5000}]}, {a, 1, 7500, 2}],
 PlotRange -> {Automatic, {0.22, 2.5}}]
Well, that code is really a bit of a kludge...
Quite heavy background on that data, but some sort of patterns are certainly recognisable...
 
8:01 PM
@Szabolcs Well the documentations wording is bad/wrong
"A k-plex is a maximal set of vertices such that each vertex is adjacent to all except k others."
It should say (I think) "is adjacent to all except at most k others."
Here's what I wrote to try to make the idea concrete for me
 
@Searke But what about directed graphs? It seems to give undirected results for k > 1, but not for k==1.
 
vertexKPlexQ[graph_, vertex_, kplex_, k_] :=
Length[AdjacencyList[graph, vertex]~Intersection~kplex] >=
Length[kplex] - k
possibleKPlexQ[graph_, kplex_, k_] :=
AllTrue[kplex, vertexKPlexQ[graph, #, kplex, k] &]
Anything that it returns should pass possibleKPlexQ
Let me look through the examples a bit. I normally wouldn't do this at work, but I'm waiting on a meeting
So when k=1 that means each vertex has to connect to n-1 vertices
that means every vertex has to connect to every other vertex. It has to be a clique.
Every arrow has to go both ways
or am I getting that wrong?
 
@Searke Right.
 
I mean it should still work for k==1. But it's also abstractly pointless. A 1-plex is a clique
 
Which might explain why it works correctly for k==1, but not for k > 1, for directed graphs.
Maybe there is a different code path for k==1. It just invokes FindClique.
@Searke Note though that AdjacencyList ignores edge directions.
 
8:11 PM
Oh... it does?
Of course it does
why would it
sigh
I was just about to say that my code says all the examples in the question are valid possible kplexes
 
But VertexDegree and VertexOutDegree on the Subgraph[graph, kplex] might be easier to work with here.
 
Oh yeah. That example with the red arrow is definitely wrong. That one vertex in the top left corner only connects to one other vertex
 
Yes. In the visualization it is not clear because edges could be superimposed in principle. But they are not (if we check the EdgeList).
 
I mean yeah. There's two things broken. 1) The documentation needs to say "is adjacent to all except at most k others." 2) It is not implemented correctly for directed graphs
Did you report it or would you like me to instead.
 
@Searke I'll report it. Hope the people at support won't hate me for it. I already report something at least weekly. And this isn't even my bug. It's yode's.
I don't normally report other's findings (unless I really really care) but yode is struggling a bit with English.
 
8:19 PM
Support people are just busy. And verifying a bug like this can take a long long time if you're not familiar with graph theory.
 
@Szabolcs Yes.If you report it for me.I'll apperciate you very much.
If I do this,I am afraid that the whole Wolfram Research cannot know what I have say.
aha~
 
@Searke actually, "all except at most k-1 others", they keyword being others, i.e. excluding self. Thus for a 1-plex (as you said, clique) it should be adjacent to all others.
I do find these bugs a bit disturbing though... I mean are there no unit tests for these functions?
 
8:34 PM
I haven't looked at the graph theory tests
 
Especially in graph theory, The people like a level of my are found in several bugs
But actually its properties include it.
 
@Szabolcs Unit tests aren't what is needed here. There are plenty of Unit tests. And they look like a pretty good set of tests to me.
The QA person probably made the same mistake that I made while we were talking, which is probably why they didn't catch this.
 
9:04 PM
@Searke Graph-related functions are hard to make bug-free and are hard to test thoroughly. There are many kinds of graphs: undirected/directed, simple/multigraphs, also graphs with self-loops. They can be edge weighted or unweighted. Then for some reason Mathematica added mixed graphs (both directed and undirected edges), which to me looks like just asking for trouble... Then I noticed that there are multiple possible internal representations, and some bugs appear only for some representations.
Sometimes separate algorithms are needed for all combinations of all these possible cases.
I understand those difficulties better than before, but I still have the impression that the Graph related stuff is buggier than the rest of Mathematica.
I mean buggier than can be explained by these difficulties.
 
 
2 hours later…
11:34 PM
Random code:
Clear[flag];
flag[x_?NumericQ] := If[TrueQ[ssx > 1], True, False];
ssx = 0;
nsteps = 0;
{sol} = NDSolve[{y'[x] == y[x], y[0] == 1,
   WhenEvent[flag[x],
    Print[{x, nsteps, ssx, laststep}], "LocationMethod" -> "StepEnd"]},
  y, {x, laststep = 0, 10},
  StepMonitor :> (ssx += (x - laststep)^2; nsteps++; laststep = x)]
 

« first day (1518 days earlier)      last day (2983 days later) »