« first day (2866 days earlier)      last day (1615 days later) » 

4:15 AM
@b3m2a1 it works! Why does Integrate give the result as a complex number?
 
 
12 hours later…
4:20 PM
@anhnha I get 1/15 (2 + Sqrt[2] + 5 ArcSinh[1]) in version 11.3 - which version are you using?
 
@LukasLang version 12
also it took several minutes to get the result
This is what I get:
1/960 (128+64 Sqrt[2]+(1600+45 I) \[Pi]+770 ArcSinh[1]+90 ArcTanh[Sqrt[2]]+90 Log[99-70 Sqrt[2]])
 
4:41 PM
@anhnha Hm... there seems to be a bug here - evaluating that (either directly or after applying TrigToExp and FullSimplify to get something manifestly real) with N returns 5.75739, while NIntegrate and the analytic expression from version 11.3 both give 0.521405.
Also, 11.3 on a fresh kernel gives 1/15 (2 + Sqrt[2] + 10 \[Pi] + 5 ArcSinh[1]), which is 2.6158 - somewhere, Integrate seems to mess up by a few multiples of π...
Correction: 11.3 on one computer gives 0.52..., 11.3 on the other one gives 2.61... - both are running Windows 10 64bit - I will report this issue to WRI, lets see what they say
 
4:56 PM
Okay, thank
The correct answer is 0.52...
 
 
1 hour later…
6:09 PM
@LukasLang What exactly was your Integrate call?
 
 
3 hours later…
8:55 PM
BoundaryDiscretizeGraphics takes a long time when you give it ListPlot3D output...
I'm doing something like generating a heightmap using an array of elevation values and ListPlot3D. I then want to 3D print it, and sadly export to stl takes over an hour for a 300*400 input array. Can I skip the discretize step by simply creating a Region from this array of height data?
(even things like PerformanceGoal -> "Speed", AccuracyGoal -> 1, MaxCellMeasure -> 10, none of them seem to improve performance)
I guess it's sad because ListPlot3D interpolates the data, which is something I want. I don't really understand why this takes so long
 
9:23 PM
@CarlLange I ran into the same issue with DiscretizeGraphics applied to a list of 382 points representing a polygon yesterday. I aborted the computation after ~30min. It seems to be very sensitive to the data values. Add a small offset to each point and it completes in a few seconds.
 
@RohitNamjoshi Oh, maybe if I round the values or something it'll be quicker...
For the moment, I exported my heightmap as an image and used a third-party solution to convert that to my object. Not my favourite solution though!
No such luck with rounding the heights, unfortunately.
 
9:44 PM
@anhnha ComplexExpand@ Integrate[Sqrt[(x1-x2)^2+(y1-y2)^2], {x1,0,1},{x2,0,1},{y1,0,1},{y2,0,1}]
Complex terms sometimes come up because various pathways through algebra sometimes wander out into the complex plane. For instance 1/(1+x^2) is equal to 1/(2 (1 - I x)) + 1/(2 (1 + I x)). When integrated, one gets 1/2 I Log[1 - I x] - 1/2 I Log[1 + I x], which is equivalent to ArcTan[x].
@LukasLang Yep, there seems to be a bug.
Since the integrand is between 0 and 1, and the region of integration has a volume of 1, the integral should be less than 1.
 
10:05 PM
@anhnha The code 4 Integrate[Sqrt[(x1 - x2)^2 + (y1 - y2)^2], {x1, 0, 1}, {x2, 0, x1}, {y1, 0, 1}, {y2, 0, y1}] avoids the branch-cut bug.
 

« first day (2866 days earlier)      last day (1615 days later) »