Group Abstract Group Abstract

Message Boards Message Boards

New Functions I would like to see in future Wolfram Language versions

GROUPS:
I was wondering, it would be interesting to try to use the community as a way to request new functions that could be incorporated into new versions of Wolfram Language, in a colaborative way. Sometimes users simply don't have the whole/deeper system view, to understand that the requested function is or too specific, too broad or already implemented, but I believe that another times we can have a nice insights, that Wolfram Research people haven't yet, or that do not have received much attention  yet.  To the idea is:

Post your's requested Function as a answer to this question, and let's upvotes show the more interesting ones!

Some rules
1- One Post per function (or class of function), you can have more than one request.
2- Exemplify your function use.
POSTED BY: Rodrigo Murta
Answer
2 years ago
A class of functions that I would like to suggest is not a new one, but a extension of Scan function. Here are the function:
    ScanOuter
    ScanThread
    ScanInner
    ScanIndexed
Each one would have the same syntax use of their equivalent (Outer, Thread, ...), but with the same behavior as Scan, with much less memory consumption, due the fact that Scan don't have to "Save" all it results. Other advantage would be to use of Return inside, that opens the possibility to break computation at some moment.As an application example, sometimes I need to apply a function into all combination of to big groups, to take just some specific itens.
Let's simulate the lists using a RandomInteger, and Outer to simulate ScanOuter.
list1 = RandomInteger[1000, {10000, 2}];
list2 = RandomInteger[1000, {10000, 2}];
Reap[Outer[If[N@Norm@{##} > 1700, Sow[{#1, #2}]] &, list1, list2, 1]][[2]]
I believe that this kind of calculation would use much lass memory with the equivalent Scan function, that do not need to store each result.
The calculation above simple don't run in my computer (in less then 5 minutes), and should be almost instantly in ScanOuter.

Another nice application is ScanIndexed.
Imagine you want to know the position of the element, when it's > 0.8 in this list.
list={0.0314503,0.168573,0.291282,0.319608,0.426414,0.430967,0.626601,0.897033,0.923966,0.944242}
pos=ScanIndexed[If[# > 0.8, Return[First@#2]] &, list]
To to things like this today, you have to create a index variable, or use a While loop, what makes me very incomfortable inside WL paradigm.
ScanIndexed could some this in a more elegant way.
POSTED BY: Rodrigo Murta
Answer
2 years ago

Dear Rodrigo,

Some of this functionality is (kinda) implemented in the Lazy* functions from the built-in package streaming:

Needs["Streaming`"]

see also the thread here:

http://mathematica.stackexchange.com/questions/85278/is-there-a-built-in-equivalent-to-pythons-enumerate

POSTED BY: Sander Huisman
Answer
9 months ago

An important correction is that Streaming` is not a part of official Mathematica functionality, at the moment, but is present in undocumented form. This means that anything there can change in future versions, from function names to semantics etc. Besides, Streaming` doesn't really have the functions mentioned by @Murta, at present - although adding such implementations would be straightforward enough. But even then, they will work somewhat differently, because Streaming` works with data split in chunks, and uses objects which are not usual Lists, although in many ways behave like ones.

POSTED BY: Leonid Shifrin
Answer
9 months ago

ScanThread and ScanIndexed are here already.

Needs["GeneralUtilities`"]
?ScanThread
?ScanIndexed
POSTED BY: Alexey Golyshev
Answer
4 months ago

ScanThread and ScanIndexed are here already.

> Needs["GeneralUtilities`"] ?ScanThread ?ScanIndexed

But package GeneralUtilities is not listed in Documentation Center page guide/StandardExtraPackages.

In fact, a search indicates that this package exists only in the form of a downloaded Paclet.

POSTED BY: Murray Eisenberg
Answer
4 months ago

Yes, the package GeneralUtilities is not listed in the Documentation Center but nevertheless it is a standard package, not downloadable. I think that this package and the package Internal are only for the developers. There are a lot of interesting things in them.

Needs["GeneralUtilities`"]
?GeneralUtilities`*

?Internal`*

From the package Internal I use the function PartitionRagged time to time. It's strange that there is no a similar function in the kernel. Very useful.

Internal`PartitionRagged[Range[6], {1, 2, 3}]
{{1}, {2, 3}, {4, 5, 6}}
POSTED BY: Alexey Golyshev
Answer
4 months ago
I've been working on a list of potential library extensions that would not go in the System namespace as part of Wikicode.
Wikicode to-do list


I was going through implementing stub packages for various articles, but I figured I could get a handle more quickly on larger design issues if I just started making a big to-do list. I'm browsing through articles by how close they are to root categories and how popular they are. I'm looking for data visualizations, models, tables, etc that aren't currently in Wolfram Alpha and that could currently be implemented in a page of code or less. Over time, the sophistication of what can be implemented in a page of code will increase and we can build more complex models.

The code for each will go in the Wikicode package with the same name as the associated Wikipedia article. Packages can dynamically load other packages. Contexts are typically be based on the article title, but can be nested when necessary to prevent clutter. (e.g. "Economy of the United States" data might go under UnitedStates`Economy if UnitedStates gets too cluttered)

I've been asked what an item like "Aluminum: visual attributes as solid" means. For now, it would be convenient just to have named sets of graphics directives for color, transparency, specularity, etc. for common materials. So if I had a model of a soda can I could just put Aluminum`Material[] before it to quickly get something metallic looking. There are plenty of cool opportunities for using parametrized 3D color textures. For example, cutaway views of a simple strawberry model with adjustable size and randomized shape can be supported.
POSTED BY: Michael Hale
Answer
2 years ago
I would like to see an option DeleteDuplicates for Sort.

I have made my own library that implements a function that does the same as DeleteDuplicates, for sorted lists (as it is, it only works for integers). See this. For the case I tested it on it was about twice as fast as DeleteDuplicates.

But having the option to delete duplicates while sorting would be even nicer and it would make that library much less "needed".
POSTED BY: Jacob Akkerboom
Answer
2 years ago
Hi Jacob,
Union[] will give a sorted list of the unique elements in its argument.
Best, David
POSTED BY: David Keith
Answer
2 years ago
David, thank you so much emoticon.
POSTED BY: Jacob Akkerboom
Answer
2 years ago
I'd like to see ParameticFindMinimum which would enable running the same optimization problem with different starting points over and over again without setting up the problem each time.  There already is ParametricNDSolve, which enables repeated solutions of the same differential equation with different parameters values.
POSTED BY: Frank Kampas
Answer
2 years ago
Rodrigo, what are your comments on MapIndexed versus ScanIndexed - any great advantages there?
POSTED BY: Sam Carrettie
Answer
2 years ago
You can do the calc just like this:
Scan[If[#[[1]] > 0.8, Return[#[[2]]]] &, MapIndexed[{#, #2} &, list]]

But for a big list, this is a waste of memory too, to apply MapIndexed to it, just to create a index.
You can of couse use a For with Return, but I don't feel it's a nice WL code approach.
POSTED BY: Rodrigo Murta
Answer
2 years ago
Unify[ notebookfile, notebookfile] which does a Prolog style, but Mathematica aware, unify of two notebooks, showing the minimal changes needed to make the two identical.
Diff[ notebookfile, notebookfile] which does a Unix style, but Mathematica aware, diff of two notebooks, showing the minimal differences between two notebooks.

Both of these would be very useful in trying to expose the changes that have been made over time to a sequence of notebooks.
POSTED BY: Bill Simpson
Answer
2 years ago
Novice mode, possibly even on by default, but easily able to be turned off by those who cannot accept having their likely typos pointed out, which would provide help messages to explain, especially to novice users, how Mathematica's expectations differ from their expectations. This would give clear specific help messages, as opposed to the current messages, which would explain what a novice almost certainly needs to change in their input. This would include help for users who have become convinced they must desktop publish their input to Mathematica.
Highlight the "offending characters" in red, perhaps even blinking red, to direct attention to exactly where something needs to be changed. While most new users don't seem to write long lines, having the attention focussed on one or a few characters would greatly help. I can recall years ago writing some longer and more complicated expressions and staring at them trying to understand exactly where in that line the message I was supposed to focus my attention.
If it could be possible that this be driven by a user readable and possibly even editable, by advanced users, database of rules then this might open up opportunities to experiment with enhancing this. Initially covering really really well the top few dozen most common misunderstandings by new users might help new users scale the learning curve much more rapidly.
POSTED BY: Bill Simpson
Answer
2 years ago
A pointer in the various error messages returned by DSolve and and similar functions to a tutorial that explains how to provide all the various forms of initial and boundary conditions to obtain satisfactory solutions. 
POSTED BY: Bill Simpson
Answer
2 years ago
A pointer in various, perhaps new, warning messages returned by Solve and relatives to a concise tutorial that explains how to decide what function other than Solve might be more appropriate for the problem that was just given to Solve.
POSTED BY: Bill Simpson
Answer
2 years ago
I would like to see a high quality and fast Delaunay triangulation algorithm included as a built-in function.  Constrained Delaunay triangulation should be supported.  Something akin to TetGenLink, but for 2D, would be very nice.

The function from the Computational Geometry package is implemented in Mathematica and is much too slow for many real-world applications.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
What I really need almost every day and what is missing in Mathematica for many years is built-in user-friendly ticks generation function. The CustomTicks` package is not sufficiently flexible and easy to use. And why we even have no such functions as LinTicks and LogTicks built-in?! Also we still have no way to control the distance between the ticks and tick labels and between tick labels and frame labels (this distances often are too large by default). All this functionality is crucially important for creation of aesthetically pleasing graphics for publication purposes but up to this time a user must spend a lot of time fighting with extremely user-unfriendly Ticks option and finally anyway cannot achieve the desired appearance.
POSTED BY: Alexey Popkov
Answer
2 years ago
I agree with the need for better control of ticks in graphics. But the need goes much further. While our ability to produce good graphics has improved with the recent releases, producing publication quality graphics for scientific journals is still a nightmare. Of course, you can do it, but only by generating an entire page of complicated scripting of graphics primitives.

I would like to see Wolfram take this issue seriously. A good start would be to look at available tools such as Igor Pro 6, SigmaPlot, and Origin -- and commit to producing a competetive capability within Mathematica. These tools also provide data analysis capabilities, but Mathematica already excels at this. All it lacks is the ability to make good presentation graphics.
POSTED BY: David Keith
Answer
2 years ago
I agree completely with the prior comment about improving ease of use with Graphics.  I know this isn't a single function (as the thread indicates), but I use Mathematica mainly to write interactive demonstrations and documents for my classes, and I find great difficulty in getting graphics to look the way I want without a surprisingly large amount of work, compared with the relative efficiency of much of the rest of the system.  Also, on more than one occasion, the program has crashed while I have been adding text boxes to graphics, etc.
POSTED BY: Rob Holman
Answer
2 years ago
A very simple addition to ExampleData: icon images.

open, close, process, new, add, remove, delete, warning, attention, error, etc
POSTED BY: Pedro Fonseca
Answer
2 years ago
Functions dedicated to elliptic curve cryptography especially curves of the form y^2 = x^3 + a x + b for several pairs {a,b}

e.g. Objects Secp[256k1] could be equivalent to EllipticCurve[0,7] and represent the locus of points on y^2 = x^3 + 7

e.g. Char[Secp[256k1]] = 2^256 - 2^32 - 977
Then you could do a lot with tables or plots...without really checking my syntax...here's an example

ListPlot[ Flatten[
                Table[Table[  
                                Base58[
Char[  EllipticCurve[i, k] , {k,1,10}] {i,-10,40}] ] ]] ]

• PubKey -> PrivKey complexity order estimations, and other functions

e.g. CrackTime[pubkey, curve, speed...] = 10^897 years (ok, safe key...)

e.g. ValidKey[pubkey, privkey, Secp[256k1]] = True would verify a keypair

• emulate parts of keypair exchanges to examing faults

e.g. SignMessage[<message>, <type...]

e.g. SharedKey[EllipticCurve[0,7], <secret>, <modulus>]

• Hash pre-image time complexity computations

e.g. CrackTime[SHA512, <string>, ...]

• String Entropy
Complexity[<correcthorsebatterystaple>] = ...

• Rainbow tables

• Base58 encoding support and in general greater fluency in integer representations

So, so, so much could be done.  I just rattled this list off the cuff. If there is interest I will put more thought into exactly what would be excellent and write it up formally.
POSTED BY: Allen Majewski
Answer
2 years ago
I'd like to see CompilationTarget->"C" with Compile, which means actually CCodeGenerator to be available on ARM
or Raspberry-Pi...however.

I don't see what complications it involves to support the package on this platform, but there might be
a deeper reason why. If someone can enlight me I'd be rather thankful.
POSTED BY: Stefan Schwarz
Answer
2 years ago
- DropWhile
- StringTake with argument that do not generate an error if the string is too short
- StringStartsWithQ

some version of Row and Column that have the same syntax and options, or an tutorial explaining why they don't

 
POSTED BY: Luc Barthelet
Answer
2 years ago
Hi Luc,
Maybe StringMatchQ["teste", "t*"] can be used in place of StringStartsWithQ ?
How would this works?
POSTED BY: Rodrigo Murta
Answer
2 years ago

StringStartsQ and StringEndsQ are now built-in functions!

POSTED BY: Sander Huisman
Answer
9 months ago
DropWhile is easy to implement as Drop[#, LengthWhile[#, ...]]&.  Generally I'm against having too many basic functions, as Mathematica already has plenty.  But in this case I agree that DropWhile[] would be very nice to have.  Since we already have TakeWhile and LengthWhile, DropWhile would be a very natural addition, and I'm sure many people have looked for in the docs just because they new about the other *While functions.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
This is not a suggestion for a new function, but for some new functionality:  a hook into object destruction.

It's possible to extend Mathematica using C through MathLink or LibraryLink.  Sometimes it's necessary to have some data structure on the C side and make it accessible in Mathematica.  In this case it is necessary to have an explicit function for destroying these data structures on the other side, just like in low level languages that don't have automatic memory management or garbage collection.  This is somewhat inconvenient.

Examples are TetGenDelete (from TetGenLink) and ReleaseJavaObject/ReleaseNETObject (from JLink/NETLink).  Java does have garbage collection but the moment Java objects are made accessible from Mathematica it can't work automatically and it becomes necessary to destroy objects explicitly.

The best idiom I know for handling this situation is JavaBlock.  (One can implement something similar for any library that has its own data structures.)  It's much nicer to use than explicit free functions, but it's still not awfully convenient.

I wish Mathematica has a hook for expression destruction to make it possible for  the free functions to be called automatically.  I'm not sure how this would work, or if it's even feasible, but it would be very useful.  The fact that even the JLink developers decided on using JavaBlock instead of adding this hook into the kernel makes me suspect that it is not at all a trivial matter.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
I would like a built-in function which verifies is a degree sequence is graphical, i.e. the same as Combinatorica`GraphicQ without the $RecursionLimit problems that Combinatorica function has.  This functionality must already be present in the kernel in some form for use by DegreeGraphDistribution, but it is not publicly accessible.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
Improve the support for keyboard input! CurrentValue should be able to read more than just the modifier keys. The current support for only KeyDown events makes it very hard to make keyboard based controls for games. Sharing games with CDF is one of the best ways to get new people interested in Mathematica. I spent the first several years of teaching myself how to program by making two-player keyboard input games. Friends in my high school classes loved playing them. My school didn't offer any programming classes, and when I started an after school club for programming all people wanted to do was learn how to make games.

Mathematica is the only language I've ever used to make a result to show to someone else that doesn't support this functionality. Don't get me wrong. I love that I'll be able to read input from a DIY mass spectrometer in WL, but if you write your code on a keyboard, you need to fully support getting input from it. I don't have any data, but every second of my life tells me that for every student that wants to build a home weather station, we could gain ten users from students sharing games they make with their classmates.

Yesterday, I saw one of my friends from internships and the college programming team was making a game with Elm to practice reactive functional programming. I thought, "Hey, I'm making a Spacewar clone in Mathematica right now. I can probably sell him on Dynamic as opposed to Elm's lift and get him to install the CDF player, but I can't make a natural feeling input scheme for the Spacewar clone!"

I say this needs to be fixed or Elm or whatever the latest open-source startup language with a non-mainstream idea and a small library will eat Mathematica's lunch. I've got a boat to catch. I'll get caught up in a week. Here's the start of the Spacewar code if you want to try to make turning controls that don't jitter.
 t0 = AbsoluteTime[]; dt = 0; {width, height} = {600,
   400}; stars = {White, PointSize@Tiny,
     Point@Transpose@{RandomReal[#, #3],
        RandomReal[#2, #3]}} & @@ {width, height, 30}; ship1 := {White,
    Line[4 {{{0, -3}, {1, -1}, {1, 1}, {0, 3}, {-1,
        1}, {-1, -1}, {0, -3}}, {{1, -1}, {2, -2}, {2, -3}, {1/
        2, -2}}, {{-1, -1}, {-2, -2}, {-2, -3}, {-(1/2), -2}},
      If[CurrentValue[
        "ShiftKey"], {{1/
        2, -2}, {0, -4}, {-(1/2), -2}}, {}]}]}; {position1, velocity1,
   angle1} = {2./3 {width, height}, {0, 0}, 0}; EventHandler[
Dynamic[(dt = # - t0; t0 = #) &@AbsoluteTime[];
  If[CurrentValue["ShiftKey"],
   velocity1 += 20 {-Sin@angle1, Cos@angle1} dt];
  velocity1 += (10^5 Normalize@#/(Norm@#)^2 dt &)[{width, height}/2 -
     position1];
  Graphics[{stars, {White,
     Translate[Line[{#, -#}], {width, height}/2] & /@
      RandomReal[{-10, 10}, {2, 2}]},
    Translate[Rotate[ship1, angle1, {0, 0}],
     position1 = {Mod[#, width], Mod[#2, height]} & @@ (position1 +
         velocity1 dt)]}, PlotRange -> {{0, width}, {0, height}},
   ImageSize -> {width, height},
   Background -> Black]], {"LeftArrowKeyDown" :> (angle1 += 10 dt),
  "RightArrowKeyDown" :> (angle1 -= 10 dt)}]
POSTED BY: Michael Hale
Answer
2 years ago
A convex hull function that works in dimensions>= 2 and doesn't always triangulate (e.g., the same functionality as qhull)
POSTED BY: W. Craig Carter
Answer
2 years ago
Export of unmeshed BSplineSurface and graphics primitives such as Sphere to a CAD file format such as Rhino's .3dm 
POSTED BY: W. Craig Carter
Answer
2 years ago
Export of 3D primitives and their boolean combinations to STEP and SAT would be nice. These are universal agnostic formats for transfer between CAD environments.
POSTED BY: David Keith
Answer
2 years ago
Some very basic integration between CDF Manipulate controls e.g. Buttons and the hosting html page.
POSTED BY: William Stewart
Answer
2 years ago
I'd like a function analagous to Array that creates subscripted variables rather than indexed variables.
POSTED BY: Frank Kampas
Answer
2 years ago
DataArray and DataStore functions as described by Wolfrm back in 2011-2012 please.
POSTED BY: Carl Lemp
Answer
2 years ago
Sliders with a logarithmic scale.
POSTED BY: S M Blinder
Answer
2 years ago
S M Blinder, I saw this attempt at LogSlider. It only produces one-way behavior though (dragging the slider changes the value, but changing the value doesn't move the slider). Here is a simple start for LogSlider that produces the two-way behavior we'd expect. I'll put it as a stub for "Slider (computing)" on Wikicode tomorrow, so it can be collaboratively expanded.
LogSlider[Dynamic[x_], max_] :=
Slider[Dynamic[Log[max, x], (x = max^#) &]]

{LogSlider[Dynamic@x, 10^6], Dynamic@x}
POSTED BY: Michael Hale
Answer
2 years ago
POSTED BY: Michael Rogers
Answer
2 years ago
Make Solve and other similar functions "MatrixForm", and perhaps even "*Form" where it makes sense, aware so that people who cannot resist the compulsion to desktop publish their inputs only to then post asking why they then cannot get useful and correct answers out of Solve and other similar functions. If the function gets a *Form input then just strip off the *Form and see if it can the produce a correct answer. This should be a very small programming task.
 In[1]:= Solve[MatrixForm[{{1, 2}, {3, 4}}].MatrixForm[{x, y}] == MatrixForm[{7, 9}]]
 
 Out[1]= {{\!\(\*TagBox[RowBox[{"(", "", GridBox[{{"1", "2"},{"3", "4"}},GridBoxAlignment->{"Columns" -> {{Center}},
  "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}},GridBoxSpacings->{"Columns"->{Offset[0.27999999999999997`],
  {Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]},
  "RowsIndexed" -> {}}], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\).\!\(\*TagBox[RowBox[{"(", "",
  TagBox[GridBox[{{"x"},{"y"}}, GridBoxAlignment->{"Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}},
  "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.5599999999999999]},
  Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]},
"RowsIndexed" -> {}}],Column], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\) -> \!\(\*TagBox[RowBox[{"(", "",
TagBox[GridBox[{{"7"},{"9"}}, GridBoxAlignment->{"Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}},
"RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.5599999999999999]},
Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]},
"RowsIndexed" -> {}}],Column], "", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\)}}

In[2]:= Solve[{{1, 2}, {3, 4}}.{x, y} == {7, 9}]

Out[2]= {{x -> -5, y -> 6}}

There is no need to complicate the task by keeping track of whether *Form has been removed and try to restore that after the calculation, the user can easily add a //*Form to the end of their calculation if they wish. All that is needed is to list every function in Mathematica that would be broken if they are given a *Form and strip that before they begin. This would only try to begin to fill one gap between desktop publishing and the rest of Mathematica.
POSTED BY: Bill Simpson
Answer
2 years ago
Parallel as an option to some functions?

After posting this, I remembered that there are the ParallelTry, Paralellize  functions. However, I wonder if some functions might have internal parts that could be paralellized, but for which Parallelize[_] might not work.

I don't know if this is true, but I imagine there are cases in which some functions may be parallelized.  For example,
FindClusters[__, TryParallel->True] 
or
NDSolve`FiniteDifferenceDerivativeADerivative[__,TryParallel->True] 
would launch kernels if possible and speed up computation.

I also wonder if TryGPU might be an option for some functions as well?
POSTED BY: W. Craig Carter
Answer
2 years ago
Unit were a welcome addition to mathematica, but a pain to use.
Please add a "Units Palette" as part of the standard distribution.
POSTED BY: David Keith
Answer
2 years ago
<s>Completely agree with the delaunay triangulation and convex hull; it is VERY slow compared to other packages. Rendering it useless for practical things!</s> huge improvements since version 10.

<s>OrderingBy: Like the entire family: Sort/SortBy, Gather/GatherBy, Split/SplitBy</s> not so useful indeed...

AxesScaling:  An option for ALL the plotting-functions (Plot,ListPlot,ContourPlot, DensityPlot, ParametricPlot et cetera and their 3D variants) that specifies the Axes to be Linear/Log/Date/Custom: AxesScaling -> {"Linear","Log","Log"} would result in a 3D plot with lin-log-log scales. Now you have to do everything manually by renaming ticks and rescaling coordinates (total mess).

<s>Please fix the logarithmic ticks: if it spans many orders of magnitude it will do 10^0,10^2, 10^4 et cetera. That is not too bad; the worst is is that it creates 8 subticks between them! They really have no meaning then!</s> fixed since version 10.

Local unit recognition; over the internet is just too slow. Just put it as a paclet like many components, so it is updatable.
POSTED BY: Sander Huisman
Answer
2 years ago

@Vitaliy Kaurov You might want to check why the strikethrough < s > tag is not working in the post above... (I added the tags as an edit later).

POSTED BY: Sander Huisman
Answer
6 months ago
I think that OrderingBy is not necessary.  It it were to be analogous to SortBy then OrderingBy[list, f] would give exactly the same output as Ordering[f /@ list], which can even be changed to
Ordering[f[list]]
for better performance is f[] is one of the optimized listable functions.

(Sorry about the code block, the editor mangles what I wrote otherwise.)
POSTED BY: Szabolcs Horvat
Answer
2 years ago
One improvement I would really like to see is fixing up the Graph-related functions, especially the property API.  It's rather unpredictable and there are lots of serious usability functions, which mostly come up when one would use SetProperty and related functions.  I'm not going to hijack this thread by describing examples, but I'm sure people who've used these functions have encountered them ...
POSTED BY: Szabolcs Horvat
Answer
2 years ago
Two improvements in help messages.

In Dsolve and NDSolve it is not uncommon to see the following misunderstanding
DSolve[y'[x]==3*y,y,x]
where users seem to usually get the notation correct for derivatives, but then use the function without the [ x ], probably because of textbook notation.

If the help system would do a scan for "bare" function names and print out a very explicit help message with exactly the name that needed to be modified and how then this would keep the system from knowing exactly what was wrong, but not explaining it to the user.

Similarly, in NDSolve, and other N* functions, it is not uncommon to see the following misunderstanding
NDSolve[y'[x]==q*y[x],y,{x,1,2}]
where the symbol q has not been assigned a constant numeric value.

If the help system would do a scan for symbols which did not have assigned constant numeric values and print out a very explicit help saying exactly what symbol name needed to be assigned a value then this would again keep the system from knowing exactly what was wrong and printing some unrelated message about some non-numeric value at some meaningless numeric value.

The system should have all the needed information already evaluated to be able to do a quick scan for both of these just before it wades off into trying to find the real solution.

Both these problems are seen again and again.
POSTED BY: Bill Simpson
Answer
2 years ago
I Agree with Szabolcs. De Graphs are so important in alot of areas that we should have more stabilty there. Don't want to start a me to thread but just want to give a little support.
POSTED BY: l van Veen
Answer
2 years ago
Yes another suggestion, which is not strictly about adding new functins, but about improving existing functionality:

Mathematica's philosophy is that the user should be able to input a simple request and be able to get a result automatically, without needing to either care about how that result is obtained or needing to fuss with details.  This can indeed be quite useful when getting familiar with a functionality area or doing quick calculations.  Many functions, such as NIntegrate, will automatically choose a good method to use internally, and will just work and give a result.

However, sometimes the heuristics used for automatic method selection will intevitably fail, and it will be necessary to better understand the available methods and fine tune them.  Some functions make this possible, and NIntegrate is a very good example: it even provides a framework for extending it with ne methods.

What I would like to suggest is three things:
  1. Make it more transparent what happens when methods are chosen automatically.  Make it possible to find out which method was chosen by the system.  Make all the values of the relevant suboptions accessible.
  2. In general, document Method options better!  Some functions/functionality, such as numerical integration or unconstrained optimization are quite well documented in "advanced tutorials" (though I wish that subsections of these tutorials were more thoroughly references from the doc pages of the actual funcions).  But some other areas of complex functionality, such as graph drawing, are not nearly as well documented.  It is typically difficult to find out what are all the available Method options and suboptions for many different functions.
  3. Provide more fine control!  I would like to see more optional fine control, e.g. for graph drawing, accompanied by more advanced documentation.  Keep the default on Automatic, but let is fine tune the layout methods better.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
- raytracing (or better/more automatic integration with pov ray or other)
- bump mapping
- natural management of subscripted variables (already mentioned, but I insist)
- drag and drop dynamic objects (to build interfaces like system modeler)
- persistent data and "interface" tabular object (meaning excel like object)
POSTED BY: Pedro Fonseca
Answer
2 years ago
- be able to name and give order to input fields and other interface objects, so to jump between them in the desired order, or to go directly to a given object
- easy way to avoid shift+return or enter to mess up interfaces like input fields (so that I don't need to say " You're pressing it wrong")
POSTED BY: Pedro Fonseca
Answer
2 years ago
This is of minor importance but being able to plot from  0  to  Infinity  (via a  Tan  transformation or something similar) would be occasionally convenient.  For instance, given
Integrate[f[x], {x, a, Infinity}]
copy it and change Integrate to  Plot  just to get a quick visualization:
Plot[f[x], {x, a, Infinity}]

It would be more or less equivalent to
Plot[f[a + Tan[Pi t/2]], {t, 0, 1}]
with  Ticks  automatically set.

Similar it could be extended to plotting from  -Infinity  to  Infinity.  There could be issues with determining how fast to approach  Infinity  (e.g. what value of  x  corresponds to  t = 0.5).
POSTED BY: Michael Rogers
Answer
2 years ago
- official function to pick up, from an existing/generated Graphic, its different internal components, avoiding things like: Plot[...][[1]]
(including a function to illustrate its structure in a kind of graph view of its contents/definition)
POSTED BY: Pedro Fonseca
Answer
2 years ago
Pedro Fonseca, very nice requests.
POSTED BY: Rodrigo Murta
Answer
2 years ago
Another suggestion is a function to get function information. I have wrote about this in some place in the community that I can't find.
Something like, FunctionData[funcionName_], and it could retrive: Mathematica version of implementation, Attributes (that are sometime protected).
This should be a simple way to work with version compatibility and select all new implemented functions of some version.
POSTED BY: Rodrigo Murta
Answer
2 years ago

This now exists:

WolframLanguageData
POSTED BY: Sander Huisman
Answer
9 months ago
I'd like to see something like UnitStep that returns 0 for 0, while being just as fast as UnitStep and not unpacking arrays. (Right now UnitStep[0] == 1.)  Maybe this could be an option to UnitStep.

Motivation:

Vectorization and always using packed arrays is a  good way to speed up computations.  I'm talking about this style of programming: (1)(2).

When programming like this, it's often necessary to transcribe inequalities in terms of UnitStep.  For example, the sum of all numbers greater than or equal to 5 in 'list' can be computed as 
Total[list UnitStep[list - 5]]

This is typically much faster than Total@Select[list, # >= 5 &], depending on the distribution of the numbers in list.  While this is a very simple example, generally, the techinique is useful.  Unfortunately it is also very cumbersome.  Suppose we're looking for the number strictly greater than 5.  What then?  We will need to use 
(1 - UnitStep[5-list])
instead, which is still simple, but just too much of a mental effort to think up without making a mistake.  This is the problem I'd like to see a solution to, or in general, make it more convenient to vectorize calculations.

Of course I do realize that it's trivial to define one's own function for this, or create a package.  It would be nice to have it built-in nevertheless.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
What I have wanted for a long time is new functionality for the With command. Using With one can't define a constant in terms of another constant in the same With.  I end up with many levels of embedded With commands.  I would like to see a generalized form of With like this:

With[ {blah1,..}, {blah2,...}, {blah3,...}, expr ] = With[ {blah1,..}, WIth[ {blah2,...}, With[ {blah3,...}, expr ]]]

It should be defined for any number of levels.  A recursive definition: With[ {blah1__} , {blah2__}, expr__ ] := With[ {blah1}, With[ {blah2}, expr]

Clearly, one can avoid such embedding with Block and Module, but it is wasteful to define a variable when a constant will suffice. 
POSTED BY: Terrence Honan
Answer
2 years ago
Hi Terrence Honan, meanwhile you can use this implementation by Leonid, that do exactaly what you wants.
POSTED BY: Rodrigo Murta
Answer
2 years ago
Is there a big performance-gap between Block / Module and With? I never noticed that this is major. Maybe if you have many many small tasks it will make a difference?!
POSTED BY: Sander Huisman
Answer
2 years ago
Sander and Terrence, it's not about performance.  With[] and Module[] serve different purposes.  Consider With[{a=1}, Hold] and Module[{a=1}, Hold].  With[] is a good way to inject something into a held expression.  Suppose you're building a Function object dynamically.
POSTED BY: Szabolcs Horvat
Answer
2 years ago

The Inactivate doc page has a neat implementation of IterateWith that has this functionality.

POSTED BY: Sjoerd de Vries
Answer
9 months ago

Namely, "Replace With by an iterated version, so that later variables can refer to earlier ones:"

SetAttributes[IterateWith, HoldAll]
IterateWith[expr_] := Activate[Inactivate[expr] //.Inactive[With][{first_, rest__}, body_] :> 
Inactive[With][{first}, Inactive[With][{rest}, body]]]

With[{a = 3, b = a + 2, c = a + b}, {a, b, c}]

{3, 2 + a, a + b}

IterateWith[With[{a = 3, b = a + 2, c = a + b}, {a, b, c}]]

{3, 5, 8}

POSTED BY: Vitaliy Kaurov
Answer
9 months ago
I'd like a function that provides reliable clean-up functionality in the face of non-local transfers of control. Something that like finally blocks in Java, or UNWIND-PROTECT in Common Lisp, or like destructors implicitly do in C++. An example would be:
With[{stream = OpenWrite[]},
    Cleanup[
        (* some stuff *),

        Close[stream]]];
Whatever (* some stuff *) might be, including if it has Return[], or Throw[], or if someone uses an Abort[] in the middle of it, I want to be sure that Close is run, to the extent possible within Mathematica's semantics. 
POSTED BY: Matt Pillsbury
Answer
2 years ago
I also would like a Printf which uses C-style printf strings for formatting and returns actual strings. StringForm returns wrapped objects, which isn't a big deal, but is much more limited than Printf in key respects (there's no real way to control how numbers are displayed). Right now, you have to do something like use J/Link, which is slow and not terribly pleasant.
POSTED BY: Matt Pillsbury
Answer
2 years ago
@Matt:

Why not use ToString[ , ] incombination with ScientificForm, NumberForm, EngineeringForm, PaddedForm, AccountingForm, BaseForm ? That should solve most cases right?
POSTED BY: Sander Huisman
Answer
2 years ago
@Sander:

Yes, you can obviously make it work, but the results tend to be verbose and clunky. One of the things I like about Mathematica's regex functionality is that it supports both traditional regex syntax (which for simple cases is compact and clear) and also a more verbose, but abstract Mathematica DSL that expresses the same thing using familiar Mathematica syntax. I'd love to see the same sort of flexibility in string formating.

@Szabolcs:

That looks like a step in the right direction, but misses the easy number formatting of printf. 
POSTED BY: Matt Pillsbury
Answer
2 years ago
@Szabolcs
True, for such things it behaves very differently. But I think for most cases people use With, Block and Module almost interchangeably...
POSTED BY: Sander Huisman
Answer
2 years ago
Matt, there's the new StringTemplate in v10, which, unlike StringForm, actually returns a string, and accepts named palceholders.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
Matt, I agree that we need a reliable means of cleanup.  I've been wanting this for a while and here's a related thread.  There's a helpful undocumented function called Internal`WithLocalSettings, but it's said to be not 100% reliable.  I use it sometimes.  This undocumented function is an essential element for implementing something like JavaBlock[].

This is also related to my earlier suggestion (above) for a hook into object destruction. There I wrote that the best solution that's currently possible is an analogue of JavaBlock.  But JavaBlock also relies on the undocumented WithLocalSettings.  So I'd say that this functionality is very important for package developers (even if end users would rarely use it).
POSTED BY: Szabolcs Horvat
Answer
2 years ago
Again, this is not about adding new functions but improving existing functionality.

I would like to see RLink improved!  In particular, I would like to see it (better) support external R installations and support this more seamlessly.  It should be possible to set it up to always use a particular external R installation by default (currently this is rather difficult to achieve), external R should be officially supported on all three platforms and it should support the latest R version (R 3.0).

Why Would a Mathematica User Care about R?

Quoting from this blog entry,
... with RLink I now have immediate access to the work of the R community through the add-on libraries that they have created to extend R into their field. A great zoo of these free libraries fill out thousands of niches–sometimes popular, sometimes obscure–but lots of them. There are over 4,000 right here and more elsewhere.

The only problem is that this was not really so at the release of v9, as on OS X and Linux neither external R installations were officially supported, nor package installation (!!).  And there's not that much in the base R distribution that I'm interested in as a Mathematica user, all the advantages would come from installing third party packages.

The result is that not many people seem to be using RLink despite its huge potential.  Later it turned out that there are ways to get it working on OS X and Linux but it's not in the documentation how to do it and it doesn't always work.

RLink is an excellent system, it has great potential and clearly a huge amount of work went into it.  It is a great pity that it misses that tiny little last step that could make it usable and useful for everyone.  I'm really hoping that WRI is not going to abandon it and the necessary improvements (which are really just the few little things I mentioned above!) will be made for the v10 release.

Every time I recommend IGraphR to someone, their biggest barrier to using it is getting RLink working on their system with an external package first, then the extra setup needed each time before loading IGraphR.
POSTED BY: Szabolcs Horvat
Answer
2 years ago

And get RLink to work out of the box under OSX 10.11 (El Capitan) without Szabolcian heroics. http://szhorvat.net/pelican/setting-up-rlink-for-mathematica.html

POSTED BY: Seth Chandler
Answer
6 months ago
ISO WEEK YEAR NUMBER & WEEK DAY NUMBER
In DateString and DateList, an old request that I still miss in version 10, very common in financial marketing and another business, is ISO Week Number Date related functions (standard in Oracle and SQLServer).
- Given a date, what is It ISO Week number and iso week year.
Another functions to do the inverse operation would be nice too. For example, Week 04/2014 -> {{2014, 1, 20}, {2014, 1, 26}}
A week day number options ((1, 2, 3, 4, 5, 6,7) for (sun mon tue wed thu fri sat)) would be also welcome. Today we have "DayName", "DayNameShort", "DayNameInitial" but not some "DayNumber", very usefull for calculations.
POSTED BY: Rodrigo Murta
Answer
2 years ago

This has now been implemented:

DateString["ISOWeekDate"]
DateString["ISOWeekDay"]
DateString["Week"]
DateString["WeekShort"]
POSTED BY: Sander Huisman
Answer
9 months ago
Fast Modifications or Updates to Nearest 

I wonder if it is possible to modify nearest with minimal computation if only one or two points are changed.

For example, this might be a typical use of Nearest:
data = RandomReal[{0, 1}, {10000, 2}];
nearestFunc = Nearest[data -> Automatic]
location = nearestFunc[{0.5, 0.5}]
EuclideanDistance[{0.5, 0.5}, First[data[[location]]]]

newdata = ReplacePart[data, location -> {0.5, 0.5}];
Now suppose that I only want to change one element of data:Now, I would need to recompute the NearestFunction using all the data.
I would guess that it would be faster to update the NearestFunction with information stored in the previous NearestFunction.
newNearestFunc = Nearest[newdata]
For example, usage of the function might be:
newNearestFunction = ReplaceElementNearestFunction[nearestFunc, {i->{x,y,z},j->{x,y,z}}]
POSTED BY: W. Craig Carter
Answer
2 years ago
NearestGradients as a first cousin to Nearest

I wonder if it is possible to include a "Nearest-like" function that returns points that have the largest magnitudes of gradients respect to a set of fixed data points

For example:
distanceFunction[v1:{x_, y_, z_}, v2:{x2_, y2_,z2_}]= EuclidianDistance[v1,v2]
scalarPotential[v1:{x_, y_, z_}, v2:{x2_, y2_,z2_}] := Exp[-distanceFunction[v1,v2]^2]

data = RandomReal[{0, 1}, {10000, 3}];

nearestGrad = NearestDistanceAndGradient[data, ScalarPotential->scalarPotential[#1,#2]&, InterpolationOrder->2]
and nearestGrad[pt,2]  would return a list:
{
{pt1, distanceFunction[pt,pt1], Grad[scalarPotential[pt,p1]]},
{pt2, distanceFunction[pt,pt2], Grad[scalarPotential[pt,p2]]},
}

where pti ={xi,yi,zi} are the points for which Abs[Grad[scalarPotential[pt,pti]] is ordered.

I suppose that this would only work for differentiable DistanceFunctions.
POSTED BY: W. Craig Carter
Answer
2 years ago
I would like to have a (huge) stack of functions available to the model fit functions, so that, with a simple command, one could search on all this stack for the one that best fitted a given data. And then, to be able to sort and filter then accordingly to a fitting criteria, a function family classification, etc..

Functions would be available for at least 2D and 3D data.

I know many critics would say that if one is fitting data to a function, it is for certainly because the function has a given known theoretical relation to the phenomenon, which means that there should be no reason for a blind search (I've heard this one too many times...). In my business (and a lot of other ones...), this is not necessarily the case in a lot of situations, and we just need a function that describes a given variation so to integrate the variation in a more complex model. This can be done with the Interpolation function, but as soon as things become a little more complex, there's nothing like a mathematical object that we can see, analyze, etc.

This should be relatively easy to start by WR since there's already the Wolfram Functions Site. Also, the functions don't necessarily need to be available on the install, and can be loaded when requested, which means that the framework can start with very little effort, since it can grow along time.

I think that there's no need to say that it could also be a very interesting functionality to have available on W|A (just trying to find a budget ;-) )
POSTED BY: Pedro Fonseca
Answer
2 years ago
@PedroFonseca

What you describe is similar to symbolic regression.  Symbolic regression means automatically finding a formula that describes the data (by various methods suc as genetic programming, hopefully in a smarter way than brute-force trying a large number of formulae).  I'm aware of one commercial Mathematica package for it (see the link).

Here are two real world applications of the technique, in case anyone is interested (and to show that it's not as crazy as it sounds): (1)(2)
POSTED BY: Szabolcs Horvat
Answer
2 years ago
@Szabolcs

(great... this is now what I want to use... thanks a lot for spoiling...)

Very interesting package (that I was not aware of...)!

Unfortunately, when putted in perspective with my needs, the price is a "little" out of my league :-(
POSTED BY: Pedro Fonseca
Answer
2 years ago
Access to the guts of ListContourPlot and ListContourPlot3D

It would be very nice to have direct access to the meshes created from contour plots of data as in ListContourPlot.  I've extracted the data from the GraphicsComplex that is created by the graphics function, but this seems like a duplication of effort.

Perhaps, such a function could return sets of closed and non-closed surfaces represented by vertex-edge-face data structures.

POSTED BY: W. Craig Carter
Answer
2 years ago
I would like to see graphics handling improved to make it easier to prepare high quality figures.  In particular, I would like to have easy solutions to the following problems:
  • Make it easy to generate a grid of figures which are properly aligned with each other, e.g. like this. Currently this is a huge pain in Mathematica and it's extremely difficult to make the frames line up without a lot of manual work.
  • It should be possible, and relatively easy, to prepare figures to size.  For example, if a column in the journal is 10 cm wide, I want to prepare the figures precisely to 10 cm, while keeping the font sizes consistent (e.g. 10 pt precisely).  This means I can't first make the figure to arbitrary size then rescale it outside of Mathematica because then the fonts will be rescaled too.  This is possible currently if I only use Graphics[] objects.  As soon as I try to make a Grid[] or GraphicsGrid[], or as soon as I use legends (which do not produce Graphics[], again showing the existing limitations!), it becomes very difficult to do it.
I think all these related problems stem from one thing: ImagePadding (and related measures) are unrepditable and not even knowable by the kernel.  They are only known by the front end.  For example, if I want to line up frames in a grid, I need to make sure that all frames have the same ImagePadding.  However, if I set the ImagePadding manually, I need to make sure that it's not too small that it cuts off labels and it's not unnecessarily large.  This involves a lot of manual work and it's difficult to automate because it's not possible to retrieve the automatic ImagePadding without resorting to ugly hacks such as rasterizing the graphic first.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
Generating plots in grids is indeed a hassle: though it can be achieved by using Inset with the right arguments. Making a figure e.g. 10cm wide is a matter of converting it to printer-points, and setting that as a width (for EPS and PDF output). It might appear small in Mathematica, but the output wil be correct. Stay away from Grid and GraphicsGrid would be my advice once you want to make complicated arrays of figures with specified dimensions/paddings. 
By using inset you make the figures precise, e.g.:


This figure was used in a journal where the overall size was important but also the font-sizes were important.
POSTED BY: Sander Huisman
Answer
2 years ago
@Sander nice plot. Can you share your notebook with these alignments using Inset? I normaly use Panel inside Grid.
There is some way to share Notebooks in the forum? Let's test it...
Update:
Do not work using "Add file to this post" buttom.
POSTED BY: Rodrigo Murta
Answer
2 years ago
Rodrigo, here is the 'template': I minimized the code, hope you can decypher it:
 z=490;
 h=z;
 z1=z/3;
 z2=2z/3;
 h1=h/3;
 h2=2h/3;
 mleft=40
 mright=6
 mtop=33
mbottom=35
mtoptop=19
multimargins={{mleft,mright},{mbottom,mtop}};
topfigmargins={{mleft,mright},{mbottom,mtoptop}};


size12={z2/2,h1-(mtop-mtoptop)};
size45={z1,h2/2};
sizeb={z2,h2};
size3={z1,h1-(mtop-mtoptop)};
pb=Plot[Sin[x],{x,0,2\[Pi]},Frame->True,AspectRatio->Full,ImagePadding->multimargins,PlotRange->{{0,2\[Pi]},{-1,1}}];
{p1,p2,p3,p4,p5}=Plot[Cos[# x],{x,0,2\[Pi]},Frame->True,AspectRatio->Full,ImagePadding->multimargins,PlotRange->{{0,2\[Pi]},{-1,1}},Epilog->Text[Style[#,16,Red],{\[Pi],0.5}]]&/@Range[5];


multistrucplot=Graphics[{
(*Red,Line[{{z1,0},{z1,h1+h2}}],
Line[{{0,h2},{z1+z2,h2}}],
Line[{{0,h2/2},{z1,h2/2}}],
Line[{{z1+z2/2,h2},{z1+z2/2,h2+h1}}],*)
Inset[pb,{z1,0},ImageScaled[{0,0}],sizeb],
Inset[p5,{0,0},ImageScaled[{0,0}],size45],
Inset[p4,{0,h2/2},ImageScaled[{0,0}],size45],
Inset[p3,{0,h2},ImageScaled[{0,0}],size3],
Inset[p2,{z1,h2},ImageScaled[{0,0}],size12],
Inset[p1,{z1+z2/2,h2},ImageScaled[{0,0}],size12]
},
ImageSize->(size3+sizeb),
PlotRange->{{0,z1+z2},{0,h1+h2-(mtop-mtoptop)}}
];
Show[multistrucplot,PlotRangePadding->Scaled[0.01]]
Should give something like:
POSTED BY: Sander Huisman
Answer
2 years ago
Interesting use of Inset. Tks for share it!
POSTED BY: Rodrigo Murta
Answer
2 years ago
The key thing is to use:
- ImageScaled[{0,0}] rather than {0,0}. 
- Use margins on the 'original' figures, and no sizes)
- Specify the sizes in the inset command.
- AspectRatio -> Full in the original figures.

But I think we all agree that there should be something 'builtin' like image-assemble: graph-assemble. Or that graphics-grid is fixed ;)
POSTED BY: Sander Huisman
Answer
2 years ago
There is an add-on program to Matlab called CVX which optimizes convex problems very efficiently.  Python has something similar called CVXOPT.  It would be good to have an equivalent in Mathematica.
POSTED BY: Frank Kampas
Answer
2 years ago
@Sander I know that it's possible to do it, but it's awfully inconvenient and it takes a lot of manual work.  It's much easier to do it using most other plotting packages.  There are packages that automate much of this manual work, such as SciDraw,  but they have to reimplement a lot of stuf to be able to do this in a general and reliable way (e.g. all of frame and tick drawing) and they still force me to do more manual work, e.g. specify plot ranges manually for every subfigure.

(I can't see your figure because Community's image hosting is broken at this moment.)
POSTED BY: Szabolcs Horvat
Answer
2 years ago
An option for Interpolate to not extrapolate

Interpolate returns extrapolated values when it arguments are out of the range. However, there are cases where I would prefer that an Interpolation function would automatically clip.

Consider this "mistake":
data = Table[{x, Sin[x + RandomReal[{-0.1, 0.1}] + x]}, {x, -Pi, Pi, Pi/64}];

intF = Interpolation[data]

Plot[intF[x], {x, -1.5 Pi, 1.5 Pi}]

It would be nice if there were an option to have an InterpolationFunction to either clip its arguments or to return Null. 

It is fairly simple to find a work-around:
clipMyInterpolation[f_, x_] := Module[
  {bounds = Flatten@First[f]},
  f[Clip[x, bounds]]
  ]

clipMyInterpolation[intF, 24]
But, it would be nice to have an option such as:
intF = Interpolation[data,Extrapolation->ClipBounds]
or
intF = Interpolation[data,Extrapolation->Null]
POSTED BY: W. Craig Carter
Answer
2 years ago

This has been around, but undocumented:

intF = Interpolation[data, "ExtrapolationHandler" -> {Indeterminate &, "WarningMessage" -> False}]

"ExtrapolationHandler" -> function calls function on any input outside the domain. Whether or not to turn warning messages off (as above) can be decided case by case.

This option can be passed to NDSolve as well.

POSTED BY: Michael Rogers
Answer
1 year ago
Access to the player’s kernel, from other interfaces (custom, Excel, etc), to call for functions programmed/prepared with the full Mathematica version.

No need to point out the “security risks” involved... But the need is huge from everyone that is forced to live in the Excel world. Also applicable for any kind of interaction with different local applications (CAD, etc), where server side computation or cloud computation is a no go: too “heavy” for common simple projects (small teams, etc), too open for confidential cases, too slow for thousands of individual requests (for instance, from Excel calculation update), local work where internet is still rare, etc.. Or where the project dimension doesn’t “cover” for multiple Mathematica licenses.

I go even further, and specify the difference between free player and player pro (to protect myself against the "only pro solution"). The free version pops up a pub message at the corner of the screen, every 30 min, while on use, saying “Wolfram Research, supporting your computations”, the pro version, or the enterprise "produced" version only does it once at the beginning of the session.

;-)

PS – the community interface still has some interesting bugs. This same post that you are reading was previously substituted by the first entry from Rodrigo
POSTED BY: Pedro Fonseca
Answer
2 years ago
Also it would be great if
BinLists and BinCounts
where to be extended to:
BinIndices
(and that it returns in such a way that you can use e.g. extract on it)

A lot of times you want to bin your data X, and get the 'associated' data Y. i.e.:
{{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-},{-,-}} 
Say, you have these data-pairs. then you would like to bin on the first value, and get the second values for each bin. What I do now is to bin in 2D, and have the binsize in the second dimension very very large. But this will only work with numbers, if is it anything else it does not work.
POSTED BY: Sander Huisman
Answer
2 years ago
I needed this functilonality last week. Not so easy to do from zero.
Relatad SE post: http://mathematica.stackexchange.com/questions/17734
POSTED BY: Rodrigo Murta
Answer
2 years ago
Or an option for BinLists, that you can specify a pure function as argument (or multiple) and that it bins over each of thse functions-answer. 

So something like:

BinLists[{{x1,y1,z1},{x2,y2,z2},{x3,y3,z3},{x4,y4,z4},{x5,y5,z5},......},{0,100,10},{0,200,10},BinFunctions ->{First, Part[#,2]&}]

I.e. this would bin the data x,y,z ....first over the x values in bins from 0 to 100 in steps of 10, and then over the y values in bins from 0 to 200 in steps of 10. Of course one could specify more difficult functions, let's say Total, or Mean.....With that you make very elaborate binning and would remove the need of BinIndices or so.
POSTED BY: Sander Huisman
Answer
2 years ago
I'd like to see functionality for querying databases, above and beyond what is provided by SQL.
POSTED BY: Frank Kampas
Answer
2 years ago
What kind of databases? Relational databases are kind of inherently stuck with SQL-like queries or things you'd find in relational algebra.

Are you looking for operations which are composition of relational algebra operations, like some kind of higher order SQL?

Or are you looking for functionality for non relational databases like graph databases
POSTED BY: Sean Clarke
Answer
2 years ago
Relational algebra operations would be a good start.  Also, the query optimization done by SQL, such as Microsoft's, is very crude.  I'm sure the Wolfram Language could do a better job.  Given the goal of extending the usage of the Wolfram Language, relational database querying would be a big step in that direction.
POSTED BY: Frank Kampas
Answer
2 years ago
I would love to see a gui change. I would most appreciate a sidebar, where all functions can be found, and by clicking on them being automatically transfered to that part of my code.
It would save me time from scrolling up and down .
POSTED BY: Tom Zinger
Answer
2 years ago
That would indeed be awesome! Furthermore if you right-click on any function it could say 'show definition' either going to the built-in help or your own definition.
POSTED BY: Sander Huisman
Answer
2 years ago
I would like to see the Profiler and the MUnit unit test framework being moved from Workbench into the core Mathematica.  Neither of these are inherently tied to the Workbench.  In fact I already use MUnit separately from the Workbench sometimes because I prefer to do package development in other plain text editors (such as Vim), and MUnit can be used from within a notebook too.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
@Szabolcs. This would be cool!
POSTED BY: Rodrigo Murta
Answer
2 years ago
I think we all want break-points, and some simple command to go step-by-step, and hover over any variable and check their current value...
POSTED BY: Sander Huisman
Answer
2 years ago
The built-in debugger has a very bad reputation, but in my experience it is quite usable except for one key area: breakpoints.  If I don't try to use breakpoints, then it's a very useful tool.  Instead of breakpoints it's possible to simply trigger a message or use Assert or similar.  (I don't mean that there isn't room for improvement, just pointing out the currently usable solutions.)
POSTED BY: Szabolcs Horvat
Answer
2 years ago
I've been using Mathematica for 12 years or so, and I haven't figured the debugger out yet (for real!). It is just too damn confusing! I would love to see a good video about it, and try to use it ;)
POSTED BY: Sander Huisman
Answer
2 years ago

Because of the scarce documentation, I sent an inquiry about the built in debugger to tech support about a year ago. The response I got was that they recommended I use Workbench, implying the built in debugger was more or less abandoned.

POSTED BY: David Keith
Answer
9 months ago
Maybe it's worth starting a separate thread about that.  It would be interesting and useful to figure out a good workflow.  I use it occasionally, but not often, and almost never with my own code.  But I don't try to use breakpoints any more---bad experiences with those.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
http://www.dbaileyconsultancy.co.uk/debugtrace/debugtrace.html
POSTED BY: Frank Kampas
Answer
2 years ago

About debugger. I have made this here: community.wolfram.com/groups/-/m/t/250326

POSTED BY: Rodrigo Murta
Answer
9 months ago
Deselect

We have Cases[expr,pattern] and DeleteCases[expr,pattern]

Why not Deselect[expr,criterion]?

(* standard caveat, yes, easy to write your own... *)
POSTED BY: W. Craig Carter
Answer
2 years ago
It would be great to have option to create Formated Excel files, with control over:
    1- Cell color
    2- Font Color
    3- Column size
    4- Border color
    5- Export ascreating Excel Tables Object.
    6- Cell comments
    and so on...

It would be nice to just create a formated Grid, and when export it using Export["myexcel.xlsx",Grid[myData, A lot of formated options]], that this data could come to excel already formated. I kwno I can use VBScript to do that, but I would like to do all from inside Mathematica, in a more clean/simple way.
I automate a lot of reports today using Mathematica, but they are very ugly, due to the lack of format capabilities.
I know about ExcelLink, but it's not a direct options to me because it needs Excel instaled, and works just for Windows. I would love to have this improved Export version.
If there are another options, please, let me know.
 
POSTED BY: Rodrigo Murta
Answer
2 years ago
Along the same lines as better Excel exports, being able to do any exports to PowerPoint would be really helpful. PowerPoint is somewhat terrible, but it's also the lingua franca of many corporate environments. It would be nice if these improvements extended to better export to WMF/EMF formats, which tend to be pretty shaky.

Also, while we're improving Grid exports, better support for exporting Grid forms to HTML would be fantastic. 
POSTED BY: Matt Pillsbury
Answer
2 years ago
Better support for functional programming. *Mathematica* is pretty good, but there's definitely room for improvement, especially if you need to, say, build a list in a recursive function. Things that would help include:

* Lists built out of cons cells, perhaps constructed using a function named LinkedList or ForwardList, which could be converted to a normal list using Normal. You can do this now, of course, but you either have to use some made-up head for your conses, or be very careful if you're using two-element Lists, and in either case there isn't direct support from functions like `Map`, `Fold`, `Select`, et c.
* Functional data structures for sets (and maybe maps). The obvious example would be red-black tree, but there's a universe of options out there. Again, a key advantage would be integration with existing set-oriented functions like `Union` and `Complement`. `Again`, Normal could be used to turn them back into a list

The key advantage I'm looking for is the ability to efficiently add or delete elements one at a time, which is really convenient in a lot of circumstances, but is really kind of clunky to do in *Mathematica* as it exists now in a way that's efficient. 

Also, `$IterationLimit` should default to `Infinity`; currently if you want to use (tail) recursive approaches, you have to wrap everything in a `Block` to keep from stopping prematurely on all but tiny problems.
POSTED BY: Matt Pillsbury
Answer
2 years ago
Functionality like C++ ostringstreams. Currently it's possible to treat a string as an input stream, but there's no straightforward way to send output to a stream and turn it into a string (you can always right to a temp file and read the file, but that's pretty yucky).
POSTED BY: Matt Pillsbury
Answer
2 years ago
In Mathematica 9 there is a way to define custom streams, though I haven't used it so I'm not deeply familiar with the API. 

If you need to write to a string, ExportString works.

The problem with repeatedly writing to a string is that stings are immutable in Mathematica, so this paradigm doesn't fit it very well.  Of course you can always create a new string by appending to an existing one.
POSTED BY: Szabolcs Horvat
Answer
2 years ago
Circular Hough transform, and possibly the extension to ellipses or even arbitrary shapes.
Same implementation as Radon
POSTED BY: Sander Huisman
Answer
2 years ago

Adding a MaxStepSize option to Plot, so that it would calculate the initial setting for PlotPoints automatically would be convenient.

It would effectively set PlotPoints -> 1 + Ceiling[(x2 - x1)/maxstep] or to the default PlotPoints, whichever is greater.

POSTED BY: Michael Rogers
Answer
1 year ago

This is not exactly a new function, but a request for more consistency on everything that is related to layout and printing:

-> when activating page breaks, everything becomes slow

-> there seems to be no way of influencing the page breaks with what's opened, closed or selected

-> all screen updates between setting new page format, page breaks, etc are completely out of phase (I set A3, go back again, and it says A4, although ruler is showing A3, or sometimes gets stuck on A4, etc).

-> print preview doesn't allows for "selection" option (on Windows)

-> the screen zoom actually influences the outcome of the printing, even when everything set to a printout environment, and there are no magnification related configs (Dingbats get misaligned and cut).

-> on printout environment, ctrl+mouse wheel reduces magnification, in whichever direction we turn

-> Grid forces width but doesn't force height, which feels odd

-> less bugs on Grid, Backgrounds, etc.

-> well, summing up the two last: some clean-up of the Grid, Pane, Item, etc functions. A lot of options are available, but somehow I get the feeling (which is supported by the amount of post from both communities), that we end up always a small step from being able to do what we really wanted. For instance, although Spacing, Margins, etc, all make sense, in real cases, I always get bitten by an extra pixel here and there, that doesn't get out, or with a magnification dependency, etc. And, if there's a Scaled function, couldn't there be a Imaged and an Itemed equivalent?, or a ItemSizeOverride-> {w,h}, or ImageSizeOverride->{w,h}, for functions that have the opposite type as parameter and not option?

-> Something as simple as Grid[{{Item[Rotate["this is a long test example",Pi/2],ItemSize->{3,50}]}},Frame->True] has what I would call an odd behaviour

-> and on this one, the rendering is not the same: Grid[{{Style["ABC abc",15,Bold],Rotate[Style["ABC abc",15,Bold],Pi/2]}}]

I imagine WR is completely aware of this type of inconsistencies (at least, I see WR employees suffering from them when presenting stuff on live), and so, there's no point on going on (I do send bug reports whenever I find new stuff). But I wanted to present my frustration. Doing most type of analysis in Mathematica is extremely fast. But every single time I need to prepare results into some kind of printable report, I end up crossing, not one, but a few bugs (I really mean bugs, and not simply difference of opinions). Also, thinking that I should just deliver a CDF is unrealistic; to start with, the majority of the companies have the computer admin rights blocked, and installing a new software passes through a process of information risk assessment... and putting it accessible through an online service is a no go in a commercial environment.

POSTED BY: Pedro Fonseca
Answer
1 year ago

Hello, I want bayesian networks Now, we have Bayesian statistics and networks André Dauphiné

POSTED BY: André Dauphiné
Answer
1 year ago

Dear All

I made a small list of things I would like to see:

  • Voronoi in 3D
  • Voronoi not limited to points, also support for lines and regions
  • Map operator with level specification: Map[f,"Level" -> levelspec]
  • GeoDistance to accept a list of points (e.g. a trail) giving all the distances for each pair. i.e. a fast implementation of:

    GeoDistance[locs_List] := BlockMap[GeoDistance @@ # &, locs, 2, 1]

    This is now Implemented as GeoDistanceList since V10.4

  • MinMax to work on Interval objects like Min and Max does. (Implemented in V10.3)

  • Casting of shadows in Graphics3D
  • ClippingMask there you can use a polygon to clip some other Graphics object...
  • GPSForm / GPSString to format GPS coordinates
  • General Backtracking algorithm
POSTED BY: Sander Huisman
Answer
9 months ago

A way to control the interpolation for function like ListContourPlot:

enter image description here

It would be nice if one could give a MaxCellSize -> Somenumber in order to get the following triangulation:

enter image description here

Normally the graphic will be completely filled in the ConvexHull of all the point, but this generally created very elongated triangles at the edges...

POSTED BY: Sander Huisman
Answer
9 months ago

Recently lots of fairly basic functions have been added, that seems to serve only as shorthands as they can easily be implemented using already existing functionality.

I would like to see functions to zero out the diagonal of a matrix, or to replace it with something else. This sounds like a simple task too, but implementing it in a way that is fast, robust and memory efficient turned out to be not so easy after all. The only good solution that is also simple so far is the one in @ciao's answer on Mathematica.SE. Given that this is not at all obvious, we could really do with a builtin version.

POSTED BY: Szabolcs Horvat
Answer
9 months ago

I would like better auto-completion for file names:

  • Completion relative to the current kernel directory (Directory[])
  • The ability to add file-name completion for user defined functions.
POSTED BY: Szabolcs Horvat
Answer
9 months ago

Yes, please! I could definitely use that feature.

POSTED BY: Bianca Eifert
Answer
7 months ago

Can we have a "fit to page" option for printing? I always seem to end up with twice the number of pages that would be necessary, half of which are empty or carry a single letter. An option not to cut graphics in two, but to automatically insert a page break where necessary would be nice as well. BTW can we have page setting changes (A4 to A3) that actually stick and work?

POSTED BY: Sjoerd de Vries
Answer
9 months ago

I would like to have a set of basic functions that make it possible to build my own importers for various text based file formats. Mathematica is quite lacking in this regard as it doesn't even have a fast function to convert the usual floating point format 1.234e5.

There's of course the classic Import, which tends to be quite fast on simple formats like CSV, but sometimes it wants to be too smart and ends up breaking things. There's a need to be able to specify more precisely what format I expect and turn off any automatic guessing.

Then there's SemanticImport, which happens to solve the problem I linked to above. We can specify the precise type of each column, which is a step in the right direction, exactly what I want. But it's slow---much slower than Import, and I simply cannot use it for large files, files that are handled fine by import. This is strange because knowing the expected column formats should in principle make things easier and simpler for the importing function ... There's also the thing that while SemanticImport fixed some of the problems of Import, it takes other "problematic" choices even further: it tries to guess even more about what the user wants, it won't let me specify if I want CSV or TSV, etc. In some cases the guesses are bound to be wrong, which is why I also want something that is dumb but follows instructions precisely. SemanticImport is great and convenient but it's too smart for me to trust it blindly ...

And finally there's Interpreter, which is really great, and looks just like the thing I'm asking for. Except that it's awfully slow and wasn't really designed for this task (ref)

Witness:

str = ExportString[RandomReal[1, {100, 100}], "CSV"];
Map[Interpreter["StructuredNumber"], 
   StringSplit[#, ","] & /@ 
    StringSplit[str, "\n"], {2}]; // AbsoluteTiming

{8.972, Null}

"SemanticNumber" is probably the fastest non-string type that Interpreter can read, yet it's almost unusably slow for reading even small CSVs.

Compare Internal`StringToDouble:

In[10]:= Map[Internal`StringToDouble, 
   StringSplit[#, ","] & /@ 
    StringSplit[str, "\n"], {2}]; // AbsoluteTiming

Out[10]= {0.011367, Null}

It's 1000 times faster. But it's undocumented and it has no error checking to detect when the input is not really a number ... I could of course roll my own with LibraryLink, but this really really shouldn't be necessary ...

I am currently working with relatively small (smaller than 100x100) CSV files that have both row and column labels. Import messes up things, I have no more trust in it. SemanticImport fails in multiple ways, including failing to read reals when it automatically guesses that something should be integer. It also takes more than a second to read a 90x30 table, which makes me wonder if it would be usable at all for a 500x500 one ... I cannot change the file format because I'm sharing the files with others who use other tools (mostly R).

I had to resort to writing my own CSV importer to read the files reliably, but it takes 5 seconds to read just this small file.

There simply isn't any way to read these relatively simple labelled matrices in Mathematica quickly, easily and reliably. R can read them with no problem as a proper dataframe but resorting to RLink for something this simply seems very silly!

http://mathematica.stackexchange.com/questions/56876/parsing-a-csv-file-using-interpreter

POSTED BY: Szabolcs Horvat
Answer
9 months ago

I also find the import generally slow, especially compared to Matlab. I always convert my data to Real32 or Real64 binary data, those you can read in really fast (direct copy to memory), but it does not feature structured data of course...

POSTED BY: Sander Huisman
Answer
9 months ago

I'm sure you're aware of this, but just for the sake of completeness: There's also still the good old clunky RegisterImport workflow for cases where you need to implement import from a text-based format from scratch. I have no experience with the speed of this approach though.

POSTED BY: Bianca Eifert
Answer
7 months ago

It would be a nice if modest improvement if XMLTemplate worked with XMLElement or XMLObject arguments as well as string and File arguments. It's not hugely difficult to stick an ExportString in there, but it seems a little weird that we have to do so.

POSTED BY: Matt Pillsbury
Answer
9 months ago

I'd like to see something like the Matlab code for convex optimization (CVX).

POSTED BY: Frank Kampas
Answer
9 months ago

I would like to see LibraryLink provide functions for simple operations that are commonly needed when creating interfaces to other libraries. In particular, I would like to have a function that transposes data while copying it (to an MTensor).

Most libraries store matrices in column-major order (as some distant Fortran-heritage), which differs from Mathematica's row-major preference. This makes frequent transposition necessary when working with these libraries.

A naive double-for-loop transpose does not perform well. Something that is written to make use of SIMD instructions (vectorization) and with cache-effects in mind will perform much better. Rolling your own is not at all trivial. I would like to see LibraryLink provide a function like this out of the box.

Related

POSTED BY: Szabolcs Horvat
Answer
9 months ago

Another function that would be very useful, but not so trivial to implement (I've tried) is MinkowskiAddition. See the example:

enter image description here

Basically it is the addition of two lines or two regions to create a third. In the example it is the addition of the two cat-eye-shaped wedges to create the red shape.

This can be very useful in offsetting a path for example.

POSTED BY: Sander Huisman
Answer
9 months ago

How about real-time audio processing? There is pretty aged support for capturing video and manipulating in real-time, but not for audio.

POSTED BY: George Woodrow III
Answer
9 months ago

A nice addition to FilledCurve and JoinedCurve would be to support circular arcs of the Circle command.

POSTED BY: Sander Huisman
Answer
9 months ago

I wrote this in 2012. Since then we got all kinds of geometric objects but still no 3D circle.

POSTED BY: Sjoerd de Vries
Answer
9 months ago

TilingData which giving: Symmetries, (translation vectors if they are regular), 'unit cell', 'image', generator with a certain size filling a circle/box (region), 'dual'  et cetera...

This is already available in WolframAlpha i think...

POSTED BY: Sander Huisman
Answer
9 months ago

A @= function like the += -= *= counterparts.

b@= f would be equivalent to b = f[b].

Now because Map and Apply and many other functions can be operators you can very nicely apply these to variables:

b = Map[b,f]
b = SortBy[b,Last]
b = TakeSmallestBy[b,Norm,3]

would be:

b @= Map[f]
b @= SortBy[Last]
b @= TakeSmallestBy[Norm,3]

Especially if one could use it with Part, that would be very useful:

b[[All,1]] @= Map[Norm,b[[All,1]]]

would be:

b[[All,1]] @= Map[Norm]

Regarding the name: not sure yet: FixTo?? (like Prefix and Postfix and Infix)

POSTED BY: Sander Huisman
Answer
9 months ago
ReverseSort
ReverseSortBy

Now, obviously one can code this oneself either through wrapping the Sort in Reverse or by using a different second argument to Sort, but I think the ability to do this directly would be a useful simplification and be more expressive.

POSTED BY: Seth Chandler
Answer
9 months ago
NashEquilbrium
NashEquilibriumStrategies
NashEquilibriumValues

These functions would take a strategic (normal) form game and yield an Association which held the equilbrium strategies (both pure and mixed) and the values to the players from playing that strategy. It would work on symbolic games i.e. where the payoffs were symbols and not numbers ) by returning a Piecewise function (or something similar) showing the logical conditions under which each of the strategies would be a Nash equilibrium.

The function would work for n-player games.

This function would need some specification of a data structure to represent a game. Might be done via a mapping of strategy combinations onto values, some sort of tabular structure, or in some other way. It would also have a nice printout of the game in bimatrix form (for two player games) or in a list of matrices for n-player games.

I recognize this is a non-trivial undertaking. I am basically asking for a development project as much as a function, but I still think it would be a good idea. (There's a now-very old package out of New Zealand that has some of this functionality, but it needs a lot more development.)

POSTED BY: Seth Chandler
Answer
9 months ago
Export[blahblah, "Markdown"]
Import[blahblah,"Markdown"]

Markdown is being used A LOT these days in languages such as R. There are many things one can do with Markdown text that are difficult in the Mathematica front end and, it would be useful to be able to work more seamlessly between Mathematica and things like Project Jupyter. By way of example

Export[ Cell[TextData[{ "This is a ", StyleBox["very ", FontSlant->"Italic"], StyleBox["interesting ", FontWeight->"Bold"], "idea. " }], "Text", CellChangeTimes->{{3.651086579454398^9, 3.651086616516877^9}}],"Markdown"]

might yield something like

This is a *very* **interesting** idea.

And something like this

Export[ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"a", " ", SuperscriptBox["x", "2"]}], "+", " ", "bx", " ", "+", "c"}], "==", "0"}], ",", "x"}], "]"}]], "Input", CellChangeTimes->{{3.651086627422246^9, 3.651086642785838^9}}],"Markdown"]

might yield something like

\text{Solve}\left[a x^2+\text{bx}+c=0,x\right]

With the answer looking like this

\ $\left\{\left\{x\to -\frac{\sqrt{-\text{bx}-c}}{\sqrt{a}}\right\},\left\{x\to \frac{\sqrt{-\text{bx}-c}}{\sqrt{a}}\right\}\right\}\$

(By the way, in writing this comment up, I realized that the editor actually has the ability to translate out of LaTeX and Markdown. Cool.

Anyway, this idea is rather inchoate, but Mathematica and its Front End ought to play better with Markdown.

POSTED BY: Seth Chandler
Answer
9 months ago
Integrate[f,x,y];
Integrate[f,x,y,z];

for Integrate[Integrate[f,x],y] ... This usage works already but is missing in the documentation. When Integrate is used as an indefinite integral it is, of course, an inverse operation to the differentiation D. Just as D[f,x,y] makes sense (and is documented), Integrate[f,x,y] makes sense too and should be documented.

For all functions f which allow to find Integrate[f,x,y] one has an exact formula for

Integrate[f,{x,y} el Rectangle[{x0,y0},{x1,y1}]

(not clear why Esc el Esc does not work for the set element symbol). So it should not happen, as it does for

Integrate[1/Sqrt[r*r + x*x + y*y], x, y]
-x + r ArcTan[x/r] - r ArcTan[(x y)/(r Sqrt[r^2 + x^2 + y^2])] + 
 y Log[x + Sqrt[r^2 + x^2 + y^2]] + x Log[y + Sqrt[r^2 + x^2 + y^2]]
rec = Rectangle[{-1, -1}, {1, 1}]
  Integrate[1/Sqrt[x*x + y*y + z*z], {x, y} \[Element] rec]

\!\(\*UnderscriptBox[\(\[Integral]\), \({x, y} \[Element] 
   Rectangle[{\(-1\), \(-1\)}, {1, 1}]\)]\)1/Sqrt[x^2 + y^2 + z^2]

that the two-fold indefinite integral can be done and the definite integral over a rectangle remains unevaluated. Here the case of two variables was taken as a pattern for any number of variables.

POSTED BY: Ulrich Mutze
Answer
9 months ago

Mutze, I am not sure I understand - does not this already work?

Integrate[4 x y, x, y]

x^2 y^2

Also for your tougher example:

rec = Rectangle[{-1, -1}, {1, 1}];
FullSimplify[PowerExpand[Integrate[1/Sqrt[r + x^2 + y^2], 
{x, y} \[Element] rec, GenerateConditions -> False]]]

enter image description here

POSTED BY: Sam Carrettie
Answer
9 months ago

Dear Sam, thank you for your solution. I have to learn this: whenever a Mathematica function does not work as expected, look for the available options. They may make the thing work. In the case of my example this was the 'GenerateConditions -> False' option. Perhaps the documentation should indicate that this option may make the difference between failure and success. That the many arguments syntax really works for Integrate was already stated in my request. My point concerning missing documentation concerning this variant seems still be valid.

POSTED BY: Ulrich Mutze
Answer
9 months ago

I would like to see builtin keyboard shortcuts for entering \[LeftDoubleBracket] and \[RightDoubleBracket].

The first thing I do after installing Mathematica is adding these shortcuts to KeyEventTranslations.tr. This is of course unsupported, and unfortunately in 10.2 the same shortcuts I used to use are now assigned to something else. These characters improve the readability of code significantly and having a shortcut for them would be a great improvement. Esc [[ Esc is just unrealistically slow to type.

POSTED BY: Szabolcs Horvat
Answer
9 months ago

I would like to have Mathematica to convert [[ to \[LeftDoubleBracket] while you type. Just as it does it for -> to a \[Rule]. No need for special short keys! Just a checkbox in the preferences would be nice.

POSTED BY: Sander Huisman
Answer
9 months ago

That might be a problematic thing to implement in a non-annoying way because the system can't tell for sure what you mean when you are typing the closing ]]. Is it ] ] or a double bracket? It would have to match the opening one, of course, but during editing things don't always match perfectly.

POSTED BY: Szabolcs Horvat
Answer
9 months ago

Indeed some checking is necessary. But I think this mechanism is already in place, also for the -> combination: it only appears after you type another character after it...

POSTED BY: Sander Huisman
Answer
9 months ago

What they could do is: If you type a ] character check is there is a [[ ]] pair (where the last brackets of these 4 was the last character typed) and then replace both at the same time...

POSTED BY: Sander Huisman
Answer
9 months ago

@Sazabolcs that is a good suggestion. I always do this and add also CTRL + Q to Quit current kernel.

POSTED BY: Rodrigo Murta
Answer
9 months ago

I have typed Range[Length[x]] a zillion times in my Mathematica life. It would be nice to have a function RangeLength[x] that did the same thing. I suppose it could be named IntegerCorrespondence[x,seq_:{1,1}] so that if we wrote

 IntegerCorrespondence[{"apples","bananas","fruits"},{3,2}]

we would get

{3,5,7}

or if we wrote

 IntegerCorrespondence[{"apples","bananas","fruits"}]

we would get

{1,2,3}

POSTED BY: Seth Chandler
Answer
9 months ago

Isn't it just as easy, or even shorter, to type Range@Length[...]? Or if there's a need to refer to the function without calling it then Range@*Length. The same goes for Reverse@Sort.

POSTED BY: Szabolcs Horvat
Answer
9 months ago

I would like to see more consistent colour schemes between different plotting functions. The default is yellow, blue, green for some, but it's blue, yellow, green for others.

Now suppose I'm in a discussion with someone and I need to show them some ideas quickly. I make a few plots, always using the data variables in the same order, but they get confused and annoyed:

So is the "foo" yellow and the "bar" blue or is it the reverse? But in the other figure it was the opposite! Why can't you just keep it consistent?

enter image description here

POSTED BY: Szabolcs Horvat
Answer
9 months ago

Wow! I never noticed!! crazy indeed! But they appear to be based around:

ColorData[97] /@ Range[3]

Which the Plot function uses, but the other swap them somehow?! I would almost call it a bug...

POSTED BY: Sander Huisman
Answer
9 months ago

The command completion has a preference setting: "Match case in command completion". I switched this one off.

But it does autocomplete (show suggestions) when I type Ran but not when I type ran, can someone confirm? Is this as intended? Or is this only for options? I'd like a feature request for also command completion for that...

POSTED BY: Sander Huisman
Answer
9 months ago

I'd like to see Random Correlation and Covariance matrices. With RLink, the need for this functionality is somewhat reduced, since R has its "clusterGeneration" package that does this, but, still, it would be very useful to have this as built in Mathematica functionality. One could combine the results from this function with things such as MultinormalDistribution to produce populations with correlated features (just as in real life).

Possible usage

 Options[RandomCorrelationMatrix] ={Method->"Onion",
  CorrelationDistribution->TransformedDistribution[Rescale[x,{0,1},{-1,1}],Distributed[x,BetaDistribution[1,1]]}
 RandomCorrelationMatrix[d_Integer,OptionsPattern[]] 
POSTED BY: Seth Chandler
Answer
8 months ago

I would like to see the following functionality to improve Mathematica's capabilities for data science and numerics

1) Algorithmic Differentiation (also known as Automatic Differentiation) functionality.

2) More functions that are Compilable. In particular, functionality that has no symbolic use, such as random deviates from distributions can be made compilable so that simulation based inference can be fast. In fact, Mathematica was way ahead of other languages (Julia, Python etc. ) in terms of JIT compilation and compilation options to C, but somehow has not been able to fully leverage this advantage.

POSTED BY: Asim Ansari
Answer
8 months ago
  • Operator form of GatherBy
  • Operator form of Nest
  • Operator form of Fold
  • Operator form of ....
POSTED BY: Sander Huisman
Answer
8 months ago

Operator form of StringMatchQ and the like would be great, too.

POSTED BY: Matt Pillsbury
Answer
8 months ago

List needs 24 bytes to store values in it.

ByteCount@{}
40
ByteCount@{1}
64

I would like to see IntegerArray, RealArray, ComplexArray in analog of existing ByteArray and undocumented RawArray.

But also I would like to see overloading of all operators (+, -, *, /) and support in all functions (Min, Max etc.) Examples:

ByteArray[{1,2}] + ByteArray[{3,4}] = ByteArray[{4,6}]

ByteArray[{1,2}] + 1 = ByteArray[{2,3}]

ByteArray[{1,2}] + 1.0 = RealArray[{2.0,3.0}]
POSTED BY: Alexey Golyshev
Answer
8 months ago

If you are looking for efficient storage and better performance, then this is already available as packed arrays:

Packed arrays work transparently with many different functions and are meant for numerical computation.

POSTED BY: Szabolcs Horvat
Answer
8 months ago

Thank you. I know about PackedArrays but my idea is little bit different.

ByteCount@ToPackedArray[{}]
40

ByteCount@ToPackedArray[{1}]
112

RawArray supports array types {SignedInteger8, Byte, SignedInteger16, Bit16, SignedInteger32, UnsignedInteger32, SignedInteger64, Real32, Real, Complex128}

ByteArray is equivalent to RawArray["Byte",data]. Overhead is different but the size of one data object is 1 byte. I would like to see simular functionality for integers and reals. And operators overloading as for PackedArrays.

ToPackedArray[{1, 2, 3}] + 1
{2, 3, 4}

Not this:

ByteArray[{1, 2, 3}] + 1
1 + ByteArray[< 3 >]
POSTED BY: Alexey Golyshev
Answer
8 months ago

Packed arrays do store data efficiently: 8 bytes for an Integer (4 bytes on 32 bit systems) and 8 bytes for a Real. What you are seeing when you measure an empty array is a small constant overhead and possibly some inaccuracies in how ByteCount reports (?). Try measuring a much larger array to see this.

POSTED BY: Szabolcs Horvat
Answer
8 months ago

You are right, packed arrays do store data efficiently. WRI integrates multiple functions from the packages into the kernel. ByteArray was introduced in 10.1 but it doesn't support addition, multiplication as the packed arrays. My idea is to make operators overloading and integrate RealArray and IntegerArray into the kernel. Now of course I can use packed arrays from the "Developer`" package.

POSTED BY: Alexey Golyshev
Answer
8 months ago

Sorry, I still don't understand what functionality you are expecting from such a "RealArray" that packed arrays don't already do. Packed arrays are not provided by any package, they are integrated into the kernel. Developer` is just a context containing some functions, not a package. They couldn't possibly be provided by a package and still have such a deep level of integration: packed arrays are the basic data structure for compiled functions and LibraryLink too; automatic and transparent packed array handling is the reason why Mathematica can be fast with numerical computations on large arrays.

Adding arithmetic for ByteArrays is of course something different and unrelated. That's something Mathematica doesn't currently have.

POSTED BY: Szabolcs Horvat
Answer
8 months ago

When I was writing my post, I thought about RawArrays and different types and sizes of data for using the memory even more efficiently than with the packed arrays: SignedInteger8, SignedInteger16 etc. But you are right, packed arrays are sufficiently effective.

WRI can register only the one wish: "Adding arithmetic for ByteArrays"

P.S.: sorry for my English

POSTED BY: Alexey Golyshev
Answer
8 months ago

I would like to see method "ConvolutionalNeuralNetwork" in Classify. I know that ImageIdentify is based on CNN, but I would like to train CNN on my own images.

Also I would like to see improvements of documentation for Predict and Classify - there are a lot of undocumented functionality. For example:

{"NeuralNetwork", "HiddenLayers"-> {{4, "RectifiedLinear"}, {3, "Tanh"}, 3}} and all supported layers are {"LogisticSigmoid", "RectifiedLinear", "Tanh", "SoftRectifiedLinear", "Linear"}

Currently I need searching such information using Options or on the StackExchange.

POSTED BY: Alexey Golyshev
Answer
8 months ago

I would like SemanticImport to support data tables with both column and row labels. A CSV could look like

,A,B
C,1,2
D,3,4

where A and B are column labels and C and D are row labels. It already supports data with only column labels quite well. If this feature is added, it would be useful to be able to trigger it manually (instead of fully relying on automatic detection).

I know that this simple example I showed could be read as SemanticImportString[..., {"String", "Number", "Number"}, HeaderLines -> 1] (with a bit of post-processing), but this sort of data tends to have a large number of columns instead of just a few. Also the number of columns might not be known ahead of time (unless I count manually). I'm hoping for something that can easily handle a 500 by 500 table with row and column labels.

In some fields it is common to have data in this format for (dense, weighted) adjacency matrices, and the vertex labels are very important. While it would be better to distribute this sort of data in a proper graph-oriented format, that is not what is happening in practice and that's not what I need to deal with.

POSTED BY: Szabolcs Horvat
Answer
8 months ago

"HeaderColumns" -> n would be useful indeed!

POSTED BY: Sander Huisman
Answer
8 months ago

I would like to see a few specific improvements to graph drawing / graph layouts.

First I have to say that Mathematica's automatic graph layout is very good compared to the competition. It usually manages to automatically select a layout algorithm that produces a nice result, it is fast, and it adds polishing touches such as rotating the graph to fit in the notebook well, and it has lots and lots of different methods to use. But it also has limitations.

So I would like to have:

  • Better documentation!! The General Graph Drawing tutorial (from v5.x!) should be updated, the edge layout methods (completely undocumented now) should be documented, etc.

  • Many graph layout algorithms sequentially update vertex positions. There should be a way to provide starting positions. This is so that incremental changes to graphs can be visualized. E.g. if I add just one edge, there should be a way to avoid significantly changing the positions of non-affected vertices. Example:

enter image description here

(EDIT: Now I realize that in the example above 9 and 10 were exchanged too. This feature request encompasses all settings that make it possible to visualize incremental changes, including disabling vertex permutations if any algorithms do that ...)

  • Graph layout and visualization should be fully decoupled from other functionality and from graph handling. Functions should not waste time on computing layouts when I don't visualize the graph (NeighborhoodGraph being one notorious example which runs extremely slowly because of this!!). Also, graph visualization should not happen automatically for large graphs (and potentially lock up Mathematica). I should not have to take extra care to always add a semicolon and avoid showing the graph when I'm working with large networks. For large networks, visualization should only happen on demand, not automatically.
POSTED BY: Szabolcs Horvat
Answer
8 months ago

I have similar feelings; I'm always struggling to get the vertices to be where I want them to be. For example I have a graph with all my flights:

enter image description here

Now it would be great if I could move CDG between TLS and ZAG! I'm quite sure this is now not possible; I'd like a way to 'tweak' the layout once the algorithms have done their work...

POSTED BY: Sander Huisman
Answer
8 months ago

A function to convert quantities to prefixed units such that the magnitude is between 1 and 1000. So, 0.023V would be 23mV, 2.7*^4 ohm would be 27 kiloohm, etc.

POSTED BY: Rui Rojo
Answer
8 months ago

A neat way to extract properties from sound objects, such as sample rate, list of samples, etc.

POSTED BY: Rui Rojo
Answer
8 months ago

I would like to see the following improvements to DendrogramPlot (from the HierarchicalClustering standard add-on):

  • ability highlight the lines of the dendrogram plot instead of the background (see HighlightLevel and HighlightStyle)
  • ability to use different colours for each cluster, i.e. here the two separate green parts should have different colours
  • ability to also highlight the leaf labels according to which cluster they are in (HighlightLevel), without needing to do additional manual work

In general, it would be nice if this function were on part with MATLAB's version. MATLAB also supports optimizing the leaf order.

POSTED BY: Szabolcs Horvat
Answer
8 months ago

It would be nice to see implementation of Hidden semi-Markov model: functions HiddenSemiMarkovProcess and FindHiddenSemiMarkovStates.

POSTED BY: Alexey Golyshev
Answer
8 months ago

I would like to have separate functions for testing whether a graph has edge weights or vertex weights. WeightedGraphQ returns True for both. Working with properties (PropretyList, PropertyValue, etc.) is at the moment unreliable so I am not sure what is a robust way to test for this using properties that won't fail in any situation.

POSTED BY: Szabolcs Horvat
Answer
8 months ago

Why PropertyValue is unreliable? Show example please. It's interesting.

EdgeWeightQ[g_]:=!SameQ[PropertyValue[g,EdgeWeight],Automatic]
VertexWeightQ[g_]:=!SameQ[PropertyValue[g,VertexWeight],Automatic]

g=Graph[{1<->2,2<->3,3<->1},EdgeWeight->RandomInteger[5,3]];
{WeightedGraphQ[g],EdgeWeightQ[g],VertexWeightQ[g]}
{True,True,False}

g=Graph[{1<->2,2<->3,3<->1},VertexWeight->RandomInteger[5,3]];
{WeightedGraphQ[g],EdgeWeightQ[g],VertexWeightQ[g]}
{True,False,True}
POSTED BY: Alexey Golyshev
Answer
8 months ago

One example: try your function on Graph[{}, {}].

Yes, this is what I am using right now: WeightedGraphQ[g] && PropertyValue[g, EdgeWeight] =!= Automatic. But given the myriads of problems with properties I have no confidence whatsoever that this won't break in some situation. Also note that it is not documented what PropertyValue[g, EdgeWeight] should return for an unweighted graph, so how do I know that this implementation will always work?

There are countless weird bugs with properties, I can't even keep track of them. To tease them out, try the following things: set various properties such as EdgeWeight, EdgeCapacity, VertexWeight, VertexCoordinates on a graph, then set it again on the result. This fails the second time in some cases unless using very specific syntax: SetProperty[g, VertexCoordinates -> { vertexName -> coord}] instead of SetProperty[g, VertexCoordinates -> {coord}]. Then try setting properties with the alternative Graph[g, EdgeWeights -> ...] syntax, which sometimes fails even though SetProperty works.

SetProperty[KaryTree[63], EdgeWeight -> RandomReal[1, 62]] works. Graph[KaryTree[63], EdgeWeight -> RandomReal[1, 62]] fails. Graph[RandomGraph[{20, 62}], EdgeWeight -> RandomReal[1, 62]] works. Graph[Uncompress@Compress@KaryTree[63], EdgeWeight -> RandomReal[1, 62]] works again

Then try setting properties, then deleting or adding edges or vertices. Try different combinations such as adding vertices with EdgeAdd instead of VertexAdd, i.e. EdgeAdd[Graph[{1,2}, {1<->2}], {2<->3}]. Try running various functions on the result. Even when the property setting appears to work, in past versions it has happened that the graph got corrupted internally in some subtle way so certain things didn't work on it anymore (or even crashed the kernel). I don't know which of these are fixed (one crash I knew about was fixed).

In general I have little faith left in the property framework, and currently I can find no clear way, purely based on documented features, to test whether a graph has edge weights. I guess a promise (in the documentation) that PropertyList[g] will never contain EdgeWeight for non-edge-weighted graphs and will always contain it for edge-weighted ones would be sufficient. I don't actually need separate functions.

POSTED BY: Szabolcs Horvat
Answer
8 months ago

Hah! EdgeWeightQ and VertexWeightQ are True for Graph[{}, {}].

Really there are a lot of weird bugs. It's interesting to know. Thank you!

POSTED BY: Alexey Golyshev
Answer
8 months ago

I would like better support (well, some support, really) for SparseArrays and Strings in Compile; being able to compile recursive functions would be a nice bonus as well.

POSTED BY: Matt Pillsbury
Answer
8 months ago

I'm pretty sure recursive functions can be handled. Probably needs the three argument form of Compile that in effect declares the return type.

POSTED BY: Daniel Lichtblau
Answer
6 months ago

I'd like more freedom in the arguments of EdgeForm. For instance, graph-related functions have the option EdgeRenderingFunction that allows the user to plot edges in Graph3D as Tube objects (just as an example). It would be great if there was an easy way to plot edges of objects in a Graphics3D as tubes as well. I realize that this can often be done either by accessing the underlying data and constructing tubes manually, or by replacing all cases of Line in the output. However, constructs for polyhedra like Cuboid, Tetrahedron, etc., are really handy (I don't want to rewrite them), and the underlying Line objects cannot easily be accessed (not sure they exist at all). Even a hardcoded EdgeForm["Tube",radius,color] would be helpful, but something like a completely free EdgeFormFunction->(something) (as an option of all Graphics3D primitives that support EdgeForm) would be even more awesome.

It's possible that a similar argument could be made for FaceForm, but I don't have an example case in mind right now.

By the way, I really like this thread! Thank you for considering our suggestions.

POSTED BY: Bianca Eifert
Answer
7 months ago

That would be a nice addition indeed! test

POSTED BY: Sander Huisman
Answer
7 months ago

I would like a DecimalForm for output. It would recognize numeric subexpressions, and format them as decimal numbers, with a trailing ... on exact numbers. E.G.

DecimalForm[1/3]
(* 3.33333... *)

DecimalForm[x + Sin[2]/Sqrt[3]]
(* 0.524983... + x *)

The function I have in mind would recognize when a numeric expression represents a real algebraic and avoid parasitic imaginary parts.

POSTED BY: John Doty
Answer
6 months ago

But what about x/3 ? should that be displayed as x*0.333... ? Or in the middle of an equation: (x+ 1/3)/(x+Pi) would then transform to (x+0.3333...)/(x+3.14159265...) to me, that is harder to read...?

POSTED BY: Sander Huisman
Answer
6 months ago

It's an output form you would choose for certain kinds of expressions. I have monsters containing lots of Root constants in mind. If not appropriate for your expression, don't choose it.

POSTED BY: John Doty
Answer
6 months ago

How about touch-screen operations for notebooks?

POSTED BY: Eric Johnstone
Answer
6 months ago

Like what? a nice easy-to-access execute button for each cell? Please elaborate...

To be honest, I don't think Mathematica should be used on a touch display, the input is just way slower than by keyboard. Speech/voice I can't see working either.

POSTED BY: Sander Huisman
Answer
6 months ago

How about full touch-screen functionality for notebooks?

My new notebook computer has both touch screen and keyboard. I also have a wrist mouse problem, so I'm using the touch screen whenever possible. Normal touch screen functions like scroll and expand/contract could cut down on mousing considerably.

POSTED BY: Eric Johnstone
Answer
6 months ago

Your OS doesn't provide a way to scroll with multiple fingers or so? Perhaps some gestures?

POSTED BY: Sander Huisman
Answer
6 months ago

I would like to add a LocalObject and LocalSymbol to a Mathematica file, including the opened ones (including the one on which we would be running the command). I think this could be a great way of extending these functions, so that we could persistently add plain data to a notebook (without going through DynamicModule/SaveDefinitions unnatural techniques), and a halfway to save sessions.

POSTED BY: Pedro Fonseca
Answer
6 months ago

Binning data with associate data

A common 'problem' is that you want to bin data by (e.g.) the x coordinate, and then you want to have the associated y with it. So to do this, I often do:

x={24,19,49,5,27,100,18,28,77,38,82,22,2,13,12,32,69,72,52,90,16,9,63,64,10,31,51,14,80,70,21,30,71,79,37,65,84,47,33,81,40,94,68,58,11,15,97,88,1,99,74,78,91,93,89,26,45,98,95,67,4,92,29,43,85,39,73,23,8,62,83,57,35,41,17,34,75,25,66,53,44,36,50,60,3,46,86,42,20,56,6,87,55,76,54,48,7,96,59,61};
y={6,64,21,13,34,100,7,89,83,50,19,32,43,38,60,14,1,31,99,40,80,78,68,95,55,72,63,65,91,71,9,51,70,97,37,25,20,52,88,22,62,81,66,69,35,75,29,4,26,27,41,33,93,18,42,98,77,44,85,17,11,12,57,94,61,54,23,28,30,67,10,3,46,45,87,79,96,16,24,73,58,53,48,36,90,76,92,2,82,39,5,59,49,15,74,8,47,84,56,86};
ybinnedbyx=BinLists[{x,y}\[Transpose],{0,100,10},{-10000,10000,20000}][[All,1,All,2]]

i.e. I turn it into 2D data, and then I make a very big bin size in the y direction, such that all the data falls in one bin. Of course this works with numerical data, but it doesn't work if the data in the y direction are strings or a list itself or other....

I see four possible solutions (the 3rd being the most neat):

1

A new binning function that returns lists of indices (BinIndices or BinPositions are good candidate names), so that it can used with Extract on other data. Still a little fiddly because it (presumably) returns a list of list of indices, and Extract does not handle that directly, so you probably have to do some combination of Map, Part, and a pure function.

2

A new option to BinLists, for which I have no good name yet but let's call it BinFunctions for now. By default, if I give some 2D data:

{{1,2},{2,4},{3,1.5},{4,8}....}

it will bin it first by Part[#,1]& of the expression and then by Part[#,2]&. That is, first by the first element, then by the second element... If we could supply our own BinFunctions, then we could do something like Part[#,1]& and 1&. such that all the y data goes in one bin.

3

Reduce the necessity to supply n number of binspecs when we have "vectors" of length n. So:

BinLists[{x,y}\[Transpose],{0,100,10}]] 

Would just only bin it by the first element of each vector, ignoring the rest of the vector... This will keep it backward compatible, so that is very good!

4

A new option for BinLists, that is called something like AssociatedData (and a combiner function?). Now it bins first the data, and then combine the results with the associated data using a combiner function (List by default).

POSTED BY: Sander Huisman
Answer
6 months ago

I agree with you. It will be very useful. Recently I had a similar problem. I needed to bin a very big list by {X, Y} and needed information about Z in the every bin. I solved this problem using associations ({X,Y} as a keys, Z as values and Lookup of bins from the BinLists).

POSTED BY: Alexey Golyshev
Answer
6 months ago

Or perhaps, like many other functions in the Wolfram Language, BinListsBy as a name!

POSTED BY: Sander Huisman
Answer
4 months ago

An extension of PalindromeQ:

PalindromeQ[n,b]

Which would check if n is palindrome in its base b representation.

17 is not a palindrome in base 10, but it is in base 2: 10001

POSTED BY: Sander Huisman
Answer
6 months ago

I would like to see a method for the Feynman-Kac Theorem. It solves a very important class of parabolic PDEs.

Link to Wiki

POSTED BY: Edvin Beqari
Answer
6 months ago

It would be nice to have a function that solves the Vehicle routing problem.

POSTED BY: Alexey Golyshev
Answer
6 months ago

I would like to see an option Series for DSolve.

Examples:

eq = {(x^2 + 1)*y''[x] - 4*x*y'[x] + 6*y[x] == 0};
DSolve[eq, y[x], x, Method -> "Series", Point -> (x = a), Order -> 3]
(*Out: {{y[x] -> y[a] + y'[a] (x - a) + (2*a*y'[a] - 3*y[a])/(a^2 + 1)*(x - a)^2 + O[x-a]^4}}*)


ibc = {y[0] == 1, y'[0] == 1};
DSolve[{eq, ibc}, y[x], x, Method -> "Series", Order -> 3

(*Out: {{y[x] -> 1 + x - 3 x^2 - 1/3*x^3 + O[x^4]}}*)


pde = D[u[x, t], {x, 2}] == Exp[Sin[x]]*D[u[x, t], t];
DSolve[pde, u[x, t], {x, t}, Method -> "Series",Point -> {x = a, t = b}, Order -> 2]
(*Out:{{u[x, t] -> 1/2*((x - a)^2*Exp[Sin[a]] + 2*t - 2*b)*Derivative[0, 2][u][a, b] +Derivative[1, 2][u][a, b] (x, a) (t - b) + 
    1/2*Derivative[2, 2][u][a, b] (t - b)^2 + 1/2*(2 x - 2 a)*Derivative[1, 0][u][a, b] + u[a, b]}} *)

ibc = {u[x, 0] == f[x], Derivative[0, 2][u][x, 0] == g[x]};
DSolve[{pde, ibc}, u[x, t], {x, t}, Method -> "Series", Order -> 2]
(*Out: {{u[x, t] -> f[0] + g[0] + f'[0]*x + g'[0]*x*t + 1/2*g[0]*x^2}}*)

ibc2 = {u[x, 0] == x, Derivative[0, 2][u][x, 0] == Sin[x]};
DSolve[{pde, ibc2}, u[x, t], {x, t}, Method -> "Series", Order -> 2]
(*Out: {{u[x, t] -> 1/2*Sin[u]*Exp[Sin[u]]*(-x + u)^2 + Sin[u]*t - t (-x + u)*Cos[u] + u}}*)
POSTED BY: Mariusz Iwaniuk
Answer
6 months ago

A update a DSolve and NDSolve functions of solving Analytically or Numerically higher-order multidimensional partial differential equations.

Examples higher-order partial differential equations to solving:

pde1 = D[u[x, t], {x, 3}] - u[x, t]*D[u[x, t], x] + D[u[x, t], t] == 0
(*Korteweg-de Vries equation*)
pde2 = D[u[x, t], {x, 3}] == D[u[x, t], t]
(*Dym equation*)
pde3 = a^2*D[u[x, t], {x, 4}] + D[u[x, t], {t, 2}] == 0
(*Equation of transverse vibration of elastic rod*)
pde4 = D[u[x, y], {x, 4}] + 2*D[u[x, y], {x, 2}, {y, 2}] +  D[u[x, y], {y, 4}] == 0
(*Biharmonic equation*)

Examples multidimensional partial differential equations to solving:

multipde1 = D[u[x, y, z, t], t] - D[u[x, y, z, t], {x, 2}] - D[u[x, y, z, t], {y, 2}] - D[u[x, y, z, t], {z, 2}] == 0
(*Multidimensional Heat equation*)
multipde2 = D[u[x, y, z, t], {t, 2}] - D[u[x, y, z, t], {x, 2}] - D[u[x, y, z, t], {y, 2}] - D[u[x, y, z, t], {z, 2}] == 0
(*Multidimensional Wave equation equation*)
multipde3 =  D[u[x, y, z, t], {x, 4}] + D[u[x, y, z, t], {y, 4}] + D[u[x, y, z, t], {z, 4}] + D[u[x, y, z, t], {t, 2}] == 0
(*Multidimensional transverse vibration of elastic rod equation*)
POSTED BY: Mariusz Iwaniuk
Answer
6 months ago

A update a Derivative and Integrate functions of solving Fractional Calculus.

Examples:

FractionalD[nu_, f_, t_, opts___] :=  Integrate[(t - x)^(-nu - 1) (f /. t -> x), {x, 0, t}, opts,GenerateConditions -> False]/Gamma[-nu]
FractionalD[mu_?Positive, f_, t_, opts___] :=  Module[{m = Ceiling[mu]}, D[FractionalD[-(m - mu), f, t, opts], {t, m}]]

Solving derivative.

f[x_] := a*x + b;
FractionalD[1/2, f[t], t] /. t -> x
(*(4 a Sqrt[x])/(3 Sqrt[\[Pi]]) + (3 b + 2 a x)/(3 Sqrt[\[Pi]] Sqrt[x])*)

Solving integration.

FractionalD[-1/2, f[t], t] /. t -> x
(*(2 Sqrt[x] (3 b + 2 a x))/(3 Sqrt[\[Pi]])*)
POSTED BY: Mariusz Iwaniuk
Answer
6 months ago

I'd like to see a new function to solve integro-differential equations.

WithThis paper can solve a:

  • differential equations
  • difference equations
  • differential-difference equations
  • fractional differential equations
  • pantograph equations
  • integro-differential equations

Examples only for integro-differential equations:

eq = y'[x] + 2*y[x] + 5*Integrate[y[t], {t, 0, x}] == Piecewise[{{0, x < 0}, {1, x >= 0}}];
IntDSolve[{eq, y[0] == 0], y[x], x]
(*Out: {{y[x] -> 1/2*Exp[-x]*Sin[2*x]}}*)

eq1 = y[x] - 1/2*Integrate[y[t]*x*t, {t, 0, 1}] == 5/6*x;
IntDSolve[eq1, y[x], x]
(*Out: {{y[x] -> x}}*)

eq3 = {y1[x] == x^2 - 1/5*t^5 - 1/10*x^10 + Integrate[y1[t]^2 + y2[t]^3, {t, 0, x}], y2[x] == x^3 + Integrate[y1[t]^3 - y2[t]^2, {t, 0, x}]};
IntDSolve[eq3, {y1, y2}, x]
(*Out: {{y1[x] -> x^2}, {y2[x] -> x^3}}*)

 eq4 = {y1'[x] == 1 + x + x^2 - y2[x] - Integrate[y1[t] + y2[t], {t, 0, x}], y2'[x] == -1 - x + y1[x] - Integrate[y1[t] - y2[t], {t, 0, x}]};
 IntDSolve[{eq4, y1[0] == 1, y2[0] == -1}, {y1, y2}, x, Order -> 3]
 (*Out: {{y1[x] -> 1 + 2 x + x^2/2 + x^3/6 + O[x^4]}, {y2[x] -> -1 - x^2/2 - x^3/6 + O[x^4]}}*)

 eq5 = {f''[x] == 1 - x^3 - 1/2*g'[x]^2 + 1/2*Integrate[f[t]^2 + g[t]^2, {t, 0, x}], g''[x] == -1 + x^2 - x*f[x] + 1/4*Integrate[f[t]^2 - g[t]^2, {t, 0, x}]};
 IntDSolve[{eq5, f[0] == 1, f'[0] == 2, g[0] == -1, g'[0] == 0}, {f, g}, x, Order -> 3]
 (*Out: {{f[x] -> 1 + 2 x + x^2/2 + x^3/6 + O[x^4]}, {g[x] -> -1 - x^2/2 - x^3/6 + O[x^4]}}*)
POSTED BY: Mariusz Iwaniuk
Answer
6 months ago

I'd like to see a new Heun function.

Heun equations include as particular cases the Lame, Mathieu, spheroidal wave, hypergeometric, and with them most of the known equations of mathematical physics. Five Heun functions are defined as the solutions to each of these five Heun equations, computed as power series solutions around the origin satisfying prescribed initial conditions.

POSTED BY: Mariusz Iwaniuk
Answer
6 months ago

Would be very useful indeed!

POSTED BY: Sander Huisman
Answer
5 months ago

A upgrade a DSolve function of solving analytically ordinary differential equations on the solutions presented in this Book.

Handbook of Exact Solutions for Ordinary Differential Equations.Valentin F. Zaitsev, Andrei D. Polyanin.

This book contains nearly 6200 ordinary differential equations and their solutions.

In this Book is included 1940 ordinary differential equations and their solutions. Mathematica can solve only 79 percent.

If DSolve can't solve the answer may like this:

eq = y''[x] + f[x]*y[x] == 0;
DSolve[eq, y[x], x]
(*DSolve[y[x] = Exp[Integrate[Y[x], x] + C[1]] -> {Y'[x] == -Y[x]^2 + f[x]->Y[x] == y'[x]/y[x]}]]*)

eq2 = y''[x] + x*Exp[x]*y[x] == 0;
DSolve[eq2, y[x], x]
(*DSolve[y[x] = Exp[Integrate[Y[x], x] + C[1]] -> {Y'[x] == -Y[x]^2 + x*Exp[x]-> Y[x] == y'[x]/y[x]}]]*)
POSTED BY: Mariusz Iwaniuk
Answer
5 months ago

only 79 percent? Actually, I think that's impressive.

POSTED BY: Frank Kampas
Answer
5 months ago

@Frank Kampas The number is impressive by itself, until you see that Maple solves 92%, and does it on average 25x faster!

POSTED BY: Sander Huisman
Answer
5 months ago

Sander, please post an example of a DE solved by Maple but not Mathematica.

POSTED BY: Frank Kampas
Answer
5 months ago

Have a look at his exhaustive list:

http://12000.org/mynotes/kamek/version1/KERNEL/KEse1.htm#x3-20000

there is a section at the bottom:

Solved by Mathematica but not by Maple

and vice versa...

POSTED BY: Sander Huisman
Answer
5 months ago

I looked at a couple examples of DEs solved by Maple and not Mathematica and the Maple "solutions" had integrals in them. Not what I regard as a solution.

POSTED BY: Frank Kampas
Answer
5 months ago

Though not a 'full' solution. I'd rather have an explicit solution for (say) y in terms of an integral, than an unsolved ODE... Again, I'm not saying Mathematica is bad at solving ODEs. But I think there is still room for improvement.

I'm just curious though if there are mistakes in the solutions of Maple or Mathematica... Not giving a solution is better than a wrong one... I think both companies should do a showdown ;-)

POSTED BY: Sander Huisman
Answer
5 months ago

It's probably possible to write a program that goes through a list of DEs that Mathematica claims to solve and check to see if the solutions are correct.

POSTED BY: Frank Kampas
Answer
5 months ago
DSolve[y'[x] - y[x]^2 - y[x]*Sin[x] - Cos[2*x] == 0, y[x], x]
DSolve[y'[x] + 2*Tan[y[x]]*Tan[x] - 1 == 0, y[x], x]
DSolve[y'[x] - Tan[x*y[x]] == 0, y[x], x]
DSolve[(y'[x])^2 - 2*x^2*y'[x] + 2*x*y[x] == 0, y[x], x]
example 414.
example 415.
DSolve[3*(y'[x])^2 + 4*x*y'[x] - y[x] + x^2 == 0, y[x], x]
DSolve[x*(y'[x])^2 + (y[x] - 3*x)*y'[x] - y[x] == 0, y[x], x]
example 428.
example 429.
example 430.
DSolve[(x^2 + a)*(y'[x])^2 + 2*y[x]*x*y'[x] + y[x]^2 + b == 0, y[x], x]
example 465.
.....
.....

the list goes on...

let's take the first equation:

DSolve[y'[x] - y[x]^2 - y[x]*Sin[x] - Cos[2*x] == 0, y[x], x]
(*Out: DSolve[y'[x] - y[x]^2 - y[x]*Sin[x] - Cos[2*x] == 0, y[x], x]*)

enter image description here

  • Mathematica = 0.
  • Maple = 1.
POSTED BY: Mariusz Iwaniuk
Answer
5 months ago

I would like Mathematica to include a primordial function such as Primordial [n_] := Product [ Prime [ I ] , {I,1,n } ] .Primorialsl are very useful in finding twin primes as they are found at or close to primorials .For example, the first 4 primorials are { 2, 6 ,30, 2310, 30030 }.Twin primes are on either side of these primorials. They are { {1,3}, { 5,7} , {29, 31 } ,{ 2309 , 2311} } .Primorials are also of use in factoring.

POSTED BY: Charles Guderjahn
Answer
5 months ago

I'd like to see a new function Numerical inverse Laplace transform.

Gives a numerical approximation to the inverse Laplace transform of expr evaluated at the numerical value t, where expr is a function of s.

An Example:

f[s_] := 1/(s^2 + 1);
InverseLaplaceTransform[f[s], s, t] /. t -> 1
(*0.8414709848078965*)

 NInverseLaplaceTransform[f[s], s, 1]
 (*0.8414709848078965*)

Can't solve:

  f1[s_] := Exp[s]/s^3;
  f2[s_] := Exp[s]/s^2;
  f3[s_] := 1/Sin[s];
  f4[s_] := s/Gamma[s];

and the list goes!

POSTED BY: Mariusz Iwaniuk
Answer
5 months ago

Isn't this just

InverseLaplaceTransform[f[s], s, 1.]

POSTED BY: Jon McLoone
Answer
5 months ago

InverseLaplaceTransform is a symbolic solver.So it works only in simple cases.Take, for example:

g[s_] := Sqrt[Log[s]/s];
InverseLaplaceTransform[g[s], s, 2.]
(*{InverseLaplaceTransform[s/Log[s], s, 2.]}*)

Can't calculate at t = 2.

So why this new feature is needed

A numerical solver of InverseLaplaceTransform.

NILT = Compile[{{t, _Real}, {n, _Integer}, {e, _Real}, {a, _Real}}, 
Module[{k}, ((1/4) Exp[a t + e]/ t) ( ((1/2) Re[f[s]] /. s -> a + e/t) + Sum[Re[ Exp[(1/4) I k Pi] (f[s] /. s -> a + e/t + (1/4) I k Pi/t )], {k, 1, n}] )]];
 t = 2;
 n = 50000;
 e = 2;
 a = 0;
 NILT[t, n, e, a]
 (*-1.05866*)

for g[s]= Sqrt[Log[s]/s] at t =2 is -1.05866.

POSTED BY: Mariusz Iwaniuk
Answer
5 months ago

When can I finally copy a DMSString like this: DMSString[$GeoLocation]:

"45\[Degree]45'0.000\"N 4\[Degree]50'24.000\"E"

without getting those annoying [Degree]s in there, I would like to see the ° symbol! Inside Mathematica this copy-paste makes sense, but outside it doesn't..

Also more customisability for DMSString when given a GeoLocation would be very welcome!

POSTED BY: Sander Huisman
Answer
5 months ago

Another addition would be to support custom PlotThemes, I know it is (kinda) possible now using (the hidden function):

Themes`AddThemeRules["epic",
  DefaultPlotStyle -> Directive[Blue,Opacity[0.5]],
  Background -> LightBlue,
  AxesStyle -> Red
]

but does not work well when you combine multiple themes...

POSTED BY: Sander Huisman
Answer
4 months ago

I don't see any difference with Mathematica 10.3.1 from a default plot theme if I use that "epic" rule and evaluate, say:

 Plot[Exp[-x] Cos[x], {x, 0, 2 Pi}, PlotTheme -> "epic"]
POSTED BY: Murray Eisenberg
Answer
4 months ago

Hmm try this (clean fresh kernel):

Themes`AddThemeRules["epic", 
 DefaultPlotStyle -> Directive[Blue, Opacity[0.5]], 
 Background -> LightBlue, AxesStyle -> Red]
Plot[Exp[-x] Cos[x], {x, 0, 2 Pi}, PlotTheme -> "epic"]

You should see a very ugly plot!

for me $Version is "10.3.1 for Mac OS X x86 (64-bit) (December 9, 2015)"

POSTED BY: Sander Huisman
Answer
4 months ago

My fault: when I copied and pasted your code for the Themes`AddThemeRules expression, I somehow introduced an error.

The undocumented Themes context has some interesting items, e.g.:

 Themes`ThemeGallery[]

I hope Themes`AddThemeRules gets officially documented and kept in the language: it's a very handy way to consistently treat plots.

POSTED BY: Murray Eisenberg
Answer
4 months ago
POSTED BY: Sander Huisman
Answer
4 months ago

I like a significant front-end improvement regarding (accidentally) showing big expressions. Now it will show an intermediary dialog with a short/shallow form of it with buttons of 'show more', but generating this sometimes takes sometimes forever or crashes it. I would like (an option) to disable this behaviour. I'm often working with variables of a gigabyte or more (big matrices). One typo and the front-end crashes, no way around it. Just a message saying "Expression too big to view" as output is fine, no need for this dialog with options and truncated views.

POSTED BY: Sander Huisman
Answer
4 months ago

Regarding the frontend:

  1. It would be nice to also have a function that has been implemented already during typing. When you type a closing brackets, it will highlight them both momentarily. It would be nice to have this extended; if you cursor/caret is next to a bracket, it would be nice to highlight the other side of the bracket, so you can easily find out in expression that end on: ]}]] which one is which.

  2. In addition it would be nice that once you have your caret on a variable, that it will highlight (bold?) all the instances of this variable.

  3. It would be nice to have a right-click "View definition" if you click on any function, if it is built-in then use the built-in search, otherwise go to the function in the code.

POSTED BY: Sander Huisman
Answer
4 months ago

One that I've had to implement myself, and which I suspect could be a lot more efficient if it were built in, is PrimeRange, which returns all the primes between its lower and upper bound. Currently I have something built on Prime and PrimePi, which works, I guess....