Mathematica Weekly Newsletter
Mathematica Weekly Newsletter

Top new questions this week:

How can I evaluate untrusted Mathematica code in a sandbox?

Is there any way to build a sandbox to evaluate untrusted Mathematica expressions in order to prevent them from having (malicious or accidental) harmful side effects? Context: I'm developing a system ...

kernel contexts security  
asked by ibeatty 19 votes
answered by Zdenek 9 votes

How to detect loops in a vector field?

Given a vector field and I'd like to detect if there are streamlines in closed patterns. For example, if the input is a vector field like this: image = ColorConvert[Rasterize[\[Infinity], ImageSize ...

image-processing pattern-matching vector machine-learning peak-detection  
asked by M.R. 13 votes
answered by nikie 16 votes

Distributing function arguments with function compositions. How to compute $(f + g^2)(x) = f(x) + g(x)^2$?

Suppose I have two functions f and g. To compute $f + g$ evaluated at a point $x$, I know that one can use Through to compute, Through[(f+g)[x]] to get f[x] + g[x]. Question: Suppose I want to ...

functions function-construction  
asked by user32416 12 votes
answered by jkuczm 8 votes

Partition a list into sublists of different lengths

I have the list {a, b, c, d, e, f, g, h, i} and I want to make a sub-list of the form {{{a, b}, c}, {{d, e}, f}, {{g, h}, i}} I've tried using Partition, but I can't see how to use it here.

list-manipulation  
asked by Terence Cosgrove 11 votes
answered by LLlAMnYP 12 votes

Form of citation for data via Wolfram Mathematica

What citation or reference should I adhere to if I'm using curated data obtained via Mathematica? I'm talking about data, or eg. plots thereof, obtained using functions such as SatelliteData, ...

curated-data  
asked by zentient 11 votes
answered by V-J 7 votes

Which symbol gets DownValues or OwnValues when using SetDelayed?

I have been looking at various usages of Pattern objects. Here's a number of ways to define the same thing: mod[x_] := {x} which gives mod DownValues. Nothing unexpected. e : mod[_] := ReleaseHold ...

reference-request downvalues  
asked by LLlAMnYP 10 votes

How to speed up the evaluation of a function with a large LeafCount but many repeated sub-functions for use in NIntegrate

General Context Apparently, the memory leak in NIntegrate is unavoidable pre-MMA-10.2. I have some (two-dimensional) numerical integration to do on a complicated function (LeafCount[g] is ...

performance-tuning numerical-integration memory memoization  
asked by march 9 votes
answered by march 4 votes

Greatest hits from previous weeks:

How to calculate contour integrals with Mathematica?

How to calculate the integral of $\frac{1}{\sqrt{4 z^2 + 4 z + 3}}$ over the unit circle counterclockwise for each branch of the integrand?

calculus-and-analysis complex  
asked by user64494 19 votes
answered by Artes 33 votes

How to create word clouds?

Word clouds are rather useless fancy and visually appealing plots, where words are plotted with different sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ...

graphics computational-geometry generative-art packing word-cloud  
asked by István Zachar 119 votes
answered by Heike 102 votes

Can you answer these?

Memory usage of compiled function: C vs WVM

Why does generating an array in "C"-compiled function uses 50% more memory than doing same thing in "WVM"-compiled function? Does this depend on OS or used C compiler? Simple example: ...

compile memory  
asked by jkuczm 9 votes

How to export to NetCDF format

Consider I have a scalar field on a grid f(x,y), where x and y can take values x={1,2} y={1,2,3} so the grid points are {{1,1},{1,2},{1,3},{2,1},{2,2},{2,3}} and the value of f on these grid ...

export data  
asked by xslittlegrass 3 votes

How to speed up a high dimensional numerical integration of Gaussian-form integrand

My integral has the following form: $$\int \sin(\theta) d\theta d\phi\left| \int d^3p_1 d^3p_2d^3p_3 \frac{f(p,\theta,\phi)}{g(p,\theta,\phi)}e^{-\frac{1}{2}(p^\mathrm{T} .A.p)}\right |^2,$$ where ...

numerical-integration  
asked by luyuwuli 3 votes
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3