Tagged Questions

Questions on correct (or improved) formulation of Mathematica code to achieve particular results. Use this tag (not "symbol") for questions about all those odd @@ /@ # & and ~ characters.

64 views

How to create assignments to OverVector programmatically

I wish to write a function that accepts two lists. The 1st argument is a list of lists, holding the components of a several vectors. Ex.: comp = {{a, b}, {c, d}}. ...
69 views

Mathematica Empty Plot FourierSinSeries function

I'm trying to get a plot of different order Fourier series of the function x-1, why does Mathematica give me an empty plot? ...
436 views

A documented syntax of FileNames doesn't work?

Documentation discrepancy present through 10.3 According to the documentation for FileNames under Details: However when I attempt to use this syntax I get an ...
126 views

Is there a linter to help write good Mathematica code?

I don't do much real programming, but I've recently been turned on to Atom, which has linter plugins for over 50 languages to make coding easier (most drawing on pre-existing lint-like programs). In ...
87 views

Syntax error in debug mode

Bug introduced in 8.0 and persisting through 10.3.0 It appears that in debug mode, the \[Piecewise] symbol and its associated grid give a syntax error. For a ...
199 views

What is a good way to code long, complex, compilable algorithms?

The functional paradigm of the Wolfram Language used in Mathematica is all around wonderful. For intense numerics, Mathematica comes with the ability to Compile ...
77 views

Negative accuracy numerics ( 0-128 notation )

What does it mean to have a negative accuracy number? I understand 0128 to mean "the number zero to 128 decimal points". Mathematica corroborates this: ...
114 views

Design considerations behind O (a.k.a. BigOh, a.k.a. Landau Order)

This works without any warnings: O[Log[x]]. This raises a warning: O[x^2]. I have a few questions around this: Why is it a ...
94 views

Why does FromDigits transpose its argument (sometimes)?

a = {{1, 2}, {3, 4}, {5, 6}} ; FromDigits /@ Transpose@ a == FromDigits @ a (* True *) The only "strange" syntax I've found in the docs is But it doesn't ...
104 views

“\:”; flagged as syntax error

While answering question 94032, I noticed that Mathematica 10.2 flagged "\:" <> IntegerString[62378, 16, 4] with a red bracket, apparently indicating a ...
108 views

Multiple Constrained Sum

I need to perform a multiple summation, that obeys some conditions. This arises in the study of a statistical physics model. q=Exp[-β]. I would like to ask if ...
67 views

String option names for Cells

They seem to be correctly interpreted. I'm asking because of some minor reasons and a major one: NotebookWrite a Cell with WholeCellGroupOpener option I don't know any official confirmation so let ...
272 views

Syntax error for optional pattern, but only in debugger

This expression (explained here by Leonid) evaluates fine unless Evaluation->Debugger is enabled: h[x : (_Integer) : 1] := x Syntax::sntxf: "x:" cannot be ...
115 views

Is there a way to check whether two notebooks share the same variables?

When I code in Mathematica, I often re-use code from old notebooks which fulfilled a specific purpose; for example, one testing for soft matches in strings, or one that identifies outliers on a graph ...
121 views

Proper treatment of roots and powers in Series?

I have the following problem in Mathematica 9 on Linux. I let Mathematica compute the Series expansion: ...
53 views

Pre-define list of variables to set them in bulk

I understand this is likely tremendously simple, but I cannot work out how to do the following: vars = {b,c} *define variables* vars = {1,2} *set them* Then I ...
91 views

Check an Option without Evaluation

Consider the following: ...
38 views

JLink is really great to act on Java objects and access Java static methods. I'm asking myself if there would be a way to have access to a more recent Java syntax that allows anonymous functions, ...
61 views

Why is Cell > Convert To > InputForm not invertible?

I sometimes post code to PhysicsSE, and I usually convert it to InputForm first before posting, in order to avoid pages and pages of ...
115 views

Assign variables from list inside With or Module

I have found that it is possible to assign variables from lists, as follows. r = {1, 2, 3}; {a, b, c} = r; b 2 However, ...
530 views

NonLinearModelFit with Two Dimensional List of Weights

I'm currently trying to fit Planck's law (B[λ, T]) to measurements, thereby determining Planck's constant. I have a list of triplets containing wavelength, ...
403 views

Conditional statements in intial conditions?

This is potentially a daft question, but I thought I'd ask it; I have some material free to diffuse in a boundary between rn and ro; I've been able to get it working nicely for neumann type boundary ...
208 views

Syntax colouring when using Symbolize

I need to use symbols with suffixes in order to make my code readable in relation to the Eurocodes. To do this I use Symbolize from the ...
53 views

Using Nearest on a 2D List (seeing extra parentheses)

I am working a problem involving colliding particles. I define a list of particle diameters (effectively a bin distribution). I need to know if two particles collide, in what bin diameter should I ...
93 views

SyntaxForm not correctly parsed by FrontEnd

When using TagBox with SyntaxForm, I noticed sometimes it is not well parsed by the FrontEnd....
79 views

This is a follow up to this question. So far, I named "explicit" heads to those that appear explicitly in the expression. For example, f[x] has an explicit head. I ...
44 views

Matching Root[…] objects with patterns, unexpected hidden argument

I needed to write patterns that could distinguish between arbitrary-function and polynomial forms of Root objects, for example, ...
148 views

Defining an operator

Let s be a positive integer and let DifferenceDelta be this function with step = 1. Define <...
39 views

Question on Poincare section example

I'm trying to make a Poincare section. On the Wolfram Documentation Center they give an example that includes the lines ...