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.

learn more… | top users | synonyms

0
votes
1answer
18 views

Testing Conditions in For Loops

I am attempting to create a set of coefficients that satisfy a set of conditions using the Do function and If statements. I did this successfully with a basic set of conditions: ...
17
votes
0answers
211 views

A documented syntax of FileNames doesn't work?

bug present as of 10.0.2 According to the documentation for FileNames: However when I attempt to use this syntax I get an error: ...
6
votes
0answers
55 views

Negative accuracy numerics ( 0``-128 notation )

What does it mean to have a negative accuracy number? I understand 0``128 to mean "the number zero to 128 decimal points". Mathematica corroborates this: ...
6
votes
0answers
109 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 ...
4
votes
0answers
268 views

Do any mainstream text editors support Wolfram Language syntax for highlighting?

Syntax Highlighting for Mathematica on a Blog There is the above, but I'm not terribly excited to install rogue packages. For example on github, I share lots of Mathematica code. I see no way to ...
4
votes
0answers
165 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 ...
4
votes
0answers
91 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 ...
4
votes
0answers
115 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: ...
2
votes
0answers
45 views

Syntax error in debug mode

Bug persists through 10.1 It appears that in debug mode, the \[Piecewise] symbol gives syntax error. Is it a bug? Are there ways to fix that except write it in ...
2
votes
0answers
50 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 ...
2
votes
0answers
342 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, ...
2
votes
0answers
322 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 ...
2
votes
0answers
201 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 ...
1
vote
0answers
33 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 ...
1
vote
0answers
77 views

CreateDialog opening two windows instead of one

I'm having issues working with code from Mathematica 9.0.1 since I've updated to 10.0.0. My previous code involved using packages to set functions, and then those packages were loaded and the ...
1
vote
0answers
91 views

SyntaxForm not correctly parsed by FrontEnd

When using TagBox with SyntaxForm, I noticed sometimes it is not well parsed by the ...
1
vote
0answers
138 views

Why is my answer being displayed with “Subscript^(0,1)[a,b]”?

I type in my equations using ctrl+- to make it look nice and my answer outputs in "Subscript^(0,1)[a,b]" form? What is going on? In the answer some bits are displayed with the actual subscripts and ...
1
vote
0answers
75 views

Decapitating “explicit” and “implicit” heads

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 ...
1
vote
0answers
39 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, ...
1
vote
0answers
127 views

Defining an operator

Let s be a positive integer and let DifferenceDelta be this function with step = 1. Define ...
0
votes
0answers
26 views

Strange behaviour of VertexEccentricity when switching from map to thread

I want to get a list of vertex eccentricies for all vertices in a graph. This example works just fine: ...
0
votes
0answers
67 views

Resolving initial / boundary condition conflicts ?

This is likely very simple, but I often run into trouble with inconsistent boundary conditions for PDEs; While I know Mathematica sometimes produces "false" errors for spatial derivative conditions, ...
0
votes
0answers
57 views

TableDirection in TableForm

I got confused about what does "the outermost dimension" and "the first dimension" mean in the document I snipped. Does it mean row or column?
0
votes
0answers
170 views

Assigning numerical values to constants results in complex coefficients in Equations of Motion

I am using Mathematica to get the Equations of Motion (EOM) for a mechanical system (using Lagrangian Mechanics). While I get the EOM in symbolic form, on introducing the following code for assigning ...