Questions tagged [wolfram-mathematica]

Wolfram Mathematica is a computer algebra system and programming language from Wolfram Research. Mathematica has its own Stack Exchange site at https://mathematica.stackexchange.com/ and that site is the preferred place to ask questions about it.

Wolfram Mathematica is a computer algebra system and programming language from Wolfram Research. The programming language is a term-rewriting functional programming language strongly influenced by . Not to be confused with mathematics ().

Mathematica has its own Stack Exchange site. That is the preferred site for asking questions on this topic.

Tips for asking Mathematica questions

  • Include self-contained source code or a link to a notebook that illustrates the issue
  • Include relevant image, for a graphics related question

A chat room for the tag is available here. It is intended for discussion of some meta-related problems and perhaps some social activity.

Free Mathematica Programming Book


Don't forget to check out our little Tool Bag and add your favorite tricks there.

4457 questions
3
votes
3 answers

Mathematica: exporting to a variable path

this is tricky. Once the path to export data in Mathematica is under quotes, how can I insert a variable as part of the path? In other words, I'm inside a loop that increments VAL and want to export MyData to VAL.dat. Ideas?…
PFD
  • 223
  • 1
  • 6
3
votes
2 answers

What is dollar sign $ used for internally?

What is the symbol $ used for internally? I do not mean the compound forms x$388 or $5 etc., just the $ by itself. I am wondering if this is a valid object to use in notation, or what I will break if I do.
Mr.Wizard
  • 24,179
  • 5
  • 44
  • 125
3
votes
2 answers

Unusual Solve[] behavior delay

For a project that involved computing bond lengths from spectroscopic data, I used Solve[] to solve a fairly simple equation for an unknown. I began noticing "unusual" behavior when I changed the input. Specifically, when I changed a number and…
PJR
  • 31
  • 1
3
votes
1 answer

Mathematica: help solving a system of non-linear equations with inequality constraints

I have a system of 4 non-linear equations in 4 unknowns. In addition I have 1 inequality constraint that I need a function of the four unknowns to satisfy (and then I need the four unknowns to be non-negative). My problem has 12 or so parameters and…
Amatya
  • 1,203
  • 6
  • 32
  • 52
3
votes
2 answers

How to get (not display) the section number

Notebook sections can be automatically numbered by inserting the automatically numbering object CounterBox["Section"] using the Insert > Automatic Numbering... menu. However this object only controls the display of the section number and I would…
Sjoerd C. de Vries
  • 16,122
  • 3
  • 42
  • 94
3
votes
1 answer

Is there a builtin Mathematica function to read hexadecimals in 0-9,a-f format?

Is there a builtin Mathematica function that parses strings representing numbers in hexadecimal form, e.g. "89ab"? I could use FromDigits[ ToExpression[Characters["89ab"] /. Thread[CharacterRange["a", "f"] -> Range[10, 15]]], 16 ] or…
Szabolcs
  • 24,728
  • 9
  • 85
  • 174
3
votes
2 answers

Recursive function within an NDSolve is not updating

The code below models a simple SIR model (used in disease control) in Mathematica. (I copied it directly from my notebook). The equations can be solved using NDSolve and the solutions are inserted into three different functions for further use. As…
Sperick
  • 2,691
  • 6
  • 30
  • 55
3
votes
2 answers

Overloading Set[a, b] (a = b)

I would like to overload Mathematica's Set function (=), which turns out to be too tricky for me (see following code example). I successfully overloaded other functions (e.g. Reverse in the code example). Any suggestions? In[17]:=…
phantomas1234
  • 470
  • 3
  • 13
3
votes
1 answer

Serving CDF from webMathematica

Suppose I enter the following (edited) snippet of code into Mathematica. manip = Manipulate[x, {x, 0, 1}]; nb = Developer`UseFrontEnd[ CreateDocument[manip, ShowCellBracket -> False, Visible -> False]]; nbTest = ExportString[nb, "NB"] =!=…
Mark McClure
  • 4,862
  • 21
  • 34
3
votes
2 answers

How to split a an array into several smaller arrays based on a given criterium between neighbours

Mathematica has two very useful functions to group an array into a list of smaller arrays based on given criteria: Split[] and SplitBy[] which I need to emulate in Python3 code: Split[list,test] treats pairs of adjacent elements as identical…
hippo3773
  • 141
  • 2
3
votes
4 answers

Optimize parts extraction

I have this specific function to extract parts of a list in the form: Give[list, elem] returns the part of list that corresponds to the position of elem in a global $Reference variable (if defined). I use this function heavily throughout my code, so…
István Zachar
  • 1,343
  • 2
  • 13
  • 31
3
votes
0 answers

Android Studio Kotlin and Wolfram Alpha api

I'm on the latest version of Android Studio building(trying to at least) an app using kotlin. I created a button that grabs texts input by user, sends that to wolfram alpha through an api request, and outputs the data from WA. However, despite it…
Jeffrey Jordan
  • 135
  • 1
  • 9
3
votes
2 answers

Styling 3D plots as it was in Mathematica 5

I like quiet and undisturbed color gamut and lighting of 3D plots in Mathematica 5. Is it possible to style 3D plots in Mathematica 7 exactly as it was in Mathematica 5? Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}, ImageSize -> 360] <<…
Alexey Popkov
  • 9,355
  • 4
  • 42
  • 93
3
votes
5 answers

Intersecting sublists in Mathematica

I have the following two lists l1 = {{{2011, 3, 13}, 1}, {{2011, 3, 14}, 1}, {{2011, 3, 15}, 1}, {{2011, 3, 16}, 2}, {{2011, 3, 17}, 3}}; l2 = {{{2011, 3, 13}, 40}, {{2011, 3, 16}, 50}, {{2011, 3, 17}, 60}}; and I need to extract items from…
radrat
  • 335
  • 1
  • 4
  • 11
3
votes
2 answers

Output/Generate a set of points from individual equations - Python, JS, Matlab

I began with a set of coordinates, which I then approximated a function to represent them (Fourier series). The function produced is a sum of sin and cos waves: 0.3sin(2x) + 1.7(sin5x) + 1.8(sin43x)... I would like to take this new function that I…
CWrecker
  • 509
  • 7
  • 14