« first day (1869 days earlier)      last day (2625 days later) » 

12:08 AM
Since the DoS attack yesterday it seems that a lot of older post with images no longer have those images. Will they come back or are those post broken for good?
 
12:18 AM
3
Q: Are Images from i.stack.imgur.com permanent? AKA "Why are my pictures gone?"

DavidI got pinged with this comment: There aren't any images. Upon closer inspection, I realized that not only are my answer's images gone, but the other answer also. This got me looking and I found these posts (none of which were helpful) and this question is not a duplicate of any of them: I...

They should be back when the outage is over. Of course it wouldn't be the first time in the history of the Internet if data disappeared when it should not.
 
 
1 hour later…
1:30 AM
guys, consider this example

array = Take[Alphabet[], 3];

Select[array^{1, 0, 4} , # != 1 & , 3]
why does mathematica gives me only a as output and not c ?
 
1:56 AM
@Alucard Because ("c")^4 != 1 doesn't evaluate to either True or False. "a" != 1 evaluates to True.
 
how can i solve this issue? i want only the letters, LetterQ?
eh i mean NumberQ
 
@Alucard Well, LetterQ[("c")^4] is not going to evaluate either. Are all your expressions letters to some power?
 
yes i was trying to solve this problem here mathematica.stackexchange.com/questions/138873/… when i found this issue . All the lists are combination of 1 and letters elevated to some powers
i have found a workaround that works but i was just curious to know why select did not work
 
@Alucard You could use f.e. Select[array^{1, 0, 4}, MatchQ[_String | _String^_Integer]]
Well, it doesn't work because Mathematica's equality operator (=) doesn't know how to compare a string to a power with a number.
 
isn't a^3 a symbol? i thought mathematica could see the difference between a symbol and a number
 
2:11 AM
First of all, you have "c"^4 and not c^4. These are two different things. It's unclear what ("c")^4 is, it can only be described as an expression that is a mix between a string and a number. It's not clear what it means to take a string to a power, so it's not really possible to evaluate it's equality to anything in a mathematical sense.
Secondly, Mathematica cannot tell if a != 1 or a^3 != 1 because it doesn't know what a is. If a is 1, then it's true. But if a is 2, then it's false. So it cannot say if it's true or not.
 
i think i got it but can i convert "c"^4 to c^4 ?
 
2:50 AM
@Alucard "c"^4 /. "c" -> c
 
3:43 AM
that doesn't work on a vector as array , the number of letter used is bound to the parameter inside take, in the complete function it's a variable defined by the user
 
 
4 hours later…
8:05 AM
Someone around? Can someone confirm that on his Mathematica >=10 the following does not give what it give on my Linux box?
CopyToClipboard["https://i.stack.imgur.com/i8hWG.png"]
Now, evaluate the FullForm by inserting the copied text between ".."
In[12]:= FullForm["https://i.stack.imgur.com/i8hWG.png"]

Out[12]//FullForm= "\!\(\*Cell[\"https://i.stack.imgur.com/i8hWG.png\",\nTextClipboardType->\"PlainText\",ExpressionUUID->\"a23720af-f708-4b11-9b55-1a4a17ea69a6\"]\)"
 
8:25 AM
The problem with this is, that I cannot use the copied contents when I want to insert it inside an expression. It's just not valid input as it is an inline cell.
 
8:59 AM
@halirutan I get something similar on Mac OSX (no ExpressionUUID, otherwise it's the same)
 
9:28 AM
@JacobAkkerboom And if you paste such a thing inside Import[".."] can you evaluate it?
 
@halirutan I get $Failed
 
@JacobAkkerboom It's funny, because support wrote me:
> Alternatively, is there any reason the following doesn't give you what you're after?

> copy2[text_] := CopyToClipboard[Cell[text, "Input"]]

> This copies the text as an input cell, which is the same effect you get with your original copy function. Is there a reason that wouldn't work? It is more efficient overall as well.
 
@halirutan Well, that does appear to put a string on the clipboard at least. I guess it is ironic that if you feed a string to CopyToClipboard, it gives you back a Cell, while if you give it a Cell, it may give you back a string.
 
@JacobAkkerboom the background to report this was that our SEUploader copyToClipboard stopped working:
copyToClipboard[text_] :=
 Module[{nb}, nb = NotebookCreate[Visible -> False];
  NotebookWrite[nb, Cell[text, "Input"]];
  SelectionMove[nb, All, Notebook];
  FrontEndTokenExecute[nb, "Copy"];
  NotebookClose[nb];
  ]
This works even for version 7.
 
9:44 AM
Ok, interesting!
@halirutan I'm not sure what exactly the function should do, it appears to behave the same on version 9 as on version 11
 
@JacobAkkerboom It won't work soon.
 
@halirutan you mean it is unrealiable? It fails sometimes but not always? (that is always my fear when using SelectionMove etc).
I do have Version 11.0.1
 
@JacobAkkerboom It fails in the prerelease
 
@halirutan ah, ok. I didn't know WRI did prereleases
Going afk, cu
 
9:59 AM
Let us compute the volume of the 5D sphere using Monte Carlo integration:
In[183]:=
NIntegrate[
  Boole[x1^2 + x2^2 + x3^2 + x4^2 + x5^2 < 1], {x1, -1, 1}, {x2, -1,
   1}, {x3, -1, 1}, {x4, -1, 1}, {x5, -1, 1},
  Method -> {"MonteCarlo", "MaxPoints" -> 10000000},
  PrecisionGoal -> 5] // AbsoluteTiming

During evaluation of In[183]:= NIntegrate::maxp: The integral failed to converge after 10000100 integrand evaluations. NIntegrate obtained 5.262379376206238` and 0.0037510278100610726` for the integral and error estimates.

Out[183]= {11.4295, 5.26238}
With BoolEval:
In[184]:= n = 10000000;
d = 5;
2.^d BoolCount[Total[RandomReal[{-1, 1}, {d, n}]^2] < 1]/n // AbsoluteTiming

Out[186]= {1.1613, 5.26462}
That's a 10x speedup.
However, NIntegrate can take a very general class of inputs, and will handle them automatically. Considering that, it is performing very well. I wonder how it can achieve this sort of speed.
Might have to do with Experimental`NumericalFunction?
With region notation:
In[192]:=
NIntegrate[1, x \[Element] Ball[{0, 0, 0, 0, 0}, 1],
  Method -> {"MonteCarlo", "MaxPoints" -> 10000000},
  PrecisionGoal -> 5] // AbsoluteTiming

During evaluation of In[192]:= NIntegrate::maxp: The integral failed to converge after 10000100 integrand evaluations. NIntegrate obtained 5.264043335629821` and 0.003751504060007057` for the integral and error estimates.

Out[192]= {75.0053, 5.26404}
The PrecisionGoal -> 5 is there to force NIntegrate to actually use as many as "MaxPoints" sampling points. It can be ignored, along with the message it triggers.
 
 
3 hours later…
1:35 PM
In case someone here has an idea:
3
Q: Applied math: analyse cell orientations

halirutanI'm analyzing the orientation of cells and I stumbled over a peculiarity when I try to make a statement about the main direction of the cells and how many cells are oriented along this main direction. Let me give an example that shows a small part of a fluorescence image First, note that I'm n...

 
 
1 hour later…
2:37 PM
@halirutan All I can say is, wow, that does look tricky!
It doesn't matter how you choose to "unroll" the domain of your histogram, the usual methods of statistics will give wrong answers
 
@halirutan If you cared about direction as well as orientation (i.e. if you really had a 0..2Pi range), then you could represent each direction as a unit vector, and average the vectors. This is the order parameter in the Kuramoto synchronization model where we consider oscillators with phases between 0..2Pi and we want to know if the will eventually be the same.
If the mean vector is short, the directions are all over. If the mean vector is long, then cells have similar orientations.
 
ah, actually, since your domain is just a circle, you can use the fact that $S^1 / \mathbb{Z}_2 \simeq S^1$; that is, just multiply all your angles by two, average the resulting vectors, and then divide the final angle by two again. :)
however, I don't see how to do any more interesting statistics, and I certainly don't see what one could do in the more general case of trying to define the "mean" on a closed domain.
 
2:58 PM
The cow comment wasn't just meant to be funny. I have not read the paper, but they must have had the same problem. Maybe it's worth taking a look.
@andre If you are quite familiar with this method (image charges), can you give me some pointers? There are some tricky things. For example, it is not clear where to put the image charges. If I put them close to the edges of the conductor, the error will be smaller on the boundary but this does not necessarily mean that the overall error will be smaller too.
If I put them in random positions inside of the conductor, then I get weird artefacts. There will be very large positive and negative charges close to each other, that mostly cancel out. What I am looking for is either some practical guide that shows what is a good choice, or something that gives better insight into the effect of this choice on the final result.
 
3:33 PM
@Szabolcs NO! Indeed it didn't take it as joke. Looking at the publication. They even have a similar circular histogram :) Thanks.
 
3:48 PM
@halirutan en.wikipedia.org/wiki/Directional_statistics A good book is Fisher's Statistics of Circular Data.
 
@JimBaldwin See, that for instance. I didn't know it's called directional statistics. I searched for orientation statistics or circular statistics.
 
@JimBaldwin great catch! Now I'm curious, can it only be defined on symmetric spaces, or can I talk about the statistics of a collection of events on some kind of irregular blob shape?
 
@halirutan Good. You know my bias: you physics/chemistry/engineering types need to consult statisticians more often.
 
@JimBaldwin I'm probably one of the few who indeed does this. I know how advantageous it is to ask a statistician before analyzing some results.
 
@halirutan : I appreciate that you do that. However, (if I may be so bold) you should consult a statistician before collecting the data.
@BenNiehoff While I don't know of specific example of directional statistics on an irregular blob, I'm sure the basic principles used by directional statistics can help formulate reasonable summaries data on blobs.
 
4:07 PM
@JimBaldwin Not possible. The data, as in this case too, comes from projectpartners that come to me for image analysis after they already collected the data. It's always like that. I'm glad we came at least so far that they have to provide a power-analysis before they apply for some grant. But for smaller experiments, this is never going to happen.
 
@halirutan. Understood. I'd still like to share this quote from Sir Ronald Fisher: "To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of."
 
hehe
 
@JimBaldwin I'm with you, believe me. I see a lot of awful stuff. There are at least 2 major things: First, the (biological) experimenter isn't aware of what she/he wants until I look on the data and make suggestions. In this particular case, the orientation analysis was my idea. Second, and more important, when animals are involved, it's often simply impossible to make the experiment as strong as a statistician wishes and use a large sample size.
We just live in an imperfect world.
@JimBaldwin Just to be clear, you mean this book, right?
> Fisher, NI., Statistical Analysis of Circular Data, Cambridge University Press, 1993. ISBN 0-521-35018-2
 
4:44 PM
@halirutan Yes, that's the book.
 
@JimBaldwin Thank you very much for your input.
 
5:17 PM
@Szabolcs It is not the image charge method but the virtual charge method. It's different.
@Szabolcs Until now, I have not find good explanaltions about this method in the web.
@Szabolcs The explanation I will give depends of your background. Are you convinced that if the error at the boundary of the hole is 0, then then we have the exact solution ? (assuming the charges are all inside the hole)
 
@JimBaldwin Ordered from amazon.
Make note to myself: I know now that we have at least two statisticians at our disposal at mathematica.se: w huber and Jim Baldwin.
 
5:37 PM
@andre Yes, if the potential on the boundary is exactly zero, then we have the exact solution.
 
6:10 PM
Here's a version I tried to make more efficient. It uses random points and illustrates what I was talking about: some charges which are huge in magnitude and make me uncomfortable.
Take some shape which fits in {{-5,-5},{5,5}}:
shape = BoundaryDiscretizeRegion[
  RegionUnion@{Disk[{-3, 0}, 1/2], Rectangle[{-3, -1/2}, {3, 1/2}],
    Disk[{3, 0}, 1/2]},
  MaxCellMeasure -> 0.1
  ]
testPts = RandomPoint[RegionBoundary[shape], 5000];

chargePts = RandomPoint[shape, 1000];

matrix = Log@DistanceMatrix[testPts, chargePts];

charges = LeastSquares[matrix, ConstantArray[1., Length[testPts]]];

Graphics[{AbsolutePointSize[4],
  MapThread[{ColorData[{"RedGreenSplit", {-1, 1}}][#1],
     Point[#2]} &, {charges/Max@Abs[charges], chargePts}]}]

pot[pt_] := Dot[charges, Log@Sqrt@Total[(Transpose[chargePts] - pt)^2]]

plotRegion =
  DiscretizeRegion@RegionDifference[Rectangle[{-5, -5}, {5, 5}], shape];
 
MMM
6:22 PM
Hi everyone,

imgur is not working properly. Is someone else facing the same problem?
Whenever, I browse, some images are not shown.
Any thoughts?
 
@MMM Yes, I see the same. Refreshing fixes it sometimes.
Here's the charge distribution I get for a regular grid:
Here it is for half the pitch:
The test points were random and taken on the boundary.
These two charge distributions are quite different. I think something is pushing them towards developing extremely high charges that cancel out.
Amplifying the charge values (for visualization purposes only) shows a nicer plot
 
MMM
6:54 PM
@Szabolcs I do refresh and it works but very annoying.
 
 
2 hours later…
8:43 PM
@Szabolcs The method is more known in the web under the name "Charge Simulation Method" ("CSM").
@Szabolcs I think that the charge inside your distribution are useless. The idea is rather to distribute a line of charges near the boundary of the hole at the "good" distance. If the charges are too much near the boundary the effect is too local and there is ripple. If the charges are too far away, the small curvatures of the boundary are not respected (In your case there are no small curvatures or worse : angles)
 
@halirutan. There are a few more statisticians around this forum (@wolfies is one). And while I think I do OK, I'm not in the same league as @wolfies and @whuber. But about your orientation data...here's one approach: Convert all of the angles between 0 and pi or -pi/2 and pi/2 or any two angles with a range of pi. Then multiply by 2 and apply the usual estimator for the circular mean. Then covert the results back by dividing by 2.
 
@Szabolcs ... though is does not seem to solve your problem of high charges that cancel out (to be confirmed)
@Szabolcs Have you access to IEEE litterature ?
 
@halirutan. I'll have to think more about summarizing variability when I get back to the office and my books next week. Maybe a bootstrap for estimating precision would be simplest.
 
@andre These are exactly the kinds of comments I was looking for.
@andre I think so
 
9:01 PM
@Szabolcs An article on the subject is "A Review of the Charge Simulation Method and its Applications, author : Nazar H. Malik, 1989" . The beginning of the article concerns the case test point number=charge point number. That's not a good idea. Nowodays we have enough computing power to have test point number>= 10Xcharge point number. It's a way better.
@Szabolcs You may be interested by the chapter 4 about optimzation of the quality of E instead of the potential, since you want to obtain the gradient of the potential
 
got the PDF :)
 
@Szabolcs by the way, I wonder if it is legal to code some IEEE article in Mathematica and publish it on the web. Any idea ?
 
I don't know ... but I don't understand why it wouldn't be legal?
I mean I don't know anything about legal stuff, but it would never have occurred to me that it would not be legal.
@andre You mean implementing numerical methods, like this one?
 
9:23 PM
@Szabolcs For example a article to calculate self-inductances with Mathematica : "Inductance Calculations for Circular Coils of Rectangular Cross Section and Parallel Axes Using Bessel and Struve Functions, John T. Conway 2010", where the author has used Mathematica to apply his formulae, but does not give the code. I have recoded the whole thing.
 

« first day (1869 days earlier)      last day (2625 days later) »